How to check if a position has been closed with MQL5?
-
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum #25 (2019)
Forum rules and recommendations - General - MQL5 programming forum (2023)
Messages Editor -
Limit orders are pending orders, not deals.
Please always use the CODE button (Alt-S) when inserting code.
Thank you for your reply.
I tested my code using MQL5 debugging mode and found out that when a position gets closed the OnTradeTransaction() function not triggered.
Can anyone explain why this is so?
In the following snippet, I'm trying to print the details of closed positions.
However, when I tested this snippet by placing an order and close it manually on MT5,
this OnTradeTransaction function not get triggered. Is anything wrong in this code?