Key Takeaways
Difficulty:Beginner
Reliability:Moderate
Category:volatility
Timeframes:1H, 4H, Daily
Moving Average Envelopes
volatilityš 1H, 4H, Daily
Percentage-based bands above and below a moving average.
Formula
Code
Upper = MA Ć (1 + Percentage)
Lower = MA Ć (1 - Percentage)
Detailed Explanation
Envelopes create bands at fixed percentages above and below a moving average.
**Comparison to Bollinger:** - Envelopes: Fixed percentage width - Bollinger: Dynamic width based on volatility - Envelopes better for consistent markets
Parameters
MA Period
Default: 20
Moving average period
Percentage
Default: 2.5
Envelope width %
š Bullish Signals
Price bounces off lower envelope in uptrend
š Bearish Signals
Price rejected at upper envelope in downtrend
Python Implementation
Envelope calculation
Python
import pandas_ta as ta
pct = 0.025 # 2.5%
df['MA'] = ta.sma(df['close'], 20)
df['Upper'] = df['MA'] * (1 + pct)
df['Lower'] = df['MA'] * (1 - pct)
TradingView Pine Script
JavaScript
//@version=5
indicator("Envelopes", overlay=true)
basis = ta.sma(close, 20)
pct = 2.5 / 100
upper = basis * (1 + pct)
lower = basis * (1 - pct)
plot(upper, "Upper", color=color.red)
plot(basis, "Basis", color=color.gray)
plot(lower, "Lower", color=color.green)
š Use TradingView for Advanced Charting
Professional analysis tools with 100+ technical indicators
MT5 MQL5 Code
C++
int env_handle = iEnvelopes(_Symbol, _Period, 20, 0, MODE_SMA, PRICE_CLOSE, 2.5);
Python Libraries
Common Mistakes
āUsing same percentage for all markets
āNot adjusting for volatility changes
Confirmation Signals
RSI
Volume
Candlestick patterns
Best For
Overbought/oversoldMean reversionTrend channels
š” Pro Tips
- ā¢Fixed percentage unlike Bollinger Bands
- ā¢Good for stable trending markets
- ā¢Adjust percentage per volatility
Last updated: December 29, 2024
Educational Disclaimer
This content is for educational purposes only and does not constitute financial or investment advice. Trading involves significant risk and you may lose your capital. Always consult a licensed financial advisor before making investment decisions.