In this tutorial we'll show how to build a solid trading strategy using OpsQuant
What is ProQuant?
ProQuant lets anyone build and follow automated trading strategies via a mobile app. It combines complex algorithms, powerfull cloud computing and a simple user interface to make algorithmic trading acccessible for anyone. And it is free to follow automated trading strategies created by other traders.
Prerequisites
To follow this tutorial, you'll need a ProQuant account and a brokerage (demo) account at Trading212.
New custom build strategy
Lets start! Go to "My Strategies" tab. Click on the + sign and click on "Custom Build" to start building our first strategy.
Select an instrument
In this example we'll build a strategy which will autotrade the German Stock Index (DAX). Go to "Indices" tab and select GERMAN30. The following screen should appear.
Entry Rules
Most important part of our strategy are the entry rules. Entry rules are indicators that will determine the conditions for opening a position. Up to 4 entry rules can be defined and all entry rules should met before it will open a new position. If one rule produce a signal to go LONG or SHORT, but the other does not, it will not open a new position.
Entry Rules we use today:
- Momentum: Momentum Rises
- Moving Average: Moving Average Rises
- MACD: MACD line crosses the Zero line upward
Momentum - trend following indicator. Works great in strong trend markets. Should be combined with other indicators, moving average is prefered.
Moving Average - calculates the average value of prices over a selected period of time, and eliminate "noise" of all minute price fluctuations.
MACD - Moving Average Convergence Divergence: brings trend and momentum together. When MACD crosses the zero line to turn positive, this is often a bullish sign.
All entry rules are trend following indicators. Those 3 combined will find strong trend signals on longer timeframes.
Let's add the first entry rule:
- Momentum: Momentum Rises
Momentum rises with all positions open at the beginning of a bar. Bar Open is the first tick of a new bar. Period 8 is a commonly used short term period. We'll use 8 bar period for the other entry rules as well.
Now add the second entry rule:
- Moving Average: Moving Average Rises
Moving Average rises with the same Bar Period of 8.
Last entry rule to be added is MACD.
- MACD: MACD line crosses the Zero line upward
In this case the Bar Period will be 8 again for Fast MA and MACD MA. A common Bar Period value for Slow moving average is 20.
Exit rules
As exit rule we use Bollinger Bands. Bollinger bands is a calculation of a simple moving average and standard deviation. Usually a 20-bar SMA is used together with two standard deviation values away from it.
Approx. 90% of the price action occurs within the two bands. Any breakouts above or below is a major event. We would like to exit our position if the standard deviation is higher than 3.
Add the exit rule:
- Bollinger Bands: The bar opens above Lower Band after opening below it.
With above settings a position will be closed if standard deviation breaks 3 in a 20-bar moving average
Parameter Settings
Last part, we've to define some parameter settings such as Stop Loss (when to exit a position if max loss is reached), Take Profit (after how many pips should we take profit) and the trading frequency (what timeframe do we like to use).
Parameter settings:
As seen in picture:
- Trading Frequency is 1 hour - it will check once per hour if entry rules are met
- Take Profit is set at 1000 pips
- Stop Loss is set at max 1000 pips
- Stop Loss Type: Bar Trailing (Stop Loss will move with the trade. If trade is in profit, Stop Loss will move up as well)
Backtest
Now all necessary settings are in place. Save your strategy and give it a name. Let's see how the strategy performs in a backtest.
Almost a backtest of 5 years with 421,54% profit! Not bad, as total trades is 492 which makes the profit almost 1% per trade.
Next step is to test your strategy in practice (demo) mode. Click on "Run", use $100 as funds for trading with 100% trading size. Trade size type can be set on static and us 1:20 (Retail) as Trading212 Leverage.
Trading 212 Practice requires a demo Trading212 account, open one here: Trading212.
Now you're all set! Let your new strategy run for a month or at least 50 trades in Practice demo mode. If still profitable after that period, you can decide to run the strategy in real money mode. Use low position size first, increase your position size if still profitable after a couple of weeks.
Nice thing is that you can share your profitable strategies with other users. If your real money strategy will be followed by other real money subscribers you'll receive $6/month per subscriber! For more info go to ProQuant