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
if (OrderSelect(OrdersHistoryTotal() - 1, SELECT_BY_POS, MODE_HISTORY))
But I only saw POSITION_TIME that would probably be OrderOpenTime ()
Unfortunately I could not find anything equivalent to OrderCloseTime () in Position Properties
Yes, it's a great job, I tested it and it works.
I had looked before, was seeking to do without it.
I had also looked at this article but did not see any reference to functions related to Order
datetime OrderCloseTime( const ulong Ticket )
return((HistoryOrderGetInteger(Ticket, ORDER_TICKET) == Ticket) || HistoryOrderSelect(Ticket) ? (datetime)HistoryOrderGetInteger(Ticket, ORDER_TIME_DONE) : 0);