Release of SQX 139 Dev 1 and what’s planned for year 2024
We’d like to announce the release of the new SX 139 Dev 1 version – note that this is a development version for testing, not the final 139 version. Most …
Přejít k obsahu | Přejít k hlavnímu menu | Přejít k vyhledávání
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.
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.
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
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 |
Close>MovingAverage(200) | Filtering condition which defines a rising/growing market. Very 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
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.
We’d like to announce the release of the new SX 139 Dev 1 version – note that this is a development version for testing, not the final 139 version. Most …
Dive into Algorithmic Trading Without the Coding Headache! Are you intrigued by algorithmic trading but dread the thought of coding? Today marks the beginning of our exciting series that’s about …
In this interview, we catch up with Naoufel, a seasoned trader, to explore his journey through the stormy market of 2023. Naoufel is successful trader with verfied track record who …
Template are very useful ! Thank you for this explaination