You are on page 1of 9

StrategyQuant

AlgoWizard
QuantAnalyzer
QuantDataManager

Company
Learn & Support
Blog

Account

Forum
Login

Products

StrategyQuant

AlgoWizard

QuantDataManager

QuantAnalyzer

Company

About
Contact us
Partner with us
Team
Blog
Support
Spojte se s námi i na

sociálních sítích

Blog
Documentation
Codebase

More

Shared
Forum
Contact us

Introduction to the StrategyQuant templating


system – Part I
I am starting a series of articles where I will dig deeper into the trading strategy creation process in StrategyQuant X. As you might know, this amazing
software had been transformed from a basic strategy generator into a complex framework that allows traders to leverage their knowledge and to
swiftly create trading robots.

As we are continuously adding new features, some of them may have been unnoticed for our users (transition could become hidden from our users)
which would be quite a pity.

So let me start with the new templating system as this is one of the essential parts of the new StrategyQuant which defines the kind of generated
strategies.

In this article I will focus mainly on the introduction and basics of templating system and show you how to set up basic conditions in SQ.

What is StrategyQuant template system?


There are many kinds of trading strategies. Trend following, breakouts, pullback, London breakout etc. Template is the base part of the strategy
creation process, which defines what type of strategy logic StrategyQuant will generate. To understand the process better, let me describe its steps in
more detail.

The first step: Building blocks


Building blocks

It can be indicators, operators, values etc. Simply put, these are the bricks you build your new house from – in this case – your trading strategy. In
StrategyQuant, you can easily define which building blocks will be used for generating a strategy. SQ supports more than 40 indicators and various
predefined conditions.
Building blocks in StrategyQuant

The second step – conditions and levels created from building blocks

Generating conditions

In this step, we put together single building blocks and generate strategy conditions. In the table below, you can see several examples of building
blocks.
Condition Description
Filtering condition which defines a rising/growing market. Very
Close>MovingAverage(200)
efficient especially on a daily timeframe (D1)
Highest[40]+0.3*ATR[14] Entry level for placing stop orders
RSI(20) < 50 Indicates oversold market, buy filter

StrategyQuant uses Genetic or Random engine for generating building blocks, you can also use ready-made conditions which are called “Signals”.

Ready made conditions – Signals

The third step – putting it all together into a strategy template


Let’s say you have two trading conditions: Condition 1 and Condition 2. Both are generated randomly or during evolution from the preconfigured
blocks.

Condition 1: Close>MovingAverage(200)

Condition 2: RSI(20) < 50

Now it is time to create your first basic strategy. Please note that it is not a real world example and it was simplified for demonstration purposes.

Strategy template could be something like:

————————————————————————

IF [Condition 1] and [Condition 2]


THEN Buy at Market price

————————————————————————

The final generated strategy will then be:

IF Close>MovingAverage(200) and RSI(20) < 50


THEN Buy at Market price

The condition “placeholders” in strategy template were replaced with the actual conditions. So the template defines where exactly the conditions
should be used and how the resulting strategy will be generated.
Now let’s say we have this strategy template:

————————————————————————

IF [Condition 1] and [Condition 2]


THEN Buy at Market price

IF [Negation of Condition 1] and [Negation of Condition 2]


THEN Sell at Market price

————————————————————————

You can see that strategy template allows you to use also a negation of a condition which will be created automatically.

If we’ll use this template, the generated strategy will be:

IF Close>MovingAverage(200) and RSI(20) < 50


THEN Buy at Market price

IF Close<MovingAverage(200) and RSI(20) > 50


THEN Sell at Market price

Let’s try third example of yet another strategy template:

————————————————————————

LongEntrySignal = [Condition 1] and [Condition 2]


ShortEntrySignal = [Negation of Condition 1] and [Negation of Condition 2]

IF LongEntrySignal and not ShortEntrySignal


THEN Buy at Market price

IF ShortEntrySignal and not LongEntrySignal


THEN Sell at Market price

————————————————————————

If we’ll use this template, the generated strategy will be:

LongEntrySignal = Close>MovingAverage(200) and RSI(20) < 50


ShortEntrySignal = Close<MovingAverage(200) and RSI(20) > 50

IF LongEntrySignal and not ShortEntrySignal


THEN Buy at Market price

IF ShortEntrySignal and not LongEntrySignal


THEN Sell at Market price

You can see that we have used the same conditions, but we were able to generate three slightly different strategies.

And that it is. By putting building blocks into your template, you will easily get strategy logic. You can see that by using different strategy templates
you can customize StrategyQuant strategy creation process in almost limitless ways. Later within this series of articles, I will introduce l other types of
templates which you can customize based on your own ideas.

In the next article we will move into StrategyQuant and test templates by yourself.
Kornel Mazur

Please login to comment

1 COMMENT   Oldest

Emmanuel (@emmanuel1)

November 27, 2021 10:20 pm

Template are very useful ! Thank you for this explaination

Continue reading

An interview with successful trader Naoufel

Kornel MazurFebruary 22, 2022

As first, I would like to thank you for your decision for sharing your trading insights with our trading community.  Before we will continue with
discussing algo-trading, could you please …
StrategyQuant vision for year 2022

Mark FricJanuary 24, 2022

The beginning of the new year is a special time for many of us. The previous year is definitely gone, and we feel like something new is starting again. I

New What If Snippets

clonexDecember 28, 2021

Two new What If snippets, which allow us to test how strategy can be managed, depending on its current performance, have been added to the
sharing server. The first is …

Products
StrategyQuant
AlgoWizard
QuantAnalyzer
QuantDataManager

Resources
Blog
Documentation
Forum
Support
Report bug / suggest idea
Company
About us
Contact us
Team
Partner Program

Follow us
Facebook
YouTube
Twitter

Privacy policy
Terms of use

Risk Disclosure:
Futures and forex trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial
investment. Risk capital is money that can be lost without jeopardizing ones’ financial security or life style. Only risk capital should be used for trading
and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results.

Hypothetical Performance Disclosure:


Hypothetical performance results have many inherent limitations, some of which are described below. no representation is being made that any
account will or is likely to achieve profits or losses similar to those shown; in fact, there are frequently sharp differences between hypothetical
performance results and the actual results subsequently achieved by any particular trading program. One of the limitations of hypothetical
performance results is that they are generally prepared with the benefit of hindsight. In addition, hypothetical trading does not involve financial risk,
and no hypothetical trading record can completely account for the impact of financial risk of actual trading. for example, the ability to withstand
losses or to adhere to a particular trading program in spite of trading losses are material points which can also adversely affect actual trading results.
There are numerous other factors related to the markets in general or to the implementation of any specific trading program which cannot be fully
accounted for in the preparation of hypothetical performance results and all which can adversely affect trading results.

Testimonial Disclosure:
Testimonials appearing on www.strategyquant.com may not be representative of the experience of other clients or customers and is not a guarantee
of future performance or success.

You might also like