An advisor that would follow the rate on a five-minute chart with conditions after launch: - page 2

 
Figar0:
salesman77:There are all kinds of people. Those who "don't mind" can also explain in the thread unselfishly.....

Asking and explaining is one thing... If you ask, we will give you a hint. But to write for you or for you a useless crap is another thing...
I would like to get a piece of code that would keep track of the current 5th bar, its prices.... and which would give control to the trading functions when my conditions are broken....
And some free feeder to push the keys for me... :)
 
salesman77:
Figar0:
salesman77:There are all kinds of people. Those who "don't mind" can also explain in the thread unselfishly...... to give a hint.....

Tip and explain is one thing... Ask us and we will give you a hint. Writing useless shit for you or for you is another thing...
I would like to get a piece of code that would keep track of the current 5th bar, its prices.... and which would give control to the trading functions when my conditions are broken....
And some free feeder to push the keys for me... :)

Have you tried herding hedgehogs?
 
if (iOpen(NULL,5,0)-Bid)>Delta*Point) //Цена упала больше Delta пунктов
{
 // действия, торговые приказы
}
if (iOpen(NULL,5,0)-Bid)<Delta*Point) //Цена выросла больше Delta пунктов
{
 // действия, торговые приказы
}
So much for tracking...
 
Figar0:
if (iOpen(NULL,5,0)-Bid)>Delta*Point) //Цена упала больше Delta пунктов
{
 // действия, торговые приказы
}
if (iOpen(NULL,5,0)-Bid)<Delta*Point) //Цена выросла больше Delta пунктов
{
 // действия, торговые приказы
}
So much for tracking...
You think you helped him? :)
 
You can help or not help, you still owe money :)))
 
D500_Rised:
You can help or not help, you still owe money :)))

:-)
 
Figar0:
if (iOpen(NULL,5,0)-Bid)>Delta*Point) //Цена упала больше Delta пунктов
{
 // действия, торговые приказы
}
if (iOpen(NULL,5,0)-Bid)<Delta*Point) //Цена выросла больше Delta пунктов
{
 // действия, торговые приказы
}
So much for following...
I don't get it, but I want to figure it all out. What parameters will be used in this code to track the "current" 5-minute bar. In other words, the Expert Advisor should essentially start a new price report point - a new open bar and if this price changes by 30 points up or down within 5 minutes, then it will perform trade operations, if not, it will start following the next bar, etc..
 

All of this is in the mt4 help:

double iOpen( string symbol, int timeframe, int shift)

Returns the open price value of the bar specified by the shift parameter from the corresponding chart (symbol, timeframe). For the current chart, the open price information is in the predefined array Open[]. Parameters:

symbol - symbol name of the instrument. NULL means current symbol.

timeframe - Period. Can be one of the chart's periods. 0 means period of current chart. (In your case =5)

shift - Index of received value from timeframe (shift relative to current bar by specified number of periods back). - In your case it's=0, - "new tracking".

Well, Delta=30, this is your desired 30 points...

I think you will not find it any easier to explain here. You need at least some minimal knowledge.

 
salesman77: I don't get it, but I want to get to the bottom of it.

I think you just need to start here https://book.mql4.com/ru/.I sometimes read it myself, it's very useful.
 
What am I doing wrong at this stage? Expert doesn't compile....
//+------------------------------------------------------------------+
//| Expert-000001.mq4 |
//| Copyright © 2008, salesman*** |
//| http://www.forexgrand.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, salesman***"
#property link "http://www.forexgrand.ru"
extern int StopLoss=12; // Stop Loss
extern int TakeProfit=3; // Take Profit
extern int Percent=100; // Deal volume in %
extern int Delta=30; // Order Signal in pips
extern string _Comment = "Opened by script"; // Comment on the order.; // Comment to order
extern int MagicNumber =555; // Order ID
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0)

}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
double iOpen( string symbol, int timeframe, int shift)


//----Delta*Point //The price has fallen more than Delta points
{
// trade actions
}
if (iOpen(NULL,5,0)-Bid)<Delta*Point) //The price has risen more than Delta points
{
// trade actions
}
//----
return(0);
}
//+------------------------------------------------------------------+