OrderOpenTime () is ORDER_TIME_SETUP
I already looked at
OrderGetInteger ()
HistoryOrderGetInteger ()
But it's all confusing.
- Duration of an order remained opened
- what is the differnece between position and order?
- Keeping Track of Winners/Loser for each day
Documentation on MQL5: Trade Functions / PositionGetInteger
- www.mql5.com
The function returns the requested property of an open position, pre-selected using PositionGetSymbol or PositionSelect. The position property should be of datetime, int type. There are 2 variants of the function. 2. Returns true or false, depending on the success of the function execution. If successful, the value of the property is placed in...
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(); } }
Thanks for the answer
But I only saw POSITION_TIME that would probably be OrderOpenTime ()
Unfortunately I could not find anything equivalent to OrderCloseTime () in Position Properties
fxsaber:
Yes, it's a great job, I tested it and it works.
I had looked before, was seeking to do without it.
But thanks
I had also looked at this article but did not see any reference to functions related to Order
thanks
Fabio Fontes:
I had looked before, was seeking to do without it.
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