Download MetaTrader 5
To add comments, please log in or register
Do you keep a blog? Place a link to MQL5.community there and make money!
Laurentiu Sorin Tene
692
Laurentiu Sorin Tene 2014.01.22 10:24 

Hello,

I try to code an simple EA 

I observe that if an open position is closed by StopLoss "touching" PositionSelect() do not turn from true to false.

Also I observe that if position is closed by CTrade trade trade.PositionClose() than PositionSelect() do turn from true to false.

Please explain why this happens and how can be fixed (I mean to be able toset PositionSelect() to false when position is closed by  StopLoss "touching")

Thanks in advance for help ! 

Alain Verleyen
Moderator
29647
Alain Verleyen 2014.01.22 12:11  
tenlau:

Hello,

I try to code an simple EA 

I observe that if an open position is closed by StopLoss "touching" PositionSelect() do not turn from true to false.

Also I observe that if position is closed by CTrade trade trade.PositionClose() than PositionSelect() do turn from true to false.

Please explain why this happens and how can be fixed (I mean to be able toset PositionSelect() to false when position is closed by  StopLoss "touching")

Thanks in advance for help ! 

Can you post some code showing your issue ?

This is probably related to this My EA does a double entry

/
To add comments, please log in or register