There are no orders in the transaction list. There are two history lists in the terminal - the list of orders and the list of deals. These are the ones to look for exactly what is needed.
Функция HistorySelect() создает в mql5-программе список ордеров и список сделок для дальнейшего обращения к элементам списка посредством соответствующих функций. Размер списка сделок можно узнать с помощью функции HistoryDealsTotal(), размер списка ордеров в истории можно получить с HistoryOrdersTotal(). Перебор элементов списка ордеров лучше...
Or when we close an order, is that the time of the trade?
And how do I filter it out, I am only interested in the order times?
A closed position has at least two orders and two trades. They are the ones which characterise the position. First an order and a trade to open the position, then an order and a trade to close the position. If an order in the form of a pending order may "live" for some time until a deal is executed, then a deal has no such "lifetime" at all.
Alexey Viktorov: A closed position has at least two orders and two trades. It is these that characterise the position. First an order and a trade to open the position, then an order and a trade to close the position. If an order in the form of a pending order can "live" for some time until a deal is executed, then a deal has no such "lifetime" at all.
OK, then how do we determine the time to open a position that is already in history?
Сделка является отражением факта совершения торговой операции на основании ордера, содержащего торговый приказ. Каждая сделка описывается свойствами, позволяющими получить информацию о ней. Для чтения значений свойств используются функции вида Идентификатор позиции, в открытии, изменении или закрытии которой участвовала эта сделка. Каждая...
Сделка является отражением факта совершения торговой операции на основании ордера, содержащего торговый приказ. Каждая сделка описывается свойствами, позволяющими получить информацию о ней. Для чтения значений свойств используются функции вида Идентификатор позиции, в открытии, изменении или закрытии которой участвовала эта сделка. Каждая...
There can be many entries for one position - are you just going to keep telling me bit by bit?
Find the first trade of the DEAL_ENTRY_IN position.
Artem, when you ask such questions, it is 99% that it is written for the forex market and 90% that for the account hadge. Why from the beginning to complicate life to the beginner?
Alexey Viktorov: Artyom, when you ask such questions, it is 99% that it is written for the forex market and 90% that it is for the hadge account. Why to complicate a beginner's life in the beginning?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
This is the time of the trade.
I do not understand.
Not the duration, but the time of transaction.
There are no orders in the transaction list. There are two history lists in the terminal - the list of orders and the list of deals. These are the ones to look for exactly what is needed.
Read the help:
I do not understand.
A closed position has at least two orders and two trades. It is these that characterise the position. First an order and a trade to open the position, then an order and a trade to close the position. If an order in the form of a pending order can "live" for some time until a deal is executed, then a deal has no such "lifetime" at all.
OK, then how do we determine the time of opening a position that is already in the history?
By the transaction property of the ENUM_DEAL_ENTRY enumeration
DEAL_ENTRY_IN
Market entry
DEAL_ENTRY_OUT
Market exit
DEAL_ENTRY_INOUT
U-turn
DEAL_ENTRY_OUT_BY
Close counter position
By the transaction property of the ENUM_DEAL_ENTRY enumeration
DEAL_ENTRY_IN
Market entry
DEAL_ENTRY_OUT
Market exit
DEAL_ENTRY_INOUT
U-turn
DEAL_ENTRY_OUT_BY
Close counter position
There may be many entries for one position - will you give us the information bit by bit?
Find the first trade of the DEAL_ENTRY_IN position.
Okay, then how do you determine the time of opening a position that is already in history?
Read the help - it's all there, and sometimes with examples.
Ok, then how to determine the opening time of a position that is already in history?
Two options
Forum on trading, automated trading systems and testing trading strategies
OrderCloseTime Expert Advisor MQL5
fxsaber, 2018.07.06 00:49
There can be many entries for one position - are you just going to keep telling me bit by bit?
Find the first trade of the DEAL_ENTRY_IN position.
Artyom, when you ask such questions, it is 99% that it is written for the forex market and 90% that it is for the hadge account. Why to complicate a beginner's life in the beginning?