Contents

How does StrategyQuant work?

Author: Tomas Vanek

January 16th, 2019

Rating:
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)
Loading...

Random generation is the foundation of StrategyQuant. Strategies generated this way can be further improved (evolved) using Genetic evolution.

 

Random generation of trading strategies

A trading strategy in the initial population is constructed using a combination of price patterns, technical indicators, order types, and other parts to form the entry and exit rules.

StrategyQuant can use all standard technical indicators and oscillators (like CCI, RSI, Stochastic, etc.), time values (like time of day, day of week) and price patterns. These building blocks are then combined using logical and equality operators (and, or, >, <, etc.) to form an entry or exit rule.
In addition, it supports different entry and exit order types (market order, limit order, fixed profit target, exit after X bars, etc.).

With all the possible combinations of rules and orders, StrategyQuant is capable of generating literally trillions of different possible trading strategies.

 

With all the possible combinations of rules and orders, StrategyQuant is capable of generating literally trillions of different possible trading strategies.

The building process itself is completely random – builder randomly picks different building blocks from the available pool and combines them to create entry rule, order type and exit rule.
There are some validity constraints that ensure that, for example price is not compared to time value, etc.
The result is a completely new random trading strategy. Of course, not every randomly created

strategy is profitable, but StrategyQuant can produce and test thousands of new strategies per hour, and there are many profitable ones in this amount.

Genetic Evolution

Genetic Evolution takes the process of finding suitable trading strategies even further.
In this mode StrategyQuant first creates a number of random strategies, which are used as the initial population in the evolution.

This initial generation of strategies is then “evolved” over successive generations using genetic programming technology.

This process imitates the evolution – the algorithm chooses the fittest strategies (using selected performance criteria) in every generation, and the group of fittest candidates is then used to produce new generation of trading strategies.

As in evolution, this should result in better and better candidates, in our case in strategies that are more profitable, more stable, or generally better in the selected performance criteria.

 

Example strategy code

Below if an example pseudo code of a strategy generated by StrategyQuant. You can see that strategy consists of entry orders, exit orders and trade management commands – such as trailing stop movements, etc.
Every strategy generated by the program can be viewed in this pseudo code or exported in the form of MetaTrader Expert Advisor (EA), NinjaTrader NinjaScript C# strategy or EasyLanguage for Tradestation/Multicharts.

 

====================================================================
== Entry conditions
==================================================================== 
LongEntryCondition = (Stoch(40, 1, 3) < 50)
ShortEntryCondition = (Stoch(40, 1, 3) > 50)

====================================================================
== Entry orders
====================================================================
-- Long entry
if LongEntryCondition is true {
   if No position is open then Buy at Ichimoku(6, 18, 38, Kijun-sen) + (0.4 * ATR(86)) Limit;
   Stop/Limit order expires after 34 bars.

   Stop Loss = 190 pips;
   Profit Target = (0.74 * ATR(87)) pips;

   // Move SL to BE (on close)
   Move Stop Loss to Entry price when in profit at least (77 * ATR(12)) pips;

   // Profit trailing (on close)
   Profit Trailing by 222 pips;

   // Stop trailing (on close)
   Move Stop to (Close(1) + (0.5) * BBWidthRatio(20, 2.0))) on bar close;
}

-- Short entry
if ShortEntryCondition is true {
   if No position is open then Sell at Ichimoku(6, 18, 38, Kijun-sen) + (-0.4 * ATR(86)) Limit;
   Stop/Limit order expires after 34 bars.

   Stop Loss = 190 pips;
   Profit Target = (0.74 * ATR(87)) pips;
}

====================================================================
== Exit orders
====================================================================
-- Long exit
if MarketPosition is Long {
   if (Bars Since Entry >= 33) {
      Close position at market;
   }
}

 

Supported building blocks

StrategyQuant supports over 250 building blocks, including all the standard technical indicators like CCI, RSI, Stochastic, Momentum, etc.

It also supports all standard order types – Market, Stop, Limit and advanced exit methods like Trailing Stop or Move Stop Loss to Break Even.

The best thing about new SQ X is that it allows you to create your own building block, or develop your own indicator that can be used to extend the program.

We will be continually adding new technical indicators and other features to the program

If you have your favorite indicator you’d like to see in StrategyQuant, just let us know.

< Previous: What’s new in StrategyQuant X?Next: System requirements >

1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Roberto Romito
Roberto Romito
1 year ago

Sono entusiasta di tutto ciò!!!Non vedo l’ora di metterci le mani.