• Overview
  • Reviews (1)
  • Comments (6)

WalkForwardLight MT5

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 "MQL5\Files" directory. Then it uses these files to automatically build a cluster walk forward report and rolling walk forward reports that refine it (all of them in one HTML file). Using the WalkForwardBuilder MT5 auxiliary script allows building other reports on the same intermediate data for other optimization criteria. This is convenient in that it eliminates the re-optimization step in the tester. The script is free.

There is a similar library for MetaTrader 4 - WalkForwardLight. It has fewer features, it requires performing part of the operations manually.

A detailed User's Guide 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 MT5 library (also available for MetaTrader 4) 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

enum WFO_ESTIMATION_METHOD {wfo_profit, wfo_sharpe, wfo_pf, wfo_drawdown, wfo_profit_by_drawdown, wfo_profit_trades_by_drawdown, wfo_average};

input WFO_ESTIMATION_METHOD Estimator = wfo_profit;

#import "wfL.ex5"
  void wfl_OnTesterInit();
  void wfl_OnTesterPass();
  void wfl_OnTesterDeinit(const WFO_ESTIMATION_METHOD estimator);
  void wfl_OnInit();
  double wfl_OnTester();
  void wfl_OnTick();

Example of use in an expert code

input bool EnableWFL = false;

#include <wfL.mqh>

int OnInit()
  // your working code
  // ...
  if(EnableWFL) wfl_OnInit();

void OnTick()
  // your working code
  // ...
  if(EnableWFL) wfl_OnTick();

void OnTesterInit()
  if(EnableWFL) wfl_OnTesterInit();

void OnTesterPass()
  if(EnableWFL) wfl_OnTesterPass();

void OnTesterDeinit()
  if(EnableWFL) wfl_OnTesterDeinit(Estimator);

double OnTester()
  if(EnableWFL) return wfl_OnTester();
  return 0;
ivanov1253 2017.09.27 12:04   

После установки библиотеки и включении заголовочного файла в тело эксперта терминал выдает ошибку: cannot open file 'wfL.ex5'.

Попробовано на двух разных терминалах.