Dual Moving Average Breakout Strategy
Overview
The dual moving average breakout strategy is a typical trend following quantitative trading strategy. It generates trading signals by calculating simple moving averages of different periods and checking if the price breaks through them to determine positions. This strategy uses 20-day and 60-day moving averages as trading signals.
Strategy Logic
The core logic of the dual MA strategy is to use moving averages of different periods to capture price trends and generate trading signals when the price breaks through the moving averages.
Specifically, this strategy employs 20-day and 60-day simple moving averages. These two moving averages can be seen as tools to capture short-term and medium-long term trends respectively. When the short term price breaks through the medium-long term price, it signals that the market is in an upward trend and thus should go long. When the short term price drops below the medium-long term price, it signals that the market is in a downward trend and thus positions should be reduced.
The code uses ta.crossover and ta.crossunder to determine if the price has broken through or dropped below a moving average. Trading signals of going long or reducing position are emitted accordingly when a breakout happens.
Advantages
The dual moving average breakout strategy has the following advantages:
- The concept is simple and easy to understand and implement.
- It can effectively track market trends and avoid noise interference.
- Few strategy parameters and easy to optimize.
- Flexible in choosing moving average periods to adjust market sensitivity.
Risks
There are also some risks with the strategy:
- Prone to whipsaws when market is ranging. Can be alleviated by increasing holding period.
- Ineffective in catching quick market reversals. Other indicators can be added as filters.
- Moving averages inherently lagging, unable to early signal price changes. Shortening period may help.
Enhancement Areas
The strategy can be enhanced from the following dimensions:
- Optimize moving average periods to find best parameter sets.
- Add other indicators to filter out false signals, e.g. MACD, KD etc.
- Add stop loss logic.
- Incorporate multi-timeframe analysis for robustness.
Summary
The dual moving average breakout strategy is a simple and practical trend following strategy. It can effectively capture medium-long term trends while avoiding short-term market noise. Also, the easy-to-understand logic and limited parameters make it very suitable for quantitative trading. Of course there are rooms for improvements, such as parameter tuning, signal filtering and stop loss to make it more stable and profitable.
- 1

