Discussion of article "Custom Strategy Tester based on fast mathematical calculations"

 

New article Custom Strategy Tester based on fast mathematical calculations has been published:

The article describes the way to create a custom strategy tester and a custom analyzer of the optimization passes. After reading it, you will understand how the math calculations mode and the mechanism of so-called frames work, how to prepare and load custom data for calculations and use effective algorithms for their compression. This article will also be interesting to those interested in ways of storing custom information within an expert.

For a better understanding of the panel operation, here is its graphical scheme with tooltips: main controls are outlined with frames indicating the class and methods responsible for each group of controls:


Fig. 9. Main controls of the interface

Author: Vasiliy Sokolov

 

Finished reading the source code of ResourceCreator.mqh. Some questions arose

  1. Why they decided not to use standard FileLoad and FileSave?
  2. The developers said that the tester_file directive passes the corresponding file to the Agents only after forced compression. So is the variant with shoving quotes inside (I think you decided so - haven't read further yet) EX5 reasonable or is it an alternative to tester_folder? Have you done any speed research on this case?
  3. Do I understand correctly that on each pass you unpack the internal resource?
 
The moment of position creation is the most interesting in this implementation. Its fields are protected from external modification, but the static CreateOnBarOpen method returns an object of the class with properly set parameters. It is impossible to create an object of this class otherwise, except by calling this method. This is how data protection against unintentional changes is implemented.

They must have forgotten to remove the constructor from public. I don't understand only why they didn't use a regular constructor?

 
Each run can be stored as a separate file inside a single zip archive.

This solution has a weakness in the form of abnormal terminal exit. It will entail loss of data of interrupted Optimisation. And, as you have already noticed, mqd-files cannot be read again.

Besides, this solution does not allow you to use the Analyser on the move.

 

A good article to get you started! Notes

  • It is actually suggested to use a proprietary trading API. Which almost negates the development. It makes sense to have your own tester inside MT5, when the trading API for your tester coincides with the standard one. Otherwise it turns out that you can use some ready-made tester of competitors or the same R with the same benefit.
  • With the mechanism of custom symbols it is not quite clear what such a tester might be needed for.
  • Byte manipulations would be nice to see in a universal form.
  • Comparison of the speed of your tester and the standard one is missing.
  • It is reasonable to use your tester for such a purpose as well

Forum on trading, automated trading systems and testing trading strategies.

Technological singularity of MetaTrader 5

fxsaber, 2017.12.14 14:11 pm.

For custom symbols, there is an option to throw ticks through CustomTicksAdd. This is a very handy thing! By analogy, I would like to see TesterTicksAdd as well as TesterCreate, TesterDestroy. So you can throw your own ticks in the tester and read the trading environment of the current state of the tester.

It would be a breakthrough in algo-trading better than custom feeds, because the scheme of writing a TS would be completely changed. All previous TS implementations would become at once the old standard of algorithmic trading logic.

Thank you to the author!


Why is FrameNext used without while?

 

Cool, but overcomplicated as it seems to me... really, you can find some ready-made tester/optimiser in python and call it if necessary, including on gpu. There should be plenty of python testers.

by the way, there is not a single article about using python scripts in mt5, and this can be very productive.

 
fxsaber:
  • Byte manipulation would like to see in a universal form.

I don't get it. What is a universal view?

fxsaber:

ZY Why is FrameNext used without while?

The last run is passed to OnTesterPass, which loads FrameNext. While is not needed in this case.
 
fxsaber:

This solution has a weakness in the form of an abnormal exit from the terminal. It will cause loss of data of interrupted Optimisation. And, as you have already noticed, mqd-files cannot be read again.

Besides, this solution does not allow you to use the Analyser on the move.

As far as I understand, the data will not be lost because statistics is collected by another instance of the programme. In general, I consider storing all the runs as one archive to be the most successful solution of the whole project.

 
Maxim Dmitrievsky:

Cool, but overcomplicated as it seems to me... really, you can find some ready-made tester/optimiser in python and call it if necessary, including on gpu. There should be plenty of python testers.

by the way, there is not a single article about using python scripts in mt5, and this can be very productive.

Well, how will you use MetaTrader cloud in Python? Even how do you want to run python script on MT?

 
fxsaber:

They probably forgot to remove the constructor from public. I don't understand why they didn't use a regular constructor?

Experiments.

 
fxsaber:

Finished reading the source code of ResourceCreator.mqh. Some questions arose

  1. Why they decided not to use standard FileLoad and FileSave?
  2. The developers said that the tester_file directive passes the corresponding file to the Agents only after forced compression. So is the variant with shoving quotes inside (I think that's what you decided - I haven't read further yet) EX5 reasonable or is it an alternative to tester_folder? Have you done any speed research on this case?
  3. Do I understand correctly that on each pass you unpack the internal resource?
These are all options to explore. Perhaps in the next version I will change a lot of things. Now I made it so that it would drive at least somehow.