Tester supporting MG4 scripts and advisors - page 11

 
Renat:

CopyXXX has the same speed as iClose/iOpen/iXXXX functions. Only iXXX returns one element at a time and CopyXXX returns many and thus is more efficient and faster.

Probably, you don't consider that MT4 forcibly copies _all_ history of the local chart into local (cache) EA's market environment before each tick handler start. And this is very expensive, although we have a method for economical updating of this information. The special function RefreshRates in MQL4 causes forced refreshing of caches and history of the local chart.

Calling CopyXXX is much more efficient, with a very precise and accurate mechanism for caching previously requested data. For example, you don't need to re-request the deep history on every tick, but store/write it locally and access it as quickly as possible.

If we compare the old methods of "direct" (not actually direct access) access Open/High/Low/Close and work with local array double local[xxxx], the latter is many times faster. Therefore, it is better to copy to yourself locally and then have fast local access to repeatedly queried data.

What is meant by "tick handler" - custom functions like OnTick? Why do you want to copy the entire history and not just the data that appears?
 
Vinin:
This is not an indicator.
I gave a link to an OOP indicatorhere.
 
C-4:
What is meant by "tick handler" - custom functions like OnTick? Why is it necessary to copy the whole history and not just the data that appeared?

Yes, OnTick/OnStart.

I take it as a revelation to many that direct access to the local chart in MT4 is not really direct. There's double the memory consumption and synchronisation losses.

Fortunately, the cache refresh is economical, but it still causes system costs. In MT5 we completely got rid of local cache and the system overhead before call of OnTick/OnStart is less.

 
Renat:

Yes, OnTick/OnStart.

I take it as a revelation to many that direct access to the local chart in MT4 is not really direct. There's double the memory consumption and sync losses.

Fortunately, we have a sparing cache update, but it still gives system costs. In MT5 we got rid of local cache completely and the system overhead before OnTick/OnStart call is less.

A year ago we were discussing performance of MT4/MT5 testers. The standard EA "MovingAverage" in MT4 performed a single run in a minute under similar testing conditions while in MT5 it did it in 2:34. Why the difference in time scale? The first thing that comes to mind is "modularity" of MT5 and large volume of trading environment that MT5 has to pull during the run.
 
C-4:
A year ago we discussed the performance of MT4/MT5 testers. The standard EA "MovingAverage" in MT4 performed a single run in a minute under similar testing conditions, while in MT5 it took 2:34. Why the difference in time scale? The first thing that comes to mind is "modularity" of MT5 and large volume of trading environment that MT5 has to pull during the run.

Modularity, external process and better modelling of the environment, tailored for multicurrency execution.