Download MetaTrader 5
To add comments, please log in or register
Unable to find the right application? Order it!
raven.chrono
324
raven.chrono 2014.10.22 09:10 

Hi,

I would like to ask if you have an idea on how to detect on an EA whether a trade is activated on StopLoss or TakeProfit.

 

Thanks.

Carl Schreiber
5940
Carl Schreiber 2014.10.22 11:04  

Have a look in your mt4 reference or here under Trade Functions.

Start with keywords OrderHistoryTotal() and OrdersTotal() and the examples there

whroeder1
13610
whroeder1 2014.10.23 12:46  
raven.chrono: how to detect on an EA whether a trade is activated on StopLoss or TakeProfit.
  1. I use
    bool wasSL = MathAbs( OrderClosePrice() - OrderStopLoss() ) < MathAbs( OrderClosePrice() - OrderTakeProfit() );
  2. See also The == operand. - MQL4 forum

/
To add comments, please log in or register