Backtesting Forex

Introducing Strategy Variations

Continuing from what we learned in the Introducing Strategies Simulations we can now extend our knowledge with the concept of variations.

What are Variations?

Variations allow us to create a strategy with varying values for several of its parameters so that we can try out different combinations of these parameters without having to create a new strategy every time.

For example, we're using the Simple Moving Average (SMA) indicator in our strategy and we set the Length parameter to 20. But what if we wanted to try out different lengths for the SMA? We could create variations for the Length parameter and set them to 10, 20, 30 and so on.

When a strategy with variations is simulated, it executes all possible combinations of the variations and generates a result for each one of them. In the results, we'll see the most profitable variations at the top.

Creating Variations

Variations can be specified when creating a Strategy, in these sections:

  • Entry Rules
  • Stop Loss
  • Take Profit
  • Exit Rules

Variations for Entry Rules & Exit Rules

In Entry and Exit Rules, variations can be created within the rule builder by clicking the underlined values...

Varying a value

...and selecting another value.

Specifying a different value

Every time this happens, a new variation is created and added to the list of variations for that rule.

Variation crated for a rule

Several variations can be created like that

Several variations created for a rule

Variations can be merged together by dragging and dropping values from one variation to another.

Consolidating variations by dragging values from one to another

Variations for Stop Loss & Take Profit

In Stop Loss and Take Profit, variations can be created by clicking the "Add Variation" button and specifying a different value.

Adding a variation for stop loss

Variation Results

After executing a strategy with variations, the results will show the most profitable variations at the top.

To see what those variations were, click on the to see the details.

Variation results

Principal

The strategy, without taking into account the variations, is called the principal. The principal doesn't have any specific meaning, the strategy simulator simply executes it just like any other variation.

Last updated: 16 Apr 2025

See also