P
PipsGrowth

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

Trading Setup Example

Entry, stop loss, and take profit levels.

šŸ“ˆ Buy Setup
Moving Average EnvelopesTouch Low!EntryTake ProfitStop LossCandlesBandsTouchBUY
šŸ“‰ Sell Setup
Moving Average EnvelopesTouch High!EntryTake ProfitStop LossCandlesBandsTouchSELL

Always wait for signal confirmation before entering a trade.

Where This Indicator Works Best

Trend context and market position.

šŸ“ˆ Bullish Context
Squeeze!Low VolatilityBest Fit āœ“Breakout ↑
šŸ“‰ Bearish Context
Squeeze!Low VolatilityBest Fit āœ“Breakdown ↓

Measures market volatility and identifies breakout opportunities.

Live Chart — Moving Average Envelopes

See Moving Average Envelopes in action on a live chart. Try changing the settings and timeframe.

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
Get TradingView Pro

MT5 MQL5 Code

C++
int env_handle = iEnvelopes(_Symbol, _Period, 20, 0, MODE_SMA, PRICE_CLOSE, 2.5);

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: February 8, 2026

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.

Frequently Asked Questions

Moving Average Envelopes - Complete Guide with Python & TradingView Code