Getting started with StrategyQuant – Practical example

Home > Dokumentace > StrategyQuant > Getting started with StrategyQuant – Practical example

Let’s say we want to develop new trading strategy for EURUSD.

Inputs

With StrategyQuant we don’t need to define exact trading rules – we can let the program find the best entries and exits.
We’ll only define which blocks the strategy should consist of (indicators, price data, operators, etc.) in Step 2.

We’ll define the performance constraints of resulting strategy (Step 3) – for example, total Net Profit must be above $ 3000, % Drawdown must be lower than 20%, Return/DD ratio must be above 4, it must produce at least 300 trades.

Then we’ll just hit the Start button and StrategyQuant will do the work (Step 4).
It will randomly generate new trading strategies using building blocks we selected, tests them right away and stores the ones that fit our requirements for our review (Step 5).

Step 0. Switching to Build tab

As the first step we’ll switch to Build tab (on the left) because we want to build new strategies

Image 1: Build tab

We can decide between Genetic Evolution or Random generation modes. For the sake of simplicity we’ll use Random generation in this example.

Step 1. Configuring the price data

StrategyQuant comes with over 6 years of history data for the four major pairs, and it allows you to easily import your own price data.

Image 2: Configuring the data

We’ll switch to Settings -> Data and choose data for EURUSD and 1 hour timeframe. We’ll also set the Out of sample period to about 1/3 of the whole time range.

Step 2. Configuring build and strategy options

First we can configure Building blocks. These are the parts that will be used to randomly generate trading rules for the strategy.

Image 3: Choosing building blocks

The resulting strategies depend on the building blocks you choose. You can choose to use only price action, without any technical indicators, or select a specific group of your favorite indicators.

Strategy Options contains various trading related constraints. You can check if you require your strategy to use Stop Loss (recommended) and fixed Profit target (optional).

Image 3: Setting strategy options

You can also choose more general strategy options, like minimum and maximum size of protective Stop, etc. You can experiment with these settings – for example, it might bring better results to limit the trading time to a certain range, to close the trade at the end of the day or to use different Maximum SL.

 

Money Management tab allows you to choose from different money management modes. For the initial strategy design it is always better to use trading with fixed amount of lots because it provides a clear picture of strategy performance.

Robustness Tests are additional tool that help revealing strategies that are curve fitted to given history data. Robustness tests allow us to automatically test the strategy behavior during various stress situations, for example when a few trades are missed, or when strategy uses different parameter values. If the strategy is robust, it must remain profitable even if there are small variations on input or price data.

Step 3. Define desired properties of generated strategies

In the last Settings tab – Ranking Options we’ll define which strategies should be automatically dismissed.

We’ll dismiss strategies that return less than $3000 in profit, that have drawdown bigger than 20%, Return/DD ratio lower than 4 or that produce less than 300 trades.

Image 6: Setting resulting strategy constraints

Note that if we’ll set our constraints too strict it could take a very long time to find a candidate that passes them all.

Step 4. Starting the generation

We’ll go back to Progress tab and click on Start button. StrategyQuant will start crafting the strategies and show its progress in the log in the Build screen.

Image 7: StrategyQuant is running and producing new strategy together with backtest every few seconds

It usually takes a less than a second (depending on a precision mode and data history) to generate and backtest the new strategy on the historical data. Generated strategies are continually sorted and the best of them are stored into the Databank for later review.

Results

Below you can see one sample of profitable strategy generated by StrategyQuant. The strategy is based on simple Bollinger Bands rules and has almost ideal equity curve showing constant growth during 4 years of testing.

Image 9: Results for this sample strategy are quite stable, with small drawdowns and constant equity growth

Red portion of the chart shows maximum equity stagnation, which means the longest time it took the strategy to create new equity high. The blue portion of the chart is Out-of-sample area, where the strategy was tested on previously unknown data.

Summary

StrategyQuant is a perfect tool for traders and strategy developers to speed up the process of creating and testing trading strategies, and to learn new concepts that will very likely cause them to see the trading strategy development in a different light.

In the example above we saw how easy it is to build a new trading strategy. By repeating the same process for other symbols or timeframe you can build a robust portfolio of your own trading robots trading different currencies, possibly on different timeframes, using different, independent strategies.