Nope. It does not give me close time of the order.
I want to know equivalent of OrderCloseTime() in MQL4 to corresponding command in MQL5.
Ashok Nale:
I want to know equivalent of OrderCloseTime() in MQL4 to corresponding command in MQL5.
Forum on trading, automated trading systems and testing trading strategies
OrderCloseTime Expert Advisor MQL5
fxsaber, 2018.07.05 22:39
#include <MT4Orders.mqh> // https://www.mql5.com/en/code/16006 void OnStart() { if (OrderSelect(OrdersHistoryTotal() - 1, SELECT_BY_POS, MODE_HISTORY)) { Print(OrderCloseTime()); OrderPrint(); } }
or
Forum on trading, automated trading systems and testing trading strategies
fxsaber, 2018.07.18 03:51
datetime OrderCloseTime( const ulong Ticket ) { return((HistoryOrderGetInteger(Ticket, ORDER_TICKET) == Ticket) || HistoryOrderSelect(Ticket) ? (datetime)HistoryOrderGetInteger(Ticket, ORDER_TIME_DONE) : 0); }
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
Can anyone tell me how I can get Order Close time for any closed order in History?
I tried HistoryOrderGetInteger(tktNum, ORDER_TIME_DONE) But it gives me order opening time which is the first column in History tab of MT5. I want the time which is specified in "Time" column of history tab in MT5.
Please let me know.