Polygon Moving Average Strategy
Overview
The Polygon Moving Average strategy constructs a polygon with multiple moving averages of different periods and uses the breakthrough of the polygon as trading signals. This trend-following strategy incorporates multiple timeframes and can effectively filter market noise and capture the main trend.
Strategy Logic
The strategy plots several EMAs, such as 3-period, 7-period and 13-period EMAs, to form a polygon channel. When the price breaks above the EMAs, a long signal is generated. When the price breaks below the EMAs, a short signal is generated. This helps avoid many false breakouts.
The code determines the breakthrough signals by comparing the close price to the EMAs using conditions like close>ema1 and ema1>ema2 and ema2>ema3. The time condition time_cond is added to limit the backtest period. The strategy uses a trailing stop loss to protect profits after entry.
Advantages
The biggest advantage of this strategy is its ability to effectively capture the main trend direction by using multiple moving averages as filters to avoid noise. The trailing stop loss takes profits in a timely manner.
Risks and Solutions
The main risk is that this strategy fails to identify trend reversal points and may lead to loss during trend reversals. Inappropriate MA period settings may also result in overtrading or lagging signals. The risks can be reduced by optimizing MA combinations, adding reversal indicators, widening stop loss range, etc.
Optimization Directions
The strategy can be optimized in the following aspects:
-
Optimize the MA periods to find the best combination.
-
Add reversal indicators like RSI and MACD to exit trades timely.
-
Optimize the stop loss range and offset to reduce premature stop loss.
-
Optimize parameters for different products to improve adaptability.
Summary
The Polygon Moving Average strategy is generally a reliable and effective trend following system. Its biggest strength is capturing the main trend while filtering out noise significantly. But it has some limitations in identifying reversals. We can improve it by parameter optimization, adding auxiliary indicators, etc. It is suitable for markets with obvious trends and can generate stable profits if used properly.
- 1

