Stock market. Stocks. Speed of trade order execution. - page 16

 
prostotrader #:

Andrey Miguzov You are getting into the kitchen after all...

there are no market orders in the stock market

I thought so too at first... But they put trades on the market (on MOEX) - it's easy to check from the trades feed.

There is a problem with the execution time, I will try to solve it through tech support, but a little later. If they don't fix it. I will most likely leave. back. If you remember, it wasn't always like this at Otkritie either. And, thanks to you, it has become what it is now.


But you have to understand the big difference - MT5 in Otkritie is only MOEX - it's much easier for them to set up the terminal to work on several sections on the same exchange. And to place the equipment closer to the exchange. And that is because they have not yet made an EBS.

And Finam is now offering EBS:

And up to everything you need a small delay, and this is impossible even theoretically. You do understand what opportunities arise with such a number of instruments, don't you? In general, there are + and -'s everywhere

SZS: Not really on this topic, but still. Given the current sanctions against the banking sector I am not sure where it is safer to keep funds now: with a Russian broker (under sanctions) or in the "kitchen". I'm not writing this for the sake of political bickering, it's just that I really don't understand it at the moment. I don't want to offend anyone with this.

 
prostotrader #:

Today, both terminals real

Futures

13 ms

Stocks

26ms and 28ms respectively

Added

Reverse trades
Futures

7 ms

Stocks

26 ms and 27 ms respectively

When I look at your logs and then at mine - my eyes start to "bleed". I'll post the logs a bit later - also on VTB around the same time.Taking into account the analysis I wrote above.

 
Andrey Miguzov #:

When I look at your logs and then mine, my eyes start to bleed. I'll post the logs a bit later - also on VTB around the same time.Taking into account the analysis I wrote about above.

I have about 20-30ms on futures in Otkritie, ping to servers 10-12ms.

 
Andrey Miguzov #:

ZS: Not really on this topic, but still. Given the current sanctions against the banking sector, I'm not sure whether it's safer to keep funds with a Russian broker (under sanctions) or in the "kitchen". I'm not writing this for the sake of political bickering, it's just that I really don't understand it at the moment. I do not want to offend anyone.

There is a very wise Russian proverb:

"Where you were born, where you were born" ....

Added

Picked up a couple of contracts at a tasty price


 
Andrey Miguzov #:

Conclusions:

1) Time in logs and tick times are not the same, which is logical, but I never thought about it before. IMHO, it is not quite correct to measure runtime by terminal logs.

2) Knowing the time of the tick with the accuracy of milliseconds (at the price of which the order is sent from the terminal), you can then (using the history of low-liquid instruments) know the actual "time of execution".

"time_execution_time" = "time_in_the_market_that_called_transaction_in_terminal" - "time_the_market_time_of_your_transaction".

This time will include all network delays from exchange to terminal and back (via broker) + processing time of deal execution on exchange +processing time of tick by expert

I will write about results later.

The actual results (in this case entry by spike - exit by time). I am sorry that there is a lot of text and pictures. You can immediately read the conclusions, everything else is just to confirm them.

Tab Expert Advisors (time of the tick that causes entry/exit into/from the position is highlighted in yellow):

2022.04.11 10:45:19.471 Цена входа bid: 755.8 EMA_ask = 519.7 Цена фьючерса: 2309.0 Цена акции: 0.022570 Время тика: 10:45:18.444 по символу VTBR
2022.04.11 12:45:21.670 Цена выхода ask: 549.0 Цена фьючерса: 2252.0 Цена акции: 0.022170 Время тика: 12:45:20.489 по символу VTBR

Log entry tab:

2022.04.11 10:45:19.476 '': exchange buy 150 VTBR at market
2022.04.11 10:45:19.476 '': exchange sell 15 VBM2 at market
2022.04.11 10:45:19.486 '': accepted exchange buy 150 VTBR at market
2022.04.11 10:45:19.491 '': exchange buy 150 VTBR at market placed for execution in 15.925 ms
2022.04.11 10:45:19.491 '': accepted exchange sell 15 VBM2 at market
2022.04.11 10:45:19.491 '': exchange sell 15 VBM2 at market placed for execution in 13.994 ms
2022.04.11 10:45:19.621 '': deal #2305398 buy 150 VTBR at 0.022570 done (based on order #204678572)
2022.04.11 10:45:19.636 '': deal #2305399 sell 1 VBM2 at 2304 done (based on order #204678573)
2022.04.11 10:45:19.641 '': deal #2305400 sell 14 VBM2 at 2303 done (based on order #204678573)

Ribbon of trades - entry on shares:


Tape of deals - entry on futures


Entry summary:

For the stock:

1) From terminal logs: 10:45:19.621 - 10:45:19.471 = 150ms

2) Tick time in the trades feed: 10:45:18.540 - 10:45:18.444 = 96 ms. And I don't understand how this is possible!!!

For futures:

1) From terminal logs: 10:45:19.641 - 10:45:19.471 = 170ms.

2) Tick time in the trades feed:10:45:18.573 - 10:45:18.444= 129 ms. Here too I don't understand how this is possible!!!


Now for the statistics, it's the same for the exit:

2022.04.11 12:45:21.685 '': exchange sell 150 VTBR at market, close #204678572 buy 150 VTBR 0.022570
2022.04.11 12:45:21.685 '': exchange buy 15 VBM2 at market, close #204678573 sell 15 VBM2 2303.067
2022.04.11 12:45:21.701 '': accepted exchange sell 150 VTBR at market, close #204678572 buy 150 VTBR 0.022570
2022.04.11 12:45:21.701 '': exchange sell 150 VTBR at market, close #204678572 buy 150 VTBR 0.022570 placed for execution in 19.305 ms
2022.04.11 12:45:21.701 '': accepted exchange buy 15 VBM2 at market, close #204678573 sell 15 VBM2 2303.067
2022.04.11 12:45:21.701 '': exchange buy 15 VBM2 at market, close #204678573 sell 15 VBM2 2303.067 placed for execution in 18.989 ms
2022.04.11 12:45:21.841 '': deal #2307117 sell 150 VTBR at 0.022170 done (based on order #204986103)
2022.04.11 12:45:21.857 '': deal #2307118 buy 6 VBM2 at 2252 done (based on order #204986104)
2022.04.11 12:45:21.857 '': deal #2307119 buy 9 VBM2 at 2252 done (based on order #204986104)

Tape of trades - stock exit:


Tape of trades - exit on futures:

Exit output:

For the stock:

1) From terminal logs: 12:45:21.841 - 12:45:21.670 = 171 ms.

2) Tick time in the trades feed:12:45:20.556 - 12:45:20.489= 67 ms. Again!!! And how big is the difference!!!!

For futures:

1) According to terminal logs: 12:45:21.857 - 12:45:21.670 = 187 ms

2) Tick time in the trade feed: 12:45:20.585- 12:45:20.489= 96 ms ...


Conclusions:

When measuring actual delays of execution - you cannot use logs of the terminal ! Or should I use them in some other way, if someone explains it - I'll be grateful :)

Time of "execution" in logs - 150, 170, 171, 187 ms. Time of execution of trades - 96, 129, 67, 96 ms respectively. The average difference is 72.5 ms. The correct time is naturally on the exchange. And this at a ping of 12 ms.


***The "execution" refers to the time interval between sending me a "base" tick from the exchange via a broker and the conclusion of my trade on that "tick" on the exchange. All according to the time of the exchange.

In this time is supposedly included 2 (???? now doubts) network latency of ~ 12 ms (ping) to broker, time of processing tick by terminal, EA (I will measure and add how many ~ ms in my case), server broker, exchange + 2 network latencies of broker.


ZS: how much "execution" at Otkritie then? :) Cool in general, I was afraid it would be the other way round and much worse...

 
Andrey Miguzov #:

