Table of Contents

Strategy Generator

Video introduction: Generator Demo

The generator can be used to create new strategies or to improve existing ones. Its major goal is achieving an optimal balance and complying with the chosen criteria.

The generator 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 EditPrevious Generated Strategy or EditNext 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 to make the test more reliable by switching on the TestingAutomatic 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. Anyway, you can set a maximum number of the ambiguous bars limit for the generated strategies.

Application of the Generator

Generating a New Strategy

In order to generate a complete strategy, there have to be no “locked” indicator slots. Also the “Generate a new strategy at every start” option has to be off. In that conditions, when you press the Generate button, the generating of your strategy starts all over again. This means that the strategy you have been creating so far will be deleted.

The Strategy Generator works out combination of indicators, changes their logic rules and parameters. It also changes the behaviour of the additional entry signals, Permanent Stop Loss or Permanent Take Profit in order to achieve a higher result.

The Strategy Generator does not change the number of traded lots.

Improving a Strategy

The Strategy Generator can be used to improve an already created strategy. This can be done when you have already built a strategy but feel that adding an additional filter to it can make it work better.

To do that, input your strategy into Forex Strategy Builder, open the generator and click on the indicator slot. An icon of a padlock will appear in the top left-hand corner of the slot on which you have clicked. This means that the slot is “locked”. The “locked” slots cannot be changed by the generator.

You may also set the numbers of required slots to be generated. Making different combinations you can force the Generator to search for one particular type of slot or several slots.

If you switch off the “Generate a new strategy at every start” option, the Generator will overwrite the current strategy only if the new one has a greater balance. In that way, you can generate a strategy at several stages and you have the chance to change some options meantime.

Searching for an Indicator Application

You can use the Generator in order to find out how a given indicator or a group of indicators can be implemented in practice. You can do this by adjusting the parameters of the chosen indicator on the main screen of the program. Having done this, open the generator window and “lock” the thus adjusted indicator slot. When you start the generator, it will try to find a profitable combination of indicators without changing the “locked” indicator.

Lets see what we can achieve by using MACD. We'll test the logic:

To do so, we select MACD in an “Opening Logic condition” slot with the “MACD line crosses the zero line upward” logic rule. We open the Generator after that and “lock” MACD slot by clicking on it. The rest is simple - to press the “Generate” button. If we are lucky, we can receive a strategy like that in a few seconds:

 Generatinr a MACD Strategy

Settings

Initial Optimization

Perform an initial optimization is a default option. It makes the generator try to improve the strategy. This can be done in several ways:

The initial optimization aims at making the strategy more orderly without trying to achieve a higher profit. To achieve optimal optimization, use the Strategy Optimizer.

The Generator starts several optimization attempts only when it finds a more profitable strategy. After the optimization finishes, the Generator continues generating new strategies.

Out Of Sample Testing

Out Of Sample testing

Out of sample testing (OOS) reduces the risk of curve fitting.

When you switch on the “Out of sample testing” option, you can choose what percentage of bars to be excluded from the evaluation of the strategy during the generation. In that example, the generator 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 to make profit in the future.

OOS option does not influence on the “Limitations”. Even if OOS is in use, the Generator evaluates the limitations criteria for the full data series.

Working Minutes

The Generator was designed to work for a predefined time. You can set how many minutes it will work using the numeric field. When the time chosen finishes, the Generator will stop and the most profitable strategy found will remain on the screen.

One new option is setting the working minutes to zero. In that case the working time limitation drops, therefore the Generator will work until you stop it.

Limitations

You can select certain limitations, which the Generator will comply with when evaluating a strategy.

 Backtesting Limitations to Comply with

When the Generator finds a new strategy with a greater balance from the backtest, it calculates the statistical parameter and checks whether all selected criteria are fulfilled. The new strategy will only be accepted if all the limitations are met.

:!: The “Maximum equity drawdown[%]” option may not work as you expect when the account is shown in pips. The reason is that the starting account is 0 pips, therefore the strategy must make good profit with the first deals in order to make space for drawdown.

The formula for the Win/Loss ratio is:

Win/Loss Ratio = Winning / (Winning + Losing) trades; [0 - 1]

Hints

Discussion

I'd like to know where i can find more information about the “non-linear filter” which I think is one of the best tool of this awesome software!

When the generator/optimizer runs, a balance line is produced, which is visible on the screen during the processing.
In the background, there is also a 'target balance line', which is a straight line from the opening balance to the closing balance. This line has the same number of data points as the balance line, and is what we would all like our strategies to look like (although most of us know this will never be the case).
Let assume that we have a balance line with 100 points, and a target balance line with the same number of data points, and they are not identical (the balance line will always have ups and downs while the target balance line will always be straight). The two lines can now be compared to see how different they are.
The checking process is very simple, it picks points on both the balance and target balance lines where comparisons will be made. The number of points are evenly spaced, and depend on the settings entered in the 'Check Points' field in the generator/optimizer 'Limitations' tab.
The balance line and target balance line are compared at each 'check point' and the % deviation is calculated.
Any strategies that have a deviation % greater than the allowable (again this is set by the user) us filtered and doesn't make it into the 'Top 10'.

Advanced Generator Settings

Documentation for the Advanced Generator Settings (along with the supporting code) is currently under development.

Automation

Automatic Start

Custom Configuration File

Strategy Templates

Custom Output Sorting