How to Create a Robust Trend Following Strategy
Are you tired of combining multiple trend indicators such as MACD, Stochastic, RSI, ADX etc. to create a trend following strategy, only to find limited success? What if you were told that a robust trading strategy can be built by using simple trend filters and entry conditions?
In this Quantra classroom, we will discuss a simple approach to creating a robust trend-following system for the futures market based on the principles of a trend following system.
All the concepts covered in this email are taken from the Quantra course Futures Trading: Concepts & Strategies. You can preview the concepts taught in this classroom by clicking on the free preview button and going to Section 15 and Unit 4 of the course.
Note: The links in this tutorial will be accessible only after logging into quantra.quantinsti.com
Note that backtesting results do not guarantee future performance. The presented strategy results are intended solely for educational purposes and should not be interpreted as investment advice.
In this Quantra Classroom, we will cover the following topics:
- A Brief Discussion on Trend Following System
- Principles of Trend Following System
- Constructing a Trend Following System
- Improving the Trend Following System
A Brief Discussion on Trend-Following System
It's crucial to have a clear trading concept and understand the market phenomenon you're exploiting. If you can't explain your strategy simply, it may not be effective. For instance, combining multiple trend indicators such as MACD, Stochastics, RSI, ADX often leads to strategies that work only in historical charts but fail in live trading due to overfitting.
The basis of trend following is based on the empirical observation that prices often continue to move in the same direction for a sustained period of time.
The goal of this strategy is to capture the bulk of these moves but never to buy at the bottom or sell at the top. What we want to do is to wait for the market to start moving in one direction, up
or down, and then jump on the bandwagon and stay with the price move.
The concept of creating a robust trend following system and deploying it on multiple assets is covered in detail with Python code and the live trading template is covered in the course ‘Futures Trading: Concepts & Strategies’
Principles of Trend Following System
Before you create a trend following system, it is important to understand the principles of a trend-following system to set the expectations right from the performance. Here are the important principles of a trend-following system.
1. Never try to enter or exit at the best prices
Entry and Exit In a Trend Following System
The idea behind a trend-following system isn't to jump in right at the start of a trend and get out at its peak.
Instead, it involves waiting until the price has clearly started moving in a trend direction before entering. But we can't be sure a trend is over until the price starts moving against us. So, we always end up giving away some of our profits as we wait for that signal to exit.
2. Most of the trend-following trades end up as losses
Profit from Winning Trades More Than Losses from Losing Trades
Between 60% to 70% of trend-following trades typically result in losses. However, a successful trend-following system aims to generate larger profits from the remaining 30% to 40% of trades, thereby recovering losses and yielding overall profits.
The strategy revolves around maximising gains on successful trades while minimising losses on unsuccessful ones.
You can watch this video from the course ‘Futures Trading: Concepts & Strategies’ to know more about the principles of trend following system.
Constructing a Trend Following System
A typical trend-following system has 4 components - a trend filter, entry, exit rules, and position sizing.
1. Trend filter
A trend filter provides insight into market trends, indicating whether the trend is up or down. It doesn't have to be complex, like combining multiple indicators; a simple dual-moving average approach suffices.
In this classroom, we'll focus on a common technique involving the use of 40-day and 80-day exponential moving averages to construct a dual moving average trend filter.
To illustrate, let's examine the price chart of Palladium futures from 2019 to 2020, employing a dual moving average to gauge the overall market trend.
Bullish Trend When 40 EMA > 80 EMA
Long positions are initiated when the trend filter is positive, indicating a bullish trend, while short positions are entered when the trend filter is negative, signalling a bearish trend.
2. Entry rules
While the trend filter identifies market phases for long and short positions, actual entries occur during breakouts.
In this strategy, a long position is initiated when the trend filter signals a positive trend and the current trading price hits a new 50-day high. Conversely, a short position is opened when the trend filter indicates a negative trend and the current price reaches a new 50-day low.
3. Exit rules
It should be noted that a trend-following method inevitably sacrifices some gains during exits if waited till the trend reversal. To handle this, we'll use a trailing stop-loss strategy to close open positions. This means positions will be exited when the market moves against them by a set amount.
Trailing Stoploss For a Trend Following System
The trailing stop loss is a function of volatility. A trailing stop can be kept at a distance of three times the standard deviation of daily returns. You can watch this video from the course ‘Futures Trading: Concepts & Strategies’ to know more about the principles of trend following system.
4. Position sizing
Now that we've established entry and exit rules, another crucial aspect is determining the number of positions to take.
Position allocation depends on both the average daily movement of the asset and the trader's risk tolerance. For instance, if a stock typically moves $5 per day and you're comfortable risking no more than $50 per day, then the number of contracts would be $50/$5 = 10. Therefore, your position size would be 10 contracts.
You can check this unit to calculate the daily movement of contracts using Python and determine the position size.
Improving the Trend-Following System
Implementing a trading strategy incorporating entry, exit, and position sizing rules doesn't always ensure a robust outcome. For instance, consider the performance of the strategy discussed thus far on the S&P 500 total return index and crude oil futures.
Performance of Trend Following Strategy vs S&P 500 Total Return Index
The trend following strategy underperformed and the S&P 500 total return index performed better than the strategy.
Performance of Trend Following Strategy on Crude Oil Futures
When applied to crude oil futures, the strategy underperformed.
Let’s apply it to the Palladium futures contract from 1977 to 2020 to analyse its performance.
Performance of Trend Following Strategy on Palladium Futures
While the strategy may have shown strong performance, significant drawdowns are apparent in the cumulative returns plot. A robust strategy not only exhibits strong performance but also mitigates the impact of significant drawdowns.
To enhance the strategy's robustness to decrease the huge drawdowns, leveraging the power of diversification is key.
Power of Diversification
Diversification proves to be a potent tool for mitigating drawdowns within a trend-following system. When employing the trend-following strategy across multiple contracts, the drawdowns experienced in some contracts can offset the profits generated in others.
For instance, consider the outcomes of deploying the trend-following strategy on two assets: Palladium (PA) and a 10-year treasury yields contract (TY).
. Performance of Trend Following Strategy on Multiple Assets PA and TY
As per the above graph, it is evident that the cumulative returns are stable with controlled drawdowns.
The next consideration is how to distribute capital among multiple assets. One effective method is the inverse volatility weight allocation approach, where assets with lower volatility receive a higher weight.
Check this unit to access the Python code for backtesting the trend-following strategy on multiple assets using the inverse volatility weight allocation method.
What to do next?
- Go to this course
- Click on
- Go through 10-15% of course content
- Drop us your comments and queries on the community
IMPORTANT DISCLAIMER: This email is for educational purposes only and is not a solicitation or recommendation to buy or sell any securities. Investing in financial markets involves risks and you should seek the advice of a licensed financial advisor before making any investment decisions. Your investment decisions are solely your responsibility. The information provided is based on publicly available data and our own analysis, and we do not guarantee its accuracy or completeness. By no means is this communication sent as the licensed equity analysts or financial advisors and it should not be construed as professional advice or a recommendation to buy or sell any securities or any other kind of asset.