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

 
Figured it out myself :))) brackets are extra after Bid
Is it correct?
 
Yes)
 
Figar0:
Yes)
:) What does the minus after the minus sign before Delta mean?
if (iOpen(NULL,0,0)-Bid <-Delta*Point)
and why isn't it put in the second line?
if (iOpen(NULL,0,0)-Bid >Delta*Point)
 

These lines are absolutely identical (the same)! - this is a condition for sale. - It doesn't matter how you write it, either as in the first line or as in the second.

And for buying I have already written -

if (Ask - iOpen(NULL,0,0)>=Delta*Point) //Цена выросла на больше или = Delta пунктов
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,
            "Купил",MagicNumber,11111,Green);
if(ticket<0){Print("Ошибка открытия ордера BUY #",GetLastError());return(0);}
}
 
rid

This is understandable.
Then why would Delta work differently?

At the time of purchase, as you have:
if (Ask - iOpen(NULL,0,0)>=Delta*Point)

and when you sell it, with a minus sign:
if (iOpen(NULL,0,0)-Bid <-Delta*Point)
 

I don't understand the question. Delta works fine in both cases. When selling, you can write the condition without any minus (by changing the sign to >):

if (iOpen(NULL,0,0)-Bid  >Delta*Point) {
      ticket=OrderSend(Symbol(),1,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,
                 "продал",MagicNumber,22222,Red);
 if(ticket<0){Print("Ошибка открытия ордера SELL #",GetLastError());return(0);}
}
 
In the end, after all the previous advice, I did this:

if (iOpen(NULL,5,0)-Bid<-Delta*Point)  //Цена выросла на больше или = Delta пунктов
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,"Купил",MagicNumber,11111,Green);

}
if (iOpen(NULL,0,0)-Bid>Delta*Point) //Цена упала больше Delta пунктов
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+StopLoss*Point,Bid-TakeProfit*Point,"Продал",MagicNumber,22222,Green);
}
I'll try it tomorrow....
 
Alas, salesman77, it looks like you have wasted an entire day here today! In your last code, the buy condition is the same as the sell condition. The EA will not work correctly. - It will only sell and buy when the price falls below the bar open price by a delta...
 
rid:

These lines are absolutely identical (the same)! - this is a condition for sale. - It doesn't matter how you write it, either as in the first line or as in the second.

And for buying I have already written -

if (Ask - iOpen(NULL,0,0)>=Delta*Point) //Цена выросла на больше или = Delta пунктов
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,
            "Купил",MagicNumber,11111,Green);
if(ticket<0){Print("Ошибка открытия ордера BUY #",GetLastError());return(0);}
}
That's not how it works :(
On rise it buys.....
 
Delta seems to work...
I need to sell when Delta points are rising and buy when Delta points are falling...