Buy Code Robot

 

Hi guys,i'm learning about MQL5 and i'm trying to make a simple robot.

I‌ need to buy after the HIGH price of the hammer,but now ,i'm buying at the same price.

I‌'ve tried to put a order above but this give me Stop invalid.

I‌ dont know how to do that,if you could help :)

t‌o buy,i'm using this code:

        double open_price=SymbolInfoDouble(symbol,SYMBOL_ASK);
 if(!trade.Buy(volume,symbol,open_price,SL,TP))
....

h‌ow can i buy over the high price ?Thanks !

 
saidmrn:

Hi guys,i'm learning about MQL5 and i'm trying to make a simple robot.

I‌ need to buy after the HIGH price of the hammer,but now ,i'm buying at the same price.

I‌'ve tried to put a order above but this give me Stop invalid.

I‌ dont know how to do that,if you could help :)

t‌o buy,i'm using this code:

h‌ow can i buy over the high price ?Thanks !

Ou mean pending orders buystop
 
Thanks,but i solved it mading instant buy only when the price is what i want,so,instead of put pending order,i'm checking the price and buying.
Reason: