New article MQL5 Cookbook: Saving Optimization Results of an Expert Advisor Based on Specified Criteria has been published:
We continue the series of articles on MQL5 programming. This time we will see how to get results of each optimization pass right during the Expert Advisor parameter optimization. The implementation will be done so as to ensure that if the conditions specified in the external parameters are met, the corresponding pass values will be written to a file. In addition to test values, we will also save the parameters that brought about such results.
To gain access to data in the course of optimization, you can use special MQL5 functions: OnTesterInit(), OnTester(), OnTesterPass() and OnTesterDeinit(). Let's have a quick look at each of them:
Now we should define a frame. Frame is some sort of a data structure
of a single optimization pass. During optimization, frames are saved to
the *.mqd archive created in the MetaTrader 5/MQL5/Files/Tester
folder. Data (frames) of this archive can be accessed both during the
optimization "on the fly" and after its completion. For example, the
article "Visualize a Strategy in the MetaTrader 5 Tester"
illustrates how we can visualize the process of the optimization "on
the fly" and then view the results following the optimization.
Author: Anatoli Kazharski