Download MetaTrader 5

check what generated the close of position

To add comments, please log in or register
Laurentiu Sorin Tene
692
Laurentiu Sorin Tene  

Hello,

A novice question:

I do not know how to verify/check if a position was closed by "touching" of StopLoss price. I mean that the position was opened with a StopLoss>0; also I coded some other conditions to close the position. How can I distinguish that the position was closed by StopLoss "touching" and not by the others conditions.

Thanks in advance for suggestions!

Alain Verleyen
Moderator
31204
Alain Verleyen  
tenlau:

Hello,

A novice question:

I do not know how to verify/check if a position was closed by "touching" of StopLoss price. I mean that the position was opened with a StopLoss>0; also I coded some other conditions to close the position. How can I distinguish that the position was closed by StopLoss "touching" and not by the others conditions.

Thanks in advance for suggestions!

You have to use OnTradeTransaction() event handler, see this topic.
To add comments, please log in or register