MT5 and speed in action - page 25

 
A100:
Naturally, no experts/indicators/scripts are running - only manual builds. The latency indicated is reproducible on any average modern 64-bit tablet. If you have an i7 computer, I don't think you've encountered this delay

is the apk or the exe-system slowing down?

 
Today is the day off. Only one symbol in Market Watch. EA is running OnTimer once per second. Found this log.
2020.09.06 00:37:09.187         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 8 ms.
2020.09.06 03:57:17.902         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 1731 ms.
2020.09.06 03:57:18.463         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 2292 ms.
2020.09.06 03:59:49.233         Alert: Time[MT4Orders.mqh 1788: ::PositionGetTicket(Index)] = 2 ms.
2020.09.06 04:35:54.170         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 04:55:34.486         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 05:10:54.387         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 211 ms.
2020.09.06 05:10:54.387         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 895 ms.
2020.09.06 05:23:20.484         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 05:24:41.484         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 05:47:41.492         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 05:50:41.172         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 05:55:45.176         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 05:57:32.169         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 06:17:11.177         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 06:28:03.184         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 06:30:22.482         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 06:48:07.171         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 07:45:12.490         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 08:23:24.172         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 08:24:26.171         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 08:37:57.183         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 09:08:37.180         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 09:12:58.497         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 09:57:20.486         Alert: Ping = 10000.000
2020.09.06 09:57:21.680         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 195 ms.
2020.09.06 09:57:54.171         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 10:47:56.171         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 11:06:21.175         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 11:11:50.208         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 1023 ms.
2020.09.06 11:11:50.537         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 1049 ms.
2020.09.06 11:11:51.502         Alert: Ping = 10000.000
2020.09.06 11:11:52.370         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 187 ms.
2020.09.06 11:19:41.502         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 11:38:00.176         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 13:49:02.493         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 14:03:28.171         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 14:45:05.175         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 16:43:51.196         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 17:00:17.494         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 17:40:02.486         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 17:54:00.180         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.09.06 18:16:47.173         Alert: Time[NewTicks.mqh 33: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.

On the other Terminal, Optimisation is running in parallel on six local Agents out of a possible eight.

If these are network breaks, why does it affect getting the last tick from the Market Watch and getting the last tick from the tick history?


ZZY The Terminal log is on the same stretch.

2020.09.06 01:48:38.338 Network '': scanning network for access points
2020.09.06 01:48:40.195 Network '': scanning network finished
2020.09.06 03:57:04.504 Network '': connection to RannForex-Server lost
2020.09.06 03:57:15.249 Network '': authorized on RannForex-Server through as.eu 6 (ping: 56.41 ms, build 2560)
2020.09.06 03:57:15.249 Network '': previous successful authorization performed from xx.xx.xx.xx on 2020.09.05 21:59:42
2020.09.06 03:57:15.678 Network '': terminal synchronized with RannForex Limited: 1 positions, 0 orders, 67 symbols, 0 spreads
2020.09.06 03:57:15.678 Network '': trading has been enabled - hedging mode
2020.09.06 03:57:17.500 Network '': scanning network for access points
2020.09.06 03:57:20.416 Network '': scanning network finished
2020.09.06 05:10:52.296 Network '': connection to RannForex-Server lost
2020.09.06 05:10:53.033 Network '': authorized on RannForex-Server through as.eu 6 (ping: 56.31 ms, build 2560)
2020.09.06 05:10:53.033 Network '': previous successful authorization performed from xx.xx.xx.xx on 2020.09.06 05:10:59
2020.09.06 05:10:53.299 Network '': terminal synchronized with RannForex Limited: 1 positions, 0 orders, 67 symbols, 0 spreads
2020.09.06 05:10:53.299 Network '': trading has been enabled - hedging mode
2020.09.06 09:57:18.310 Network '': scanning network for access points
2020.09.06 09:57:20.396 Network '': scanning network finished
2020.09.06 09:57:20.396 Network '': auto connecting to a better access point with 93 % quality (previous: 77 %)
2020.09.06 09:57:20.397 Network '': connection to RannForex-Server lost
2020.09.06 09:57:21.151 Network '': authorized on RannForex-Server through as.eu 5 (ping: 41.60 ms, build 2560)
2020.09.06 09:57:21.151 Network '': previous successful authorization performed from 
xx.xx.xx.xx  on 2020.09.06 05:10:59
2020.09.06 09:57:21.208 Network '': terminal synchronized with RannForex Limited: 1 positions, 0 orders, 67 symbols, 0 spreads
2020.09.06 09:57:21.208 Network '': trading has been enabled - hedging mode
2020.09.06 11:08:16.952 Network '': connection to RannForex-Server lost
2020.09.06 11:11:48.892 Network '': authorized on RannForex-Server
2020.09.06 11:11:48.892 Network '': previous successful authorization performed from xx.xx.xx.xx on 2020.09.06 11:11:55
2020.09.06 11:11:48.970 Network '': terminal synchronized with RannForex Limited: 1 positions, 0 orders, 67 symbols, 0 spreads
2020.09.06 11:11:48.970 Network '': trading has been enabled - hedging mode
2020.09.06 11:11:49.152 Network '': scanning network for access points
2020.09.06 11:11:51.319 Network '': scanning network finished
2020.09.06 11:11:51.319 Network '': auto connecting to a better access point with 92 % quality (previous: 91 %)
2020.09.06 11:11:51.320 Network '': connection to RannForex-Server lost
2020.09.06 11:11:52.035 Network '': authorized on RannForex-Server through as.eu 5 (ping: 43.31 ms, build 2560)
2020.09.06 11:11:52.035 Network '': previous successful authorization performed from xx.xx.xx.xx on 2020.09.06 11:11:55
2020.09.06 11:11:52.088 Network '': terminal synchronized with RannForex Limited: 1 positions, 0 orders, 67 symbols, 0 spreads
2020.09.06 11:11:52.088 Network '': trading has been enabled - hedging mode
2020.09.06 17:11:49.928 Network '': scanning network for access points
2020.09.06 17:11:52.112 Network '': scanning network finished
 
fxsaber:

If these are network breaks, why does it affect getting the last tick from the Market Watch and getting the last tick from the tick history?

Careful analysis has shown that CopyTicks is slowing down when there are network breaks.

2020.09.06 21:22:24.105         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 1619 ms.
2020.09.06 21:22:24.515         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 2347 ms.
2020.09.06 21:22:53.814         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 274 ms.
2020.09.06 21:22:53.814         Alert: Time[NewTicks.mqh 43: ::CopyTicks(_Symbol,Tick,COPY_TICKS_ALL,0,1)] = 686 ms.

2020.09.06 21:20:59.301 Network connection to RannForex-Server lost
2020.09.06 21:22:21.043 Network authorized on RannForex-Server
2020.09.06 21:22:21.043 Network previous successful authorization performed from xx.xx.xx.xx on 2020.09.06 11:11:59
2020.09.06 21:22:21.508 Network terminal synchronized with RannForex Limited: 1 positions, 0 orders, 67 symbols, 0 spreads
2020.09.06 21:22:21.508 Network trading has been enabled - hedging mode
2020.09.06 21:22:21.915 Network scanning network for access points
2020.09.06 21:22:28.819 Network scanning network finished
2020.09.06 21:22:45.523 Network connection to RannForex-Server lost
2020.09.06 21:22:52.951 Network authorized on RannForex-Server through as.eu 6 (ping: 56.55 ms, build 2560)
2020.09.06 21:22:52.951 Network previous successful authorization performed from xx.xx.xx.xx on 2020.09.06 21:22:28
2020.09.06 21:22:53.024 Network terminal synchronized with RannForex Limited: 1 positions, 0 orders, 67 symbols, 0 spreads
2020.09.06 21:22:53.024 Network trading has been enabled - hedging mode
 
fxsaber:


if (OrderSend(Request, Result))
    _B2(HistorySelect(0, INT_MAX)); // В каком месте самострел?

First of all, FYI.

"If thebasic structure check (pointer check) is successful, true is returned -it does not indicate successful execution of the trade operation. To get a more detailed description of the result of the function execution, the fields of theresultstructure should be analysed."


Secondly, according to your logic, if an order is opened, you don't add it to the list of orders, but completely invalidate the cache)?

You can THAT optimize all code, that you have HistorySelect will be the last place for questions on execution time) Use caching. You can invalidate it, for example, once a day, but it will significantly speed up your EA.

 
Andrey Pogoreltsev:

