OPEN-SOURCE SCRIPT

Aura Mean Reversion Envelopes [Pineify]

4 424
Aura Mean Reversion Envelopes [Pineify]

The Aura Mean Reversion Envelopes is a volatility-adaptive envelope indicator designed to identify high-probability mean reversion trade setups. It combines a Hull Moving Average (HMA) baseline with ATR-based dynamic envelopes to detect when price has reached statistically extreme levels and is likely to revert back toward its fair value. Unlike static channel indicators, this tool continuously adapts its bands to current market volatility, making it effective across different instruments and timeframes.

Key Features

  • Hull Moving Average (HMA) as the central mean — provides a smooth, low-lag baseline that closely tracks the "fair value" of price.
  • ATR-based dynamic envelopes — four bands (inner and outer, upper and lower) that automatically expand and contract with market volatility.
  • Wick rejection reversal signals — BUY and SELL markers triggered only when price pierces the exhaustion zone but closes back inside with a confirming candlestick pattern.
  • Visual cloud zones — color-filled regions between bands clearly delineate overbought, oversold, and neutral mean-reversion corridors.
  • Extreme candle coloring — optional bar coloring highlights candles closing beyond the inner bands for at-a-glance identification of stretched price action.
  • Built-in alert conditions — configurable alerts for both bullish and bearish reversal signals so you never miss a setup.


How It Works

The indicator is built on the principle of mean reversion — the statistical tendency for price to return to its average after moving to an extreme. The core calculation pipeline is:

  1. A Hull Moving Average (HMA) of the closing price over a user-defined period (default: 34) is computed. HMA was chosen over SMA or EMA because it dramatically reduces lag while maintaining smoothness, giving a more accurate representation of the current mean.
  2. Market volatility is measured using the Average True Range (ATR) over a separate lookback period (default: 21). ATR captures the true range of each bar — including gaps — providing a robust, adaptive volatility metric.
  3. Four envelope bands are constructed symmetrically around the HMA baseline by adding and subtracting ATR multiplied by two configurable multipliers: an inner multiplier (default: 1.618, the golden ratio) and an outer multiplier (default: 3.0). The inner bands define the boundary of normal price oscillation, while the outer bands mark exhaustion zones where price has deviated significantly.
  4. Reversal signals are generated using a wick rejection pattern: a bullish signal fires when the bar's low pierces below the lower outer band, but the candle closes bullishly (close > open) and above the outer band. This pattern indicates that sellers pushed price to an extreme but were overwhelmed by buyers. The bearish signal uses the mirror logic on the upper side.


Trading Ideas and Insights

Mean reversion strategies work best in ranging and oscillating markets. Here are some practical ways to use this indicator:

  • Fade the extremes: When a BUY or SELL signal appears at the outer exhaustion band, consider entering a position targeting the central HMA mean line as your take-profit level. The mean line acts as a natural magnet for price.
  • Use the inner bands as a filter: If price is between the inner bands and the mean, the market is in "normal" territory — avoid counter-trend entries. Wait for price to reach the outer bands before looking for reversal setups.
  • Combine with trend context: On higher timeframes, determine the dominant trend direction. Then on your trading timeframe, only take signals that align with the higher-timeframe trend (e.g., only BUY signals in an uptrend) for higher win rates.
  • Watch for candle coloring clusters: Multiple consecutive colored candles beyond the inner band suggest sustained momentum — a reversal signal after such a cluster can be particularly powerful.


How Multiple Indicators Work Together

This indicator integrates two distinct technical concepts into a unified framework:

  1. Hull Moving Average (trend/mean tracking) — The HMA serves as the anchor point, representing the current equilibrium price. Its low-lag property ensures the mean line stays close to actual price action rather than trailing behind, which is critical for accurate envelope placement.
  2. Average True Range (volatility measurement) — ATR dynamically sizes the envelope bands. During high-volatility periods, the bands widen to avoid false signals; during low-volatility periods, they tighten to capture smaller but still meaningful deviations.


The synergy between these two components is what makes the indicator adaptive: the HMA tracks where price should be, while the ATR determines how far is too far. Together, they create a self-adjusting framework that does not require manual recalibration across different market conditions.

The reversal signal logic adds a third layer — candlestick pattern confirmation — by requiring a wick rejection at the outer band. This prevents signals from firing during strong breakouts where price legitimately moves beyond the envelope.

Unique Aspects

  • HMA over EMA/SMA: Most envelope indicators use simple or exponential moving averages, which introduce significant lag. The Hull Moving Average virtually eliminates this lag, resulting in more accurately centered envelopes.
  • Dual-layer envelope design: The inner and outer band structure creates distinct zones (normal, extended, exhaustion) rather than a single binary overbought/oversold threshold, giving traders more nuanced context.
  • Golden ratio default: The inner band multiplier defaults to 1.618 (the Fibonacci golden ratio), a mathematically significant threshold that aligns with natural price clustering behavior observed across many markets.
  • Wick rejection confirmation: Signals require both a pierce beyond the outer band AND a confirming close back inside with a bullish/bearish candle body, filtering out many false signals that plague simpler band-touch systems.


How to Use

  1. Apply the indicator to your chart. It overlays directly on the price chart with the HMA mean line, four envelope bands, and color-filled zones.
  2. Watch for BUY triangles below bars at the lower outer band and SELL triangles above bars at the upper outer band. These are the primary reversal signals.
  3. Use the colored candles as an early warning — when candles start coloring, price is in the extended zone and approaching potential reversal territory.
  4. Set alerts via the built-in alert conditions ("Bullish Mean Reversion" and "Bearish Mean Reversion") to receive notifications when signals fire.
  5. Target the central HMA mean line for take-profit on reversal trades, or use the inner band on the opposite side for more aggressive targets.


Customization

  • Mean Tracking Period (default: 34): Controls the HMA lookback. Lower values make the mean more responsive to recent price; higher values produce a smoother, slower-moving baseline. Adjust based on your trading timeframe.
  • Volatility (ATR) Period (default: 21): Controls the ATR lookback for band sizing. Shorter periods make bands more reactive to recent volatility spikes; longer periods smooth out the band width.
  • Inner Band Multiplier (default: 1.618): Defines the boundary between normal and extended price zones. Increase for wider normal zones (fewer colored candles); decrease for tighter zones.
  • Outer Band Multiplier (default: 3.0): Defines the exhaustion zone threshold. Higher values produce fewer but more extreme signals; lower values generate more frequent signals.
  • Color Candles at Extremes: Toggle on/off the candle coloring feature for candles closing beyond the inner bands.
  • All colors (bullish, bearish, mean line) are fully customizable via the Aesthetics & Colors settings group.


Conclusion

The Aura Mean Reversion Envelopes combines the precision of the Hull Moving Average with ATR-adaptive volatility bands and candlestick-confirmed reversal signals to create a comprehensive mean reversion trading tool. Its dual-layer envelope design provides clear visual zones for identifying when price is normal, extended, or at exhaustion — helping traders time entries at statistically favorable levels where price is most likely to revert toward its mean. Whether you trade forex, crypto, stocks, or futures, this indicator adapts to your market's volatility and provides actionable signals with built-in confirmation logic.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.