Login / Register
Add a review
Log in
Sign UP
WalkForwardBuilder MT5


This script helps you perform a walk-forward analysis of trading experts based on special data collected by the WalkForwardLight MT5 library. The script builds a cluster walk-forward report and the rolling walk-forward reports that refine it in the form of a single HTML page. The script is optional, because the library itself automatically generates a report immediately after the optimization is completed in the tester. However, the script is convenient because it allows you to rebuild the HTML report on the same collected data, using other available optimization criteria, for example, profit factor, drawdown, etc.

The script only works in conjunction with the library. The library is purchased separately and must be integrated into the Expert Advisor.

There is a similar script for MetaTrader 4-WalkForwardBuilder.

A detailed User guide is published in the blogs.

This script performs walk-forward analysis in an unconventional way (see the Manual for details). For those who want to follow the standard procedure more precisely, as far as possible when implemented on an embedded tester without external programs, there is another library, WalkForwardOptimizer MT5 (in MetaTrader 4, its analog is a set of tools consisting of the WalkForwardOptimizer library and the WalkForwardReporter script).

[spoiler title=”

  • Folder – the name of the folder with files with meta data; if the parameter is left empty, the script looks for the folder name in the WFL_FILE_ global variable that the library creates;
  • Estimator-optimization criterion; available values-wfo_profit, wfo_sharpe, wfo_pf, wfo_drawdown, wfo_profit_by_drawdown, wfo_profit_trades_by_drawdown, wfo_average;

Cluster Report

The cluster report at the top of the HTML page contains generalized tables of the Expert Advisor’s forward testing results with different combinations of the optimization window size and the forward testing step size. The columns correspond to the size of the window in 10%, 20%, 30%, 40%, 50% from the total date range in the tester settings. The rows correspond to the forward-step dimensions in 5%, 10%, 15%, 20%, 25%, 30% depends on the size of the window. All percentages are converted to bars (see the Bars table).

The cluster report consists of the following tables:

  • Annual profit (annualized profit/loss) – the hypothetical profit of the Expert Advisor for the year when recalculating the earned income in proportion to the optimization and testing periods.
  • Efficiency – the ratio of the annual profit on the test period and the optimization period of the same run.
  • Consistency – the percentage of profitable passes among all the test passes of the “glued” forward.
  • Number of bars (bars) – the size of the window and the step in bars.

In all tables in a cluster report, cells are links that can be clicked to quickly navigate to the corresponding refinement report.

Clarifying reports

The refinement report details how forward testing metrics are obtained for a specific combination of optimization window and forward step sizes. In the table of the refinement report, the rows correspond to the tester runs on which the best parameters were found in the optimization window. The results of the subsequent forward step check, calculated in the same tester run, are output in the same line.

The columns contain the start and end dates of the optimization window, the end date of the forward, as well as the following indicators for two periods at once – the optimization window (blue background) and the forward test (yellow background): profit, profit factor (or Sharpe’s coefficient to choose from), profit, loss, the number of successful and unsuccessful trades, as well as drawdown in physical terms and as a percentage. The right two columns show the number of the tester pass and the list of values of the optimized parameters.

The average, maximum, minimum values and variance are also displayed; the annual profit, efficiency, stability and drawdown of the cumulative forward test from all steps, as well as a schematic representation of the balance curve on the forward.


Add review
Reviews ( 0 ):