PositionSelect() will tell you if a position is still open.
https://www.mql5.com/en/docs/trading/positionselect
Look at the OnTradeTransaction() event.
https://www.mql5.com/en/docs/event_handlers/ontradetransaction
Hello Antony,
Thanks for your reply... but PositionSelect returns only true or false.
I do not know how manage opened oreder or check.
You've probably figured it out by now, but if not, PositionSelect is only used to select the position, then if it returns true, you would want to get information about that position previously selected with another function call.
https://www.mql5.com/en/docs/trading/positiongetdouble
https://www.mql5.com/en/docs/trading/positiongetinteger
if(PositionSelect(Symbol()){ if(PositionGetDouble(POSITION_VOLUME) == 0){ } }
This is just an example on how to access positions information.

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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