Errors, bugs, questions - page 2220
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
In my opinion, this is a bug when an order is on the trade server, but after the synchronous OrderSend on the terminal there is no sign of it.
I have decided to check how long such phantom orders last when the order is present on the system but not in the terminal.
The result is
An order is present in the system but not in the Terminal for 32 milliseconds! Just imagine the consequences if the trading logic was executed in this interval ...
It is interesting that phantom orders are most often present only atTRADE_TRANSACTION_ORDER_DELETE and at TRADE_TRANSACTION_DEAL_ADD (much rarer) transaction types.
Very bad platform nuance.
ZZY The speed of trade transactions on 5 is questionable, unfortunately.
I decided to check how long such phantom order situations last, when an order is in the system but not in the terminal.
The result is
For 32 milliseconds, there is an order but it is not in the Terminal! Just imagine the consequences if the trading logic was executed during this interval.
Yeah, that's not good. As you can see, these transaction results are sent in different packets. They should be in one.
As you can see, these transaction results are sent in different packages, while they should be in one.
It turns out that the order can be phantom right after OrderSend and the parallel Expert Advisor with OnTradeTransaction cannot always catch this state. I.e. OnTradeTransaction itself sometimes slows down.
Generally speaking, there are lags in MT5 architecturally in different places which are hardly eliminated. These are lags of tick arrivals and now of trade transactions. You need to be clear about what the platform is capable of if you are banking on execution speed. For example, ticks coming in with a decent delay, then transactions... and eventually someone else on MT5 or another platform can overtake, even if you yourself are sitting right next to the exchange.
The trade transactions go in priority packets, overtaking the others. This seriously reduces latency.
How is it possible that the script detects a phantom order situation after OrderSend, but OnTradeTransaction on a parallel EA does not (not always, but it happens)?
The trade transactions come in priority packets, overtaking the others. This seriously reduces latency.
The problem is thatTRADE_TRANSACTION_ORDER_DELETE andTRADE_TRANSACTION_HISTORY_ADD transactions come in different packets and that's why it doesn't matter which priority they have, network latency will anyway.And these transactions must be executed synchronously, one after another, without any intermediate state. I.e. it's one atomic operation in essence, because putting a deleted order into history list has nothing to do with an exchange.
I.e. there are two options here: either these two transactions come together in one package, or the first transaction is not executed in the terminal until the second arrives.
I.e. there are two options: either both transactions come together in one package, or the first transaction is not executed in the terminal until the second one arrives.
There are situations when TRADE_TRANSACTION_DEAL_ADD comes BEFORE the TRADE_TRANSACTION_ORDER_DELETE transaction. In this case even before TRADE_TRANSACTION_ORDER_DELETE the order is still phantom.
Remote agents have stopped optimising
I assume it's because of the new compiler, how can they be updated to make it work?
Also, only part of the optimiser passes 13 out of 28 because of this error.Looking through the code of the Alglib package. It's full of these constructions, making the code more difficult to read:
Isn't it simpler like this?
It seems to me that the execution speed would be even faster.
Why did they make the code so complicated? Or just ported from another language, without any adjustments? But I still wonder why such a complication in the original?