PositionSelect() question

 

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 ! 

 
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