Create and Test Forex Strategies
The Strategy Optimizer changes the digital parameters of the marked indicators, within preset limits, in order to achieve a higher profit in the back test.
When the optimizer is opened, it loads the strategy from Forex Strategy Builder with its current parameters. In order to make it easier, the optimizer sets the Minimum and Maximum limits of the parameters for you. It uses the current value and adds or subtracts five steps. It also randomly selects some of the parameters for optimization. Of course, you can change the selected parameters, their limits and step size.
When you are ready, press Optimize button to run the calculations. The program updates the strategy balance chart every time it finds a more profitable combination of parameters.
This instrument makes use of a random optimization algorithm. It means that every time the optimizer is started, a different method of calculation is employed. To achieve maximum results, start the optimizer several times.
It is recommended that you optimize only profitable strategies. Otherwise, the optimizer may adjust the parameters so that not a single deal is closed. According to it, zero profit is better than loss.
Be Careful Optimizing the strategy can lead to curve fitting. It means that the parameters are specially selected so the strategy shows high profit on exactly this piece of historical data.
Out of sample (OOS) testing reduces the risk of curve fitting.
When you switch on the OOS option, you can choose what percentage of bars to be excluded from the optimization. In that example, the optimizer will not take into account the last 30% of the bars. The program will try to maximize the strategy balance achieved on 1/5/2007. The balance line after that date is shown for your reference only. You may consider a strategy that shows smoothly rising balance after the OOS date as reliable, however this does not guarantee that such a strategy will continue make profit in the future.
The optimizer saves every better strategy in a list. You can load a previous or next strategy from this list when you are on the main screen of Forex Strategy Builder. To do so, use Edit → Previous Generated Strategy or Edit → Next Generated Strategy to move back and forward. You can use the fast keys Ctrl + H and Ctrl + J.
If the strategy uses close Stop Loss and Take Profit or other rules that make several deals inside a bar, the backtest may show Ambiguous Bars. In that case, you can reduce the number of ambiguous bars and make the test more reliable by switching on the Testing → Automatic Scan option. It will force Forex Strategy Builder to use all available intrabar data for better bar interpolation. See more information about scanning in the Intrabar Scanner article.