MT5 and speed in action - page 13

 
Dmi3:

I am a trader, what I see in my terminals with the naked eye is what I sing about. I'm a trader and I can see what I see on my terminals with my naked eye, that's what I see.

Theoretically, of course, I could put some EA from my laptop at home and look at its behavior.

I just thought the problem might be on the server side, if the history is deep.

 
Aleksey Vyazmikin:

Just thought the problem might be on the server side, if the history is requested in depth.

History in all EAs is requested for the last 120 seconds. There are more than 10,000 orders a day.

 
Dmi3:

History in all EAs is requested for the last 120 seconds. There are more than 10,000 orders a day.

Then the idea is that everything should be in memory.

 

There are about a hundred independent trading logics to be traded. At the same time, there are more than a dozen trading symbols.

Due to lags, it is impossible to cram all this into one asynchronous Expert Advisor. I have to create several Expert Advisors and run them in parallel.

 
fxsaber:

There are about a hundred independent trading logics to be traded. At the same time, there are more than a dozen trading symbols.

Due to lags, it is impossible to cram all this into one asynchronous Expert Advisor. I have to create several Expert Advisors and run them in parallel.

Later, it turns out that it is impossible to cram more than 100 EAs into one terminal and therefore it is necessary to launch several parallel terminals. And then....

 
Dmi3:

And then it turns out that you can't cram more than 100 EAs into one terminal and you have to run several parallel terminals. And then....

Once the lags are removed, it will be possible to cram them into one EA. It will relieve VPS a lot.

 
OnTick queries the tick history from the previous tick.
2020.08.17 21:26:45.729 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:26:47.848 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:26:47.848 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:26:49.959 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:26:53.135 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:26:54.199 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 6 ms.
2020.08.17 21:26:54.199 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:26:54.199 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:26:54.199 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:27:00.525 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:27:08.956 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:27:13.173 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:27:27.931 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:27:30.048 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:27:30.048 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:27:42.669 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.
2020.08.17 21:27:43.726 Alert: Time[NewTicks.mqh 208: ::CopyTicksRange(_Symbol,Ticks,COPY_TICKS_INFO,LastTime)] = 5 ms.

Very stable result.

 

Forum on trading, automated trading systems and strategy testing

Libraries: MT4Orders

fxsaber, 2020.08.18 08:49

Similar result can be seen with output lags > 30 ms.

2020.08.18 05:12:20.760 Alert: Time[MT4Orders.mqh 1746: ::PositionGetTicket(Index)] = 45 ms.
2020.08.18 06:08:07.116 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 38 ms.
2020.08.18 06:44:57.080 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 59 ms.
2020.08.18 07:01:37.171 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 33 ms.
2020.08.18 07:04:19.996 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 34 ms.
2020.08.18 07:04:55.020 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 43 ms.
2020.08.18 07:30:07.414 Alert: Time[MT4Orders.mqh 1746: ::PositionGetTicket(Index)] = 37 ms.
2020.08.18 07:38:31.913 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 40 ms.
2020.08.18 07:44:08.415 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 36 ms.
2020.08.18 07:45:22.918 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 38 ms.
2020.08.18 08:00:37.016 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 40 ms.
2020.08.18 08:01:36.007 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 33 ms.
2020.08.18 08:08:26.948 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 34 ms.
2020.08.18 08:18:41.664 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 33 ms.
2020.08.18 08:48:51.114 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 32 ms.
2020.08.18 09:12:33.762 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 49 ms.
2020.08.18 09:28:42.364 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 47 ms.
2020.08.18 09:28:42.364 Alert: Time[MT4Orders.mqh 1808: ::PositionSelectByTicket(Ticket)] = 38 ms.
2020.08.18 09:30:30.665 Alert: Time[MT4Orders.mqh 1746: ::PositionGetTicket(Index)] = 40 ms.
2020.08.18 09:33:50.114 Alert: Time[MT4Orders.mqh 1746: ::PositionGetTicket(Index)] = 44 ms.
2020.08.18 09:38:41.204 Alert: Time[MT4Orders.mqh 1675: ::PositionSelectByTicket(::OrderGetInteger(ORDER_TICKET))] = 77 ms.

Without trading history decent lags.

 
I haven't figured out how to monitor it yet.
2020.08.18 11:14:05.072 MarketWatchTick:  time = 2020.08.18 11:14:00.674
2020.08.18 11:14:05.195 MarketWatchTick:  time = 2020.08.18 11:14:05.929

On the left is the local time, on the right the time of the last character quotation.

You can see that 100ms has elapsed between the printouts (made in OnTick) of the two lines. At the same time the symbol time has changed by five seconds!


This means that there was a five second lag in character price reception. At the same time (not posted here, but in my log), in real-time CopyTicksRange produced 35 ticks between these two events.


I noticed it by accident and noticed, that many ticks were between neighbour OnTick-calls.

 

I ask the developers to recommend their sequence for checking that the computer is ready for HFT.

For the same HFT you need to prepare a suitable machine. It is probably a good idea to have official recommendations (passing some tests) on this.