r/metatrader • • 16h ago

Information MT5 has a built-in forward optimization split - if you never set it, your 'best' parameter set is probably curve-fit

1 Upvotes

The optimizer is the most-used and least-read part of the Strategy Tester. The typical workflow stops at: pick a criterion, run, sort by the top number, take row one. That row is a description of your history, not a property of the strategy - and MT5 already ships the tool that separates the two, in the Forward field of the optimization settings.

What the forward split actually does

Set Forward to 1/3 (or a custom date) in the optimization settings. The optimizer now tunes on the first part of your date range and silently re-tests every candidate it tried on the last part - data the fitness function never optimized against. After the run each candidate has two scores: the in-sample score it was selected on, and a forward score on data it never saw.

How I read the table

  1. Sort by the forward column, not the in-sample one. Candidates whose forward score collapses were fitted to the optimization window; their ranking was noise.
  2. Prefer clusters over champions. A parameter set whose neighbours (a slightly wider stop, a slightly earlier exit) also survive forward is more believable than an isolated peak - the isolated peak is usually an artifact of the data, not an edge.
  3. Treat "forward: no trades" as a hard fail. A set that stops trading on the forward segment has often learned market conditions that no longer exist.
  4. If nothing survives forward, that is the result. The effect does not extend past your optimization window, and more optimization passes will not fix that - only more data or a simpler idea will.

Custom criterion, two lines

The criterion dropdown also offers "Custom max". Implement OnTester() and define the score yourself - for example profit factor penalized by drawdown, or anything that refuses to reward a single lucky streak. It changes which candidates the optimizer calls "best", and it stops flattering strategies that made all their money in one week.

Honest limits

  • The forward window is still one window. Repeat the split over several date ranges; sets that survive repeatedly are the only ones worth a demo run.
  • Do not peek at the forward result while iterating. The third time you "adjust" parameters after seeing forward numbers, that data is effectively in-sample too.
  • A forward survivor is not a profitable strategy. It is a strategy that earned a demo test, which is a much weaker and much more honest claim.

How do you split your ranges - fixed calendar boundaries, or rolling windows? And is anyone actually using the custom criterion in a production workflow, or is it one of those checkboxes nobody touches?