Conclusions:

When measuring actual execution delays - the terminal logs cannot be used ! Or should be used in another way, if anyone can explain it - I would be grateful :)

Time of "execution" in logs - 150, 170, 171, 187 ms. Time of execution of deals - 96, 129, 67, 96 ms respectively. Average difference - 72.5 ms. The correct time is naturally on the exchange. And this at a ping of 12 ms.


***The "execution" refers to the time interval between sending me a "base" tick from the exchange via a broker and the conclusion of my trade on that "tick" on the exchange. All according to the time of the exchange.

In this time is supposedly includes 2 (???? now doubts) network latency by ~12 ms (ping) to broker, time of processing tick by terminal, EA (I measure and add how many it is ~ ms in my case), server broker, exchange + 2 network latencies of broker.


ZS: how much "execution" at Otkritie then? :) Generally cool, I was afraid it would be the other way around and much worse...

You just want to link two different times :)

Actually it's very simple.

Execution time, this is the time of sending the order by the terminal and it is written in the log

2022.04.11 11:25:41.599 Trades  'ххххх': sell limit 1 VTBR-6.22 at 2273

before the time of transaction, which is also written in the log.

2022.04.11 11:25:41.612 Trades  'ххххх': deal #111208977 sell 1 VTBR-6.22 at 2273 done (based on order #199905491)

The logged time (it is the same) will be the time of trade order execution (13 ms) plus/minus the error of time the log is kept at.

All confusion arises because MT5 does not work according to the exact time of the exchange, but according to its own time.

 
JRandomTrader #:

I have about 20-30ms in Opening on futures, ping to servers 10-12ms.

Please test to all not indifferent if possible.

In that place of the code, where you get a tick to form the order:

 Print(" Время тика: ", 
       TimeToString((datetime)MathMax(last_tick_stocks.time,last_tick_futures.time),TIME_SECONDS), //в моём случае вход сразу по 2-м инструментам, у Вас возможно 1 символ
       ".", 
       MathMax(last_tick_stocks.time_msc,last_tick_futures.time_msc)%1000, //добавляет мс в строку
       " по символу ", 
       stocks_name); //имя инструмента

And then publish what the EA will show and what will be in the terminal logs for this order.

I will try to find it in the trades pipeline myself. However, it is not always possible to do - we need volumes that are not typical + ideally, we need to fill them at different prices.

 
prostotrader #:

You just want to link two different times :)

It's actually very simple.

Execution time, this is the time of sending the order by the terminal and it is written in the log

to the trade time, which is also written in the log file.

The logged time (it is the same) will be the time of trade order execution (13 ms) plus/minus the error of time the log is kept at.

All the confusion arises because MT5 does not work exactly by exchange time, but by its own time.

I do not mix them together. I take two times from terminal logs in one case and two times from the sliver of deals in the other case. And it is much less with the tape (it should be vice versa in theory). And the tape is right anyway.

Added:

What you give as an example is the terminal logs. We can see how much time has passed in the terminal logs. And how do we know how much time has passed on the exchange? Only the tape of deals.


A rough and brief example:

Let's imagine that we are dealing with a "kitchen". They may send us in logs that the execution time is 1 ms. How to check it? Go to the exchange and look at the time there - this is the only way to roughly understand whether the logs are lying or not.

 
Andrey Miguzov #:

I don't mix them together. I take two times from the terminal logs in one case and two times from the tape of trades in the other case. And it is much less for the tape (although it should be the other way around). And the tape is correct in any case.

Then I don't understand what you want to find out?

The time difference between spot and futures trades?

 
prostotrader #:

Then I don't understand what you want to find out?

The time difference between spot and futures trades?

Added to the post above.

The algorithm is as follows:

We receive a tick from the exchange (tick time is T1).

We analyze it and decide to send an order to buy/sell on the symbol

We send an order

The exchange executes it and fixes the time of execution in the tick-box (time of the exchange - T2)

I am interested in time = T2-T1

Reason: