Moving Average Envelopes Trading Strategy
Overview
The Moving Average Envelopes trading strategy is a trend following strategy. It sets up percentage envelopes above and below a moving average line as trading signals when price breaks out the envelopes. The strategy can be used for both trend following and identifying overbought/oversold market conditions.
Strategy Logic
The strategy is based on a 14-period simple moving average (SMA). The upper envelope is calculated as: SMA + SMA × input percentage. The lower envelope is calculated as: SMA - SMA × input percentage. This forms up and down trading bands parallel to the SMA.
When close price goes above the upper band, a long position is taken. When close price goes below the lower band, a short position is taken. Otherwise, maintain a flat position. The input parameter "reverse" allows reverse trading.
The strategy uses 3 indicators:
-
xSMA - 14-period simple moving average, the midline.
-
xHighBand - Upper percentage envelope.
-
xLowBand - Lower percentage envelope.
Advantages
The advantages of this strategy include:
-
Simple logic, easy to understand and implement.
-
Can be used for both trend following and identifying overbought/oversold levels. Avoids missing trends in rangy markets.
-
Trade frequency can be controlled by adjusting the percentage envelopes parameters. Lowers trading risk.
-
Flexibility in choosing moving average periods for different timeframes and instruments.
-
The reverse input parameter adds flexibility. Can trade with or against the trend.
Risks and Solutions
There are some risks to the strategy:
-
Deep pullbacks beyond the envelope range can happen in strong trends, missing some profits. Can lower percentage parameters to control risk.
-
Frequent false signals may occur in choppy/ranging markets. Can increase moving average period to filter signals.
-
Too narrow envelopes may trigger excessive whipsaws. Can wisely widen envelope range.
-
Sudden volatility from news events can cause losses. Using stop loss helps manage risk.
Optimization
The strategy can be optimized:
-
Test moving averages of different periods and find optimal parameters with best signals.
-
Optimize percentage envelopes for maximum profitability and controllable risk.
-
Adding filters like MACD and KD to avoid bad signals in choppy/complex market conditions.
-
Combine with trend strength indicators like ADX to improve entry timing.
-
Test effectiveness across different instruments. Customize parameters per product.
-
Incorporate stop loss strategy to limit downside risk per trade.
Conclusion
Overall this is a typical trend following strategy with easy backtesting parameters. It can also identify overbought/oversold levels. Further parameter optimization and combination with other indicators can significantly improve its practical effectiveness for trading. This is a valuable strategy worthy of further research and application.
/*backtest
start: 2023-11-25 00:00:00
end: 2023-12-25 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 04/03/2018
// Moving Average Envelopes are percentage-based envelopes set above and - 1

