forex software

Create and Test Forex Strategies


Strategy Optimizer

A short demonstration of the strategy optimizer

Optimizer Overview

Forex Strategy Optimizer

The optimizer is a tool that will attempt to make the current strategy better. It will decide if the strategy is better, depending on the options you choose in the optimizer settings.

It is a bad idea to optimize losing strategies. The optimizer will try to “rectify” the strategy by making it trade less which in turn will result in less money lost but this will not make the strategy profitable.

Always optimize only profitable strategies.

1. Optimizer Toolbar

The optimizer toolbar consists of three parts: Settings, Out of sample, Collection. The “Out of sample” and “Collection” options work like in the generator and you can read about them there.

Optimizer Tool Bar

1.1 Settings

Optimizer Settings Panel

The Settings button will open a panel that allows changing the way you want the optimizer to function. You will probably use this panel only once in a while.

Search - lets you choose what parameter will be taken in account to qualify the strategy as “better” than the last version. The default option here is “Net balance” but you can choose any other.

Strategy fulfills acceptance criteria - we strongly suggest you keep this option enabled.

Full optimization

The FSB Pro optimizer uses a different algorithm than the FSB program. In FSB, the optimizer was using the so-called “brute-force” algorithm that will calculate all possible variants for pairs of indicator values. The problem with this approach is that it will always lead to over-optimization. The FSB Pro optimizer algorithm is much better since it does not brute-force the parameters thus avoiding curve-fitting and allows creating strategies more suitable for real life market conditions.

When you disable the “Full optimization” option:

The optimizer starts changing the parameters one by one from top to bottom within the given minimum and maximum values. If the optimizer finds a better value, it will push the strategy to the currently selected collection. Than it goes to the second parameter and checks its whole range of values. If it does not find a better value, it will return leave as it was before starting the start of the optimization. When the optimizer reaches the last parameter, it will check it as it did with the previous parameters and will stop.

When you enable the “Full optimization” option:

If the last round of checking all the parameters found a better value for any one of them, the optimizer will make another round of checks. This will continue until the optimizer reaches a point where the optimizer has changed all parameters to have their optimal values.

2. Parameters Toolbar

Parameters Tool Bar

2.1 Select all parameters

Using this option will select all possible parameters and make them available to the optimizer.

2.2 Select none of the parameters

Will select no parameters at all and let you choose on your own.

2.3 Select random parameters

Will select randomly a few of the parameters.

2.4 The ±5, ±10, ±15, ±20, ±25 Buttons

You can use those buttons to select a range for a parameter. The base value was set preset in the editor or generator – whatever option you might have chosen before going to the optimizer. So for example if you have a property with value of 30 and step set to 1 and click the ±20 button you will get a Minimum of 10 and a maximum of 50. If the step is 2, FSB Pro will multiply the ± value by this number. For example if base value is 30 and step is 2 and you click ±20, FSB Pro will operate with 2×20 set the minimum to -10 and the maximum to 70.

With the widening of the margin between minimal and maximal value you allow the optimizer to try out more options. This will increase the chances to get a better strategy after processing.

2.4 Reset parameters

The “Reset parameters” button becomes active after the optimization is over. It will allow you to undo all the changes made to the strategy while optimizing.

3. Parameters Options

Optmizer Parameters

This zone is a table of the indicators’ numeric properties and rules for the optimizer. The table has six columns.

Parameter name - here you can select the indicators, which the optimizer will work with.

Initial – This value is set in the strategy editor or generator.

Best – This is the best value the optimizer has found yet.

Minimum – The minimal value the property can have.

Maximum – The maximal value the property can have.

Step - The step that the optimizer will use when it changes the property’s value.

In certain situations, while trying to make a strategy better, the optimizer will reach the maximal or minimal value of a property. Let us have a base value of 50, minimum value of 20 and maximum value of 100. If the value reaches the minimum of 20, the optimizer will notify you by putting a square bracket on the left side of the “Best” value - “[20”. On the other hand, if it reaches the maximum value of 50, the “best” value will display “50]”.

To achieve better optimization results you can first run the optimizer. Then click on the ±10 button. This will set the minimal and maximal values, but it will use the “Best” value as a base (initial) value. Then run the optimizer again to reach more fine-tuned property values. You can repeat this step several times.

4. Control Strip

Control Strip

This area is similar to the one in the generator feature. The only difference is in the way the optimizer works. In the optimizer, the number of calculations is limited and if you want to have a fully optimized strategy, we would advise you to let the optimizer work until it completes the processing.

Please read more about the command strip in the generator article.