Well, first of all

You either have to run the code to understand it correctly, or read it very well from a worksheet.

Secondly, according to your logic, if an order is opened, you don't add it to the list of orders, but invalidate the cache entirely)?

The order list does not change. Read the code.

 
fxsaber:

to understand the code correctly, you either have to run it or read it very well from the sheet.

The list of orders does not change. Read the code.

Here

if (OrderSend(Request, Result))
    _B2(HistorySelect(0, INT_MAX)); // В каком месте самострел?

I see this logic:

  1. If a trade request is successfully sent to the server
  2. We select the entire history

But it can be that the request is already rejected on the server - there is no check for this in this code. What is the point of selecting the history? What do we want to see there?

Here, in these two lines of code, I personally don't see the point. I would see it if there was a check to change the story before selecting it. Maybe, of course, these two lines don't give you a complete picture of the task. But the connection between successfully sending a request to the server and selecting the entire history is not clear to me. Even if the server successfully sends a request, the list of market orders and positions will be changed. What does the history list have to do with it?

 
Artyom Trishkin:

Here's where

I see this logic:

  1. If a trade request is successfully sent to the server
  2. Select the entire history

But it could be that the request was already rejected on the server - there is no check for this in this code. What is the point of selecting the history? What do we want to see there?

Here, in these two lines of code, I personally don't see the point. I would see it if there was a check to change the story before selecting it. Maybe, of course, these two lines don't give you a complete picture of the task. But the connection between successfully sending a request to the server and selecting the entire history is not clear to me. Even if the server successfully sends a request, the list of market orders and positions will be changed. What does this have to do with the history list?

If - to get rid of the compiler warning. It has nothing else to do.

This thread is not for teaching you how to write EAs. It is intended to eliminate the weaknesses of the Terminal. Developers need a simple, concise and reproducible code to understand it. I don't write anything of this kind for myself, of course. The fact is, the Combat Advisor logs the brakes. I start digging and realize that the slowdown occurs when someone (at least by hand) modifies a position. This resets the historical cache, although the history doesn't change, of course.


The code demonstrates the problem perfectly. There's never a need to clutter up the replay code with any unnecessary checks. Its job is to clearly show the problem. And when fixed - to prove that everything works correctly now.

 
fxsaber:

to understand the code correctly, you either have to run it or read it very well from the sheet.

The list of orders does not change. Read the code.

Consider that I am very good at reading from the sheet :)


This code you took from somewhere else and you have there a new position creation, which is executed, right?

Otherwise the whole point of your code boils down to updating TP of the current position and invalidating the cache for the sake of it, which is also very strange.

In either of those two cases no logic is used to optimise the caching operation. In addition, your solution is not scalable, as it leads to increased braking as the history grows.

 
fxsaber:

The code perfectly demonstrates the problem. There is never any need to clutter up the replay code with any unnecessary checks. Its job is to clearly show the problem. And when corrected - to prove that everything works correctly now.

So by your logic, this code here

int v = 0.0;

for (int i = 0; i < 1000000; i++) {
    v = i;
}

std::cout << "The last number: " << v << std::endl;

demonstrates processor sluggishness?

 
Andrey Pogoreltsev:

You got this code from somewhere and you have it there by creating a new position, which does get executed, right?

Rhetorical question: what are you trying to achieve here?
Andrey Pogoreltsev:

So, according to your logic, this code here

shows processor slowness?

I'm not answering any more as you are talking nonsense.