XIn Li:
I am newbie with mql5? Would like to know how to get last closed orders (market order closed or pending order deleted) ticket number?
Thanks in advance.
Basically you need to use these functions:
https://www.mql5.com/en/docs/trading/historyorderstotal
https://www.mql5.com/en/docs/trading/historyselectbyposition
https://www.mql5.com/en/docs/constants/tradingconstants/orderproperties
ENUM_ORDER_PROPERTY_INTEGER
ORDER_TIME_DONE |
Order execution or cancellation time |
datetime |
Good luck.

Documentation on MQL5: Trade Functions / HistoryOrdersTotal
- www.mql5.com
Returns the number of orders in the history. Prior to calling HistoryOrdersTotal(), first it is necessary to receive the history of deals and orders using the HistorySelect() or HistorySelectByPosition() function. Do not confuse orders of a trading history with current...
Thanks. still a challenging to figure it out.

How get order properties (History)
- 2019.08.06
- www.mql5.com
i want get order properties at history mq5 and select position. see picture. i'm sorry.i use english very bad. Thank you...

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am newbie with mql5? Would like to know how to get last closed orders (market order closed or pending order deleted) ticket number?
Thanks in advance.