Help on EA

 

I have a script that opens up a trade in the opposite direction (EURUSD 15M), but it can't seem to detect when the price is falling or rising. Here is piece of code, is there a better way to do this? Thanks.



close <= OrderOpenPrice() - 0.0060

 
johnw213 wrote >>

I have a script that opens up a trade in the opposite direction (EURUSD 15M), but it can't seem to detect when the price is falling or rising. Here is piece of code, is there a better way to do this? Thanks.

close <= OrderOpenPrice() - 0.0060

if (OpenTakeProfit()>0) price is rising if you are buying

 
Thanks.....Can you use this method to detect if the price has fallen to a certain point, like for example, -5.00?
 
ronaldosim wrote >>

if (OpenTakeProfit()>0) price is rising if you are buying

Actually, the command I think you're trying to convey is OrderProfit():

https://docs.mql4.com/trading/OrderProfit

Either way, whether you use that command or the OrderOpenPrice() command you will have to select the order first - not sure if you were aware of that.

- Tovan

 
Thanks guys. It worked!