OPEN-SOURCE SCRIPT

Bollinger Bands Forecast with Signals (Zeiierman)

1 911
Overview
Bollinger Bands Forecast with Signals (Zeiierman) extends classic Bollinger Bands into a forward-looking framework. Instead of only showing where volatility has been, it projects where the basis (midline) and band width are likely to drift next, based on recent trend and volatility behavior.

The projection is built from the measured slopes of the Bollinger basis, the standard deviation (or ATR, depending on the mode), and a volatility “breathing” component. On top of that, the script includes an optional projected price path that can be blended with a deterministic random walk, plus rejection signals to highlight failed band breaks.
สแนปชอต

How It Works
Bollinger Core
The script first computes standard Bollinger Bands using the selected Source, Length, and Multiplier:
  • Basis = SMA(Source, Length)
  • Band width = Multiplier × StDev(Source, Length)
  • Upper/Lower = Basis ± Width

This remains the “live” (non-forecast) structure on the chart.

Trend & Volatility Slope Estimation
To project forward, the indicator measures directional drift and volatility drift using linear regression differences:
  • Basis slope from the Bollinger basis
  • StDev slope from the Bollinger deviation
  • ATR slope for ATR-based projection mode

These slopes drive the forecast bands forward, reflecting the market’s recent directional and volatility regime.

Projection Engine (Forecast Bands)
At the last bar, the indicator draws projected basis, upper, and lower lines out to Forecast Bars. The projected basis can be:
  • Trend (straight linear projection)
  • Curved (ease-in/out transition toward projected endpoints)
  • Smoothed (extra smoothing on projected basis/width)

Price Path Projection + Optional Random Walk
In addition to projecting the bands, the script can draw a price forecast path made of a small number of zigzag swings.
  • Each swing targets a point offset from the projected basis by a multiple of the projected half-width (“width units”).
  • Decay gradually reduces swing size as the forecast deepens.

The Optional Random Walk Blend adds a deterministic drift component to the zigzag path. It’s not true randomness; it’s a stable pseudo-random sequence, so the drawing doesn’t jump around on refresh, while still adding “natural” variation.

Rejection Signals
Signals are based on failed attempts to break a band:
  • Bear Signal (Down): price tries to push above the upper band, then falls back inside, while still closing above the basis.
  • Bull Signal (Up): price tries to push below the lower band, then returns back inside, while still closing below the basis.

How to Use

Forward Support/Resistance Corridors
Treat the projected upper/lower bands as a future volatility envelope, not a guarantee:
  • The upper projection ≈ is likely a resistance level if the regime persists
  • The lower projection ≈ is likely a support level if the regime persists

Best used for trade planning, targets, and “where price could travel” under similar conditions.
สแนปชอต
Regime Read: Trend + Volatility
The projection shape is informative:

Rising basis + expanding width → trend with increasing volatility (needs wider stops / more caution)
สแนปชอต
Flat basis + compressing width → contraction regime (often precedes expansion)
สแนปชอต

Signals for Mean-Reversion / Failed Breakouts
The rejection markers are useful for fade-style setups:
  • A Down signal near/after upper-band failure can imply rotation back toward the basis.
  • An Up signal near/after lower-band failure can imply snap-back toward the basis.

With MA filtering enabled, signals are constrained to align with the broader bias, helping reduce chop-driven noise.
สแนปชอต
Related Publications
Donchian Predictive Channel (Zeiierman)

Settings

Bollinger Band
Controls the live Bollinger Bands on the chart.
  • Source – Price used for calculations.
  • Length – Lookback period; higher = smoother, lower = more reactive.
  • Multiplier – Bandwidth; higher = wider bands, lower = tighter bands.

Forecast
Controls the forward projection of the Bollinger Bands.
  • Forecast Bars – How far into the future the bands are projected.
  • Trend Length – Lookback used to estimate trend and volatility slopes.
  • Forecast Band Mode – Defines projection behavior (linear, curved, breathing, ATR-based, or smoothed).

Price Forecast
Controls the projected price path inside the bands.
  • ZigZag Swings – Number of projected oscillations.
  • Amplitude – Distance from basis, measured in bandwidth units.
  • Decay – Shrinks swings further into the forecast.

Random-Walk
Adds controlled randomness to the price path.
  • Enable – Toggle random-walk influence.
  • Blend – Strength of randomness vs. zigzag.
  • Step Size – Size of random steps (band-width units).
  • Decay – Reduces randomness as the forecast deepens.
  • Seed – Changes the (stable) random sequence.

Signals
Controls rejection/mean-reversion signals.
  • Show Signals – Enable/disable signal markers.
  • MA Filter (Type/Length) – Filters signals by trend direction.


-----------------
Disclaimer

The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.

All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน