Check order status

To add comments, please log in or register
DeltaElectronics
107
DeltaElectronics  

Hello to everybody,

I have a little problem, because of my little knowledge of MQL5 language... Once I open an order, using OrderOpen() of Ctrade class, now I want to know to check its status at every tick; i.e. I want to know if it is still opened or instead closed because of TakeProfit or StopLoss level is reached.

How to do ?

Pls., help me !!!
Davide

Anthony Garot
2584
Anthony Garot  
I want to know if it is still opened

PositionSelect() will tell you if a position is still open.

https://www.mql5.com/en/docs/trading/positionselect

or instead closed because of TakeProfit or StopLoss level is reached.

Look at the OnTradeTransaction() event.

https://www.mql5.com/en/docs/event_handlers/ontradetransaction

DeltaElectronics
107
DeltaElectronics  

Hello Antony,

Thanks for your reply... but PositionSelect returns only true or false.

I do not know how manage opened oreder or check.

To add comments, please log in or register