forex software

Create and Test Forex Strategies


fsbpro_guide:strategy_generator

Strategy Generator

The Strategy Generator allows you to generate strategies fully or semi-automatically. Each strategy has its own generator in its tab. If you run multiple generators at the same time will work independently without interfering with each other. How much generators you can use at the same time depends on your choice and how fast you computer is. A standard computer can deal with at least few generators working at the same time.

Strategy Generator

The user interface of the generator is very similar to the interface of the Editor: The input parameters of the strategy, the strategy slots and properties as well as the indicator chart, the statistics and the balance chart.

The generator will work only on a calculated strategy. This means if there is no data files provided or there are missing indicators in the strategy, the generator will not work and will display an error icon near the Start button.

This tool is designed to make it easy for you to discover new strategies to experiment with, to create strategies that work in different conditions and make profit.




Quick Start

Set the acceptance criteria before running the Generator.

Before you start generating a strategy you have to make sure you have all the things set first. The generator does not generate the environment of the strategy. It generates only the strategy itself. In other words - the generator can not choose what currency pair or period the strategy will use, nor some of the other properties. You have to preset those manually because the generator is designed to generate strategies, without changing the environment.

Parameters that have to be set in the Strategy Editor page before generating:

  • Profile - the profile contains all Account settings: initial account, leverage, account exchange rate…
  • Data Source - sets what data set to be used. Contains Symbol settings: spread, swaps, slippage, digits
  • Symbol and Period - they determine the market the strategy is trading
  • Strategy Properties - all trading amounts: opening lots, adding lots, maximum lots…
  • Martingale

Parameters that may be set in Editor or changed by Generator as per selected options:

  • Strategy Protections - Stop Loss, Take Profit, Break Even
  • Averaging rules - the behavior of the additional same direction signal and the additional opposite direction signal

Press the “Start” button at the control strip.




1. Generator Toolbar

The generator toolbar's first three buttons open three panels that we will explain in detail below. Next is the “Out of sample” menu. This one is not present in the Editor.

1.1 Common Options

Common Options

It is a great idea to always use this panel before generating a strategy. You should use it to specify the options for Stop Loss, Take Profit and to preset if the averaging signals should be changeable by the Generator.

This panel contains base settings for the Generator. You can open it by either clicking on the “Common” button in or by opening the “Strategy Properties”. The difference here, compared to the Editor, is that you can not edit the strategy here. You can only set some parameters for the Generator and the strategy will be created within the borders you have set.

The common options panel is divided into several zones:

Generate Additional Entry Signals

Each of the two fields here has a checkbox value. If it is left unchecked the Generator will not change this option, it will remain as it was set in the Editor. If you want to enable the generator to change an option, just put a check in the box. Those options can only change the type of the signal but not the amount. Trading sizes are only set in the editor.

Generate Position Protection

The position protections are Stop Loss, Take Profit and Brake Even. There are three couples of options. The first option in each couple lets us decide if the generator will use the original value from the Editor - “Keep original”. You can also set it to “Always use” - even if it is not enabled in the Editor the Generator will enable and use it, “May use” - it will decide on its own if to use this protection, “Do not use” means will not use the protection, no matter what is set in the Editor.

The range is measured in points. The value of one point depends on the number of digits in the quote. For example if it is 5 digits one point will be 0.00001.

What are ranges used for?

The most obvious explanation is to set the min and max values. Another option generally speaking is to create some type “relation” between Stop Loss and Take Profit. It is advisable that in a strategy the Stop Loss is closer to the entry price than the Take Profit. This is because in this way (being in a long position) if the price goes down you can limit the loss and if the market goes up it will let it grow longer. This is a “trend following” approach. For example you could set Stop Loss to be 100 to 200 points and Take Profit to be 180 to 380 points. If you are setting those values in such a way - do not forget to set the usage parameter to, for example, “May use” or “Always Use”.

Maximum Count of Slots

Both fields let you decide the maximum number of slots that will be used. Since a strategy always has an Opening Point of the Position and a Closing Point of the Position but has a variable count of Opening Logic Conditions and Closing Logic Conditions you are able to set only the latter two.

1.2 Generator Settings

Generator Settings

The Generator Settings are less used since once you set them you will rarely want to change them.

The Search best option lets you choose how the generator will pick the best strategy. The default “Net balance” will make sure you see only the most profitable strategy. “Win / loss ratio” should be the ratio between winning and losing deals but in practice is the ratio between the number of winning and the number of all deals. For example if you have 5 wins and 3 losses the ratio will be 5/8. Therefore the win/loss ratio is measured in values between 0 and 1. 1 is when there are only winning deals. It is important to know that when you choose this parameter this can be a two-edged knife since a strategy can have a win/loss ratio of 1 even if it made a single trade and made profit of 1 cent over a period of few years → 1 (won trade)/1 (number of all trades) = 1. You should be aware of the different options the “Search best” list gives you before changing it.


Search best is used best with Acceptance Criteria. You can set the minimum count of trades there.

Working time in minutes is not relevant to the flow of the generation process. It just lets you specify how long the generator will work. The generator does not really have a “state” when working. It's algorithm is in large random choice of indicators, setting parameters for them and checking if the created strategy does comply with the Acceptance Criteria. If the strategy passes the Acceptance Criteria is better than the one already found it will be shown to you and added to the current collection. If it passed the Acceptance Criteria without being better than the current one it will be only added to the current collection.

It is not advisable to set this parameter to under 5 minutes since the Generator will not find many strategies for shorter times. You can also set it for a few hours. If you have a reliable machine you can let it work for like 8 or 12 hours over the night and in the morning you should find a collection full of strategies that fulfill the acceptance criteria. If the criteria are too demanding, it might not find anything because it is possible that a strategy matching those criteria does not actually exist. For example if you want to create a strategy on M1 period and want to make 100 USD per day this is probably impossible.

When you gain experience and play around with the Generator a bit you will find out the optimal settings that fit your style and expectations.

Use default numeric values is disabled by default. If you enable it the Generator will only change the Application Logic of Indicators without changing their numeric values. The defaults for the generator will be left as they are. This option is used to avoid over-optimization.

If you let the generator work long enough (maybe a few days) it is possible that it will find a strategy that fits over the curve of the data and trades in pretty much every possible occasion to make the most profit out of it. This will make the strategy absolutely curve-fitted.

Generator uses statistical database the FSB Pro generator is way “smarter” than the Generator in the old FSB version. It uses statistical data and artificial intelligence (AI) to learn from the profitable strategies it creates to create even better strategies.

Optimize strategy this is not the Optimization feature of the Strategy Tab. If this option is enabled, the Generator will just try to use other values and settings for the indicators in the strategy to see if it can make it a bit better. If the optimization completes and the strategy still passes the Acceptance Criteria and it is better than the old one, the new one will be shown and added to the collection. It is a good idea to keep this option enabled. This is not full optimization. You can use the Optimizer for that.

Normalize strategy this option is not meant to make a strategy more profitable but it might help. How it works:

  • If you have a strategy with three opening logic conditions the Generator will check if it removes one the strategy is still profitable. If the strategy is still profitable it means the indicator is useless and will be removed. This actually helps because it will make sure there are as few indicators as possible. More indicators means some of them might correlate and the logical conditions of one are too similar to another one and then there is no need to have both of them calculated.
  • Another thing the the normalizing does is try to move the indicator's parameters as close to the default values as possible. For example the Moving Average default value is 14 and MA in the strategy is 50 is far from the default value and the generator will try to bring it closer to the default value. In the same time the Generator is making sure the new strategy is not worse than the current one. It might even be a bit better. This makes the strategy “prettier” by removing useless conditions. When a strategy has indicators and options that are more widely used (“standard” values) this lowers the chance that it gets over-optimized

Number of parallel threads - Here you can set a number between 1 and 64. Since most computers today have at least 2 cores we have set the default value to two. To more fully utilize your CPU you can set this field to a higher number. We advise you to experiment with this option to see what setting brings the best performance out of your PC. In our opinion 2 to 4 threads is usually a good choice for most PCs if you are using one Generator at a time. This number applies only to the currently selected generator. If you are running more than one of them simultaneously we do not advise to raise this number since the total number of threads might exceed the number of cores in your machine which can lead to slowing the processing down instead of making it faster.

1.3 Generator Indicators

Generator Indicators

By default the Generator will use all the indicators that are present in the program. However you might not want it to use all indicators (the main reason would be that most of the indicators correlate, most indicators are very similar to each other since they use the same base data - the price - and iterate over it but the price is the same for all indicators so they can't go too far away from it).

This panel lets you select from four lists of indicators (you can select that at the top of the panel). Those lists are for each of four slot types a strategy can have:

This is done because one indicator can exist at the same time in several slots. For example you can have Moving Average in Opening Point of the Position as well as in an Opening Condition. You can allow or ban indicators from the list by using their own checkboxes or by clicking those at the top of the panel to allow or ban all indicators in the current list. If you ban all possible indicators for a slot you will get a warning near the Generator's Start button. This is because if it has no indicators to choose from it will not be able to create a strategy. If you do not want to have indicators as opening conditions or closing conditions it is a better practice to choose 0 in Maximum opening/closing logic conditions from the Common Options.

1.4 Out of Sample (OOS)

The OOS is a very important tool and it is almost always used by the experienced traders. Using it makes the strategy much more reliable.

The default value here is “In Sample” which means that the Generator will use all the data you provided it with. However if you go “Out of Sample” and select a different option, when you press “Start” the generator will ignore the last X% percent of the bars where X is the percentage OOS you selected. The Generator will calculate a strategy without this end portion of bars. You can see the chart after the generator finished creating a strategy on the picture in the beginning of the article, pointed by the “Out of Sample Zone” bubble. The generator did not know anything about the data in the green area. Our generator works with a “real” OOS, which means the Generator literally has no clue about the data that being trimmed from the end of the chart while generating the strategy.

The main idea of OOS is to avoid over optimization or curve fitting. Curve fitting means that a strategy is fitting given data. So fitting that if you do a little change it will start experiencing losses instead of profits. So if you are generating a strategy without using OOS there is a chance you will experience unexpected behavior when trading it - new data comes in and the strategy is over-optimized for the old data.

The OOS is basically simulating the trading. So for example you have designed the strategy using the first X% of the data and after that you trade the strategy for the remaining Y% of the data. This is also called “future test in the past” or “testing with unknown data”. The goal of OOS is to achieve the most smoothly raising in the OOS Zone. If this is not the case the strategy is not fit to be traded. On the other hand even if the balance line is smoothly raising this in no way guarantees the strategy will be profitable, but it will certainly have a much bigger chance to make profits than one where the balance line is fluctuating a lot.

1.5 Collection Name

This field allows you to specify a collection name. The collection is a virtual “folder” where the generator will add strategies while working. This is very useful for you because you do not need to always be checking the generator for new strategies. You can instead let the Generator work on its own. When generating a strategy the generator will show the best strategy but all the strategies that make it trough the acceptance criteria and showed some profit but are not as good are added to this collection and you can check them out later. You can see you collection in the Repository.

2. Strategy Toolbar

This toolbar is here because in the Generator you can not manually change indicators. Instead the Strategy Toolbar gives you the ability to choose if to keep an indicator and “how much of it”.

By default, when stared, the Generator will clear all slots that are not linked or locked.

The Strategy Toolbar allows you to “link”, “lock” and “unlock” all indicators at once.

  • Lock - the Generator will not be able to change or remove the indicator from the strategy.
  • Link - the Generator will use the indicator without being able to remove it but it will be able to change its parameters
  • Unlock - this is the default option. The Generator will ignore this indicator and fill in the slot as it chooses to.

You can lock, unlock and link each separate indicator. You can alternate its state by clicking on it in the slot list below the Strategy Toolbar.

The “Reset Strategy” button is active only after the Generator has completed its work and found a strategy to display. Clicking this button will show your starting-point strategy if you did not like what the Generator created for you.

The Undo and Redo are also optionally active and can be used to forward and backward between the steps in changing the strategy.

3. Command Strip

The Start/Stop button starts/stops the generation of strategies.

Many users have asked why there is no Pause button. Since the generator calculates and tests strategies really fast it keeps no state when stopped/paused. All strategies that fulfill the Acceptance Criteria are added to a Strategy Collection of your choice, if you run the generator again all new strategies that are fit enough will be added to the collection. Stopping and pausing the Generator would be the same since it is always looking for a random strategy that is fit enough to pass the criteria you set.

The Start button might not be enabled in cases where the Generator is missing data or has not enough allowed indicators. This will be indicated by a red icon near the button where you can read the reason for this state of the button.

Calculated count - the Generator will calculate thousands of strategies and collect only the ones that are fit enough. This counter will show the total number of calculated strategies, not only the ones that will make it into your collection.

Collected count - shows the number of strategies that made it to the collection.

Shown count - the number of times the Generator has found a better strategy than the current one and has displayed it on the Balance/Equity Chart. Any time the Generator finds a better strategy it will replace the old second-best strategy and display the new better one.