OPEN-SOURCE SCRIPT

Aurora Expanded Trend Cloud [Pineify]

724
Aurora Expanded Trend Cloud

This indicator uses a Donchian Channel breakout to define trend direction and then projects an asymmetric "cloud" zone above or below price — a visual region where the market is expected to find support (in uptrends) or resistance (in downtrends). What makes it different from a plain Donchian system is the one-directional trailing cloud boundary: once the floor starts rising (or the ceiling falling), it never reverses, creating a ratcheting effect that tightens as a trend matures without whipping back on normal pullbacks.

Key Features

  • Trend direction determined by Donchian Channel breakouts — clean, objective, no oscillator subjectivity
  • Cloud width scales with the current channel width, so the zone automatically widens during high-volatility periods and compresses when price is ranging
  • One-way trailing boundary: the cloud floor only moves up in bull trends; the cloud ceiling only moves down in bear trends — reducing false exits during healthy retracements
  • Trend-start circles mark the exact bar where each breakout first confirmed, providing a clear visual reference for entry timing
  • Trend state exposed in the Data Window for use in external scripts or Pine Strategy bridges


How It Works

The calculation pipeline has three stages:

  1. Channel Construction — Each bar, the indicator computes the N-bar highest high (upper band) and lowest low (lower band). The difference is the channel width, which serves as a volatility proxy.
  2. Expansion Offset — An expansion percentage (default 50 %) is applied to the channel width to derive an offset. For example, on a bar where the channel spans 10 points, a 50 % setting produces a 5-point offset. This offset is added to the lower band (bullish cloud floor) or subtracted from the upper band (bearish cloud ceiling).
  3. One-Directional Trail — Rather than placing the cloud boundary exactly at the shifted band each bar, the indicator uses math.max (bullish) or math.min (bearish) against the prior trail value. Once the floor is at level X, it will not drop below X even if the Donchian lower band temporarily dips — the level "locks in" and can only continue advancing. On a trend flip, the trail resets from the new band anchor.


How the Components Work Together

The Donchian breakout sets the trend but is inherently reactive — it waits for price to close beyond the N-bar extreme, so the first signal can be a bar or two late on fast moves. The cloud's one-way trail compensates for this by providing a persistent, non-retreating reference level throughout the trend. Because the floor never pulls back, it acts as a natural trailing stop zone: if price closes below the green cloud boundary, the bullish structure has likely deteriorated beyond normal noise. The two mechanisms are complementary — breakout for entry, one-directional trail for management.

The expansion percentage links cloud width to current volatility. On a stock moving 1 % a day in a tight channel, the cloud stays narrow. During a high-momentum phase where the channel widens, the cloud expands proportionally, giving the trade more room to breathe. This avoids one of the common frustrations with fixed-offset trailing stops: premature exits during volatile but sustained trends.

Trading Ideas and Insights

  • When a green circle appears and the cloud floor begins to form below price, it may signal an early-stage uptrend. Consider entries on the first close above the upper band with the cloud floor as an initial stop reference.
  • As a trend matures, the cloud floor rises and tightens. A close back into the cloud zone — especially with a wick that tags the floor — may indicate a pause rather than a reversal. A close below the cloud often warrants reassessment.
  • Compression of the Donchian Channel ahead of a circle signal (upper and lower bands converging) can suggest accumulated energy before a breakout. These setups may produce cleaner follow-through than breakouts from already-wide channels.
  • On higher timeframes the cloud acts as a broad trend filter. If price is above the green cloud on the daily, consider filtering intraday long setups only from that direction.


Past behavior does not guarantee future results. The indicator has no predictive capability — it identifies conditions based on historical price structure. Always combine with independent confirmation and proper risk management.

Limitations to Be Aware Of

  • The Donchian breakout condition requires a close beyond the N-bar extreme. On fast-moving bars, the entry signal appears one bar after the actual breakout, which can result in a worse fill price.
  • The one-way trail means the cloud boundary never retreats during a trend, but it also means it can diverge significantly from current price during extended moves. In those situations, the cloud is no longer a tight stop reference — it reflects the starting anchor of the trend, not current structure.
  • In choppy, range-bound conditions, the indicator will produce frequent trend flips (circles in rapid alternation). No trend-following tool performs well in this regime; watch the channel width as a rough proxy for regime type.


How to Use

  1. Add the indicator to any chart and timeframe. It works on overlay mode, drawing directly on price.
  2. A green cloud below price confirms a bullish trend. A red cloud above price confirms a bearish trend. The solid-colored boundary line is the active trailing level.
  3. Colored circles mark trend start bars. Green below price = trend flipped bullish. Red above price = trend flipped bearish.
  4. Use the Trend Length input to adjust sensitivity. Shorter values (10–15) react faster and suit shorter timeframes or momentum styles. Longer values (30–50) filter more noise and suit swing or position trading.
  5. Adjust the Expansion % to control how far the cloud boundary sits from the Donchian band. Higher values give more room and widen the cloud; lower values keep the trail tight to price.


Customization

  • Trend Length (default: 20) — Lookback window for the Donchian Channel. Larger values require a more sustained breakout to flip the trend and produce fewer, higher-conviction signals. Smaller values increase responsiveness at the cost of more noise.
  • Expansion % (default: 50) — How wide the cloud is expressed as a fraction of the channel width. At 100 %, the cloud spans the full channel. At 0 %, the cloud collapses to a line at the channel boundary. Values between 30 %–70 % work well for most setups.


Conclusion

Aurora Expanded Trend Cloud combines a Donchian breakout system with a volatility-adaptive, one-directional trailing zone to give both a clear trend signal and a persistent visual reference level throughout the move. It is best suited for traders who want an objective, rule-based trend overlay without manual line-drawing — particularly on trending assets and timeframes where Donchian systems historically perform best.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.