Download MetaTrader 5

How to count orders which were closed by StopLoss

To add comments, please log in or register
eseq
93
eseq  

Hello,

 

I am trying to write EA which will change lot size depending on number of losses. Is there a way to count StopLoss execution in MQL4?

 

 

Regards 

Simon Gniadkowski
Moderator
18026
Simon Gniadkowski  
eseq:

Hello,

 

I am trying to write EA which will change lot size depending on number of losses. Is there a way to count StopLoss execution in MQL4?

Look at the OrderClosePrice(),  compare it against the OrderStopLoss() decide if it is close enough to have been closed by the SL . . . there is no 100% method.
To add comments, please log in or register