detect close order

 

Hello,

assume i do cycle over pending- or history orders. how do i know an order is intended as CLOSE-order ?

Thank you 

 
chinaski:

Hello,

assume i do cycle over pending- or history orders. how do i know an order is intended as CLOSE-order ?

Thank you 

If open position is reduced or PositionSelect(symbol) returns false.
 

Hello,

thank you for this workaround. I wonder why such orders can't have a position id

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
Reason: