If I have multiples orders executed in the same trade (same direction) to do averaging price and I would like to get the price of the last order executed, not the final price (average).
How can I get this value?
I tryed to use the function bellow, but this function give me the price of the result of all orders.
TimeTradeServer может возвращать всякую ерунду. Например, значение меньше, чем TimeCurrent. Это сводит полностью на нет его практическое применение.
Если правильно понимаю идею, то TimeTradeServer при работающем терминале должен был вычислять прошедшее время, после получения TimeCurrent и прибавлять эту разность, своего рода эмулируя будущие значения TimeCurrent.
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.
Forum on trading, automated trading systems and testing trading strategies
Get Price of Last Deal (Order Executed)
Guilherme Mendonca, 2017.05.19 14:51
Hello,
If I have multiples orders executed in the same trade (same direction) to do averaging price and I would like to get the price of the last order executed, not the final price (average).
How can I get this value?
I tryed to use the function bellow, but this function give me the price of the result of all orders.
PositionGetDouble(POSITION_PRICE_OPEN)
Forum on trading, automated trading systems and testing trading strategies
Get Price of Last Deal (Order Executed)
fxsaber, 2017.05.19 22:06
What do you want to say ?
TimeTradeServer() can be greater, equal or higher than TimeCurrent(), you can't never know that.
Anyway what that changes ? Nothing.
What do you want to say ?
We understood each other. Why bother?
No problem.
But the code you posted could give a wrong result, depending of the context. I just want people know that.
I have a different mentality, so I will not fully understand. Sorry.
No problem. Unfortunately I can't use Russian language without a translator.
2017.05.19 22:26:14.825 __TEST__ (EURUSD,H1) TimeCurrent = 23:25:34 IS SMALLER TimeTradeServer = 23:26:14
2017.05.19 22:25:45.196 __TEST__ (EURUSD,H1) TimeCurrent = 23:26:08 IS GREATER TimeTradeServer = 23:25:45
No problem. Unfortunately I can't use Russian language without a translator.
2017.05.19 22:26:14.825 __TEST__ (EURUSD,H1) TimeCurrent = 23:25:34 IS SMALLER TimeTradeServer = 23:26:14
2017.05.19 22:25:45.196 __TEST__ (EURUSD,H1) TimeCurrent = 23:26:08 IS GREATER TimeTradeServer = 23:25:45
Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий
Ошибки, баги, вопросы
fxsaber, 2017.05.19 22:35
TimeTradeServer может возвращать всякую ерунду. Например, значение меньше, чем TimeCurrent. Это сводит полностью на нет его практическое применение.
Если правильно понимаю идею, то TimeTradeServer при работающем терминале должен был вычислять прошедшее время, после получения TimeCurrent и прибавлять эту разность, своего рода эмулируя будущие значения TimeCurrent.
Сейчас же запустив советник
можно увидеть любую ерунду
Обратите внимание на даты.
No problem. Unfortunately I can't use Russian language without a translator.
2017.05.19 22:26:14.825 __TEST__ (EURUSD,H1) TimeCurrent = 23:25:34 IS SMALLER TimeTradeServer = 23:26:14
2017.05.19 22:25:45.196 __TEST__ (EURUSD,H1) TimeCurrent = 23:26:08 IS GREATER TimeTradeServer = 23:25:45
Ok, But if would like to input a routine to count how many orders executed my EA already executed in the same trade.
I tryed to use PositionsTotal() but as I'm trading in the same direction to average my price, I think the result is always 1.
But in fact, I need to count, how many Deals (executed order)
Please, give me a light!
Ok, But if would like to input a routine to count how many orders executed my EA already executed in the same trade.
I tryed to use PositionsTotal() but as I'm trading in the same direction to average my price, I think the result is always 1.
But in fact, I need to count, how many Deals (executed order)
Please, give me a light!