This is a simplified and effective version of the library for walk forward analysis of trading experts. It collects data about the expert’s trade during the optimization process in the MetaTrader tester and stores them in intermediate files in the “tester/Files” directory. Then these files can be used by the special WalkForwardBuilder script to build a cluster walk forward report and rolling walk forward reports for refining it. The intermediate files should be manually placed to the “MQL4/Files” directory before running the script.
Using this library without the script is meaningless. The script is free.
There is a similar library for MetaTrader 5 – WalkForwardLight MT5. It has more features, in particular, it immediately creates the intermediate files in the “MQL5/Files” directory and generates a report based on them.
A detailed User’s Guide (in Russian) is available in the blog.
This library performs a walk-forward analysis using an unconventional method (details are in the User’s Guide). There is the WalkForwardOptimizer library (also available for MetaTrader 5) for those, who want to adhere to the standard procedure more accurately (as much as possible with an implementation in the built-in tester without third-party programs). It supports more operation modes and provides more customization options, but it is accordingly more complex and more resource-intensive.
The wfL.mqh header file
#import "wfL.ex4" int wfl_OnInit(const int cleanUpTimeout); void wfl_OnTick(); #import
Example of use in an expert code
#include <wfL.mqh> int OnInit() { // ... working code wfl_OnInit(60); } void OnTick() { // ... working code wfl_OnTick(); }