Forward optimization

 
When running a forward optimization, it's possible to specify that tests from the period that hasn't been optimized should run using the passes from the optimized period with specific values. For example, 'only run passes with a profit factor above x'.
 

The best option here would be to return a value on the OnTester function that if it doesn't match a particular criteria (like, if profit factor < X), it returns a bad value so it will not be tested in a forward period.


Imagine you're testing the drawdown. The best possible drawdown is 0 and the worst is -100 (since the tester always thinks the higher the value the better, the worst drawdown must be negative). If you want the tester to start considering only passes with the drawdown better than 20%, you can define a condition on the OnTester function that checks if the drawdown is better than this value or not. If it is better, OnTester returns the original value; if it is not, OnTester returns a bad value (like -100). Doing so makes the tester ignore this pass, since the tester only chooses the some of the best passes to the forward optimization.


Note that in case you use the fast optimization, this alters the way new generations are created (because they're created by analyzing the results of the old ones) and thus may also change the optimization outcome. Use it carefully or with the slow complete algorithm.

Reason: