Today we’ll be looking to see if we can improve the Supertrend indicator which had a low average profit factor of 1.004 from the previous backtest. One way to try to improve it is by trading with the trend, meaning do not short when there is an uptrend, only go long. So to figure out the trend, we’ll use the 200 period moving average. Since there are a few different types of moving averages, we’ll test out 3 of them: simple moving average (SMA), exponential moving average (EMA), and weighted moving average (WMA).
Long entry rules:
- Price must be above the 200 MA
- Supertrend shows Buy signal
Long exit rules:
- Supertrend shows Sell signal
Short entry rules:
- Price must be below the 200 MA
- Supertrend shows Sell signal
Short exit rules:
- Supertrend shows Buy signal
Results
Testing this strategy on the SPY has returned the following profit factors:
Timeframe | ST + 200 SMA | ST + 200 EMA | ST + 200 WMA |
1min | 0.904 | 0.945 | 0.876 |
5min | 1.09 | 1.159 | 1.187 |
15min | 1.393 | 1.196 | 1.274 |
30min | 1.057 | 1.025 | 1.106 |
1hour | 1.066 | 1.073 | 1.095 |
4hour | 1.305 | 1.241 | 1.095 |
1day | 1.173 | 1.265 | 1.184 |
Average | 1.141 | 1.129 | 1.117 |
After testing this new strategy, we can confirm that adding a 200 MA does indeed improve the profit factor. The best moving average to pair with the Supertrend indicator is the 200 SMA. With the original average profit factor of 1.004, it has now increased by 13.6% to a new average profit factor of 1.141!
TradingView Script
Try the Supertrend + 200 MA strategy for yourself on TradingView: https://www.tradingview.com/script/lpYW0m3Q-Supertrend-200-MA-backtestx/
Test with your own tickers and timeframes to see how well it works!