Price Crossing Moving Average Trend Following Strategy
Overview
This strategy generates buy and sell signals based on the crossing of price with a moving average. It provides various types of moving averages and a tolerance parameter to filter false breakouts. The strategy aims to capture turning points in price trends for trend following.
Strategy Logic
The strategy calculates a length N moving average based on the closing price. Typical moving average types include Simple Moving Average (SMA), Exponential Moving Average (EMA), Weighted Moving Average (WMA) etc. Then a tolerance level is set, e.g. 5%, and upper band (1.05 times moving average) and lower band (0.95 times moving average) are calculated. When closing price crosses above upper band, a buy signal is generated. When closing price crosses below lower band, a sell signal is generated. This helps filter some false breakouts. Also, a Boolean parameter "Short Only" is provided. When enabled, only sell signals are generated for shorting the market.
Advantages
- Effectively follows price trends using moving average's trend following characteristics
- Provides various moving average types for flexible combinations
- Tolerance parameter helps filter false breakouts and avoid unnecessary trades
- Can go short only, suitable for catching downward trends
Risks
- Moving averages have lagging effect, may miss price turning points
- Not suitable for range-bound market environments
- Improper tolerance parameter settings may filter valid signals
- Going short has higher risks, need prudent operations
Optimization Directions
- Optimize moving average type and length parameters
- Test different tolerance parameter settings
- Add other indicators to filter signals
- Employ position sizing strategies
Conclusion
Overall this is a typical trend following strategy. It uses the relationship between price and moving average to determine trends, with some flexibility. Through parameter optimization and proper signal filtering, it can become a decent quant strategy. But controlling downside risks when shorting is important to avoid excessive losses.
- 1

