OPEN-SOURCE SCRIPT

Volatility Reversion Bands Pro [JOAT]

976
VOLATILITY REVERSION BANDS PRO [JOAT]

A two-layer reversion envelope: inner Bollinger band for the normal volatility envelope, outer ATR-extended band for the extreme envelope. Signals only fire when price has reached the outer ring — the inner band is context, the outer band is the trigger. The result is a clean mean-reversion engine that respects the difference between "stretched" and "actually stretched".

스냅샷

Two envelopes, one principle

  • Inner band — classic Bollinger: basis (SMA or EMA) ± stdev × multiplier. The familiar 20-period, 2-sigma defaults are preserved.
  • Outer reversion band — the outer envelope extends inner band ± ATR × multiplier. This is the band that triggers signals. Setting the ATR multiplier high makes signals rarer but deeper; setting it low makes them frequent and shallower.


Reversion bands using stdev alone collapse in low-volatility regimes (too many false signals) and explode in high-volatility regimes (signals come too late). The ATR extension on top of stdev fixes both: ATR adds a constant-floor protection in quiet markets and scales the outer band proportionally in loud ones.

Strong vs weak signals

Two signal tiers from a single channel-ratio read (close position within the outer band, normalised 0–1):

  • Strong signals — fire on the outer band itself (ratio ≤ 0 or ≥ 1). The high-conviction reversion read.
  • Weak signals — fire when ratio reaches a configurable near-band threshold (default 0.10 / 0.90). The "approaching outer band" read — useful for traders who want earlier hints. Easily disabled.


A signal cooldown suppresses same-side repetition; an exhaustion arrow prints when N consecutive bars (default 3) all live in the outer-band zone — a configurable escalating-glyph string ("^", "^^", "^^^"…) makes the run length visible at a glance.

Volatility regime classification

Independent of signals, the script classifies the current volatility regime by comparing current stdev to its own rolling average over a long lookback (default 100 bars):

  • Low regime — stdev / avgStdev below the low threshold (default 1.0×). Reversion is more reliable here.
  • High regime — above the high threshold (default 2.0×). Reversion is less reliable here; trends become dominant.
  • Normal regime — in between. Default mode.


Background tinting (toggleable, transparency-controlled) paints the chart by regime so the trader can see at a glance whether the current environment is suitable for reversion. This is the "do not fight the tape" filter — when the background is hot, every reversion signal is lower-conviction by definition.

Visual system

  • Bar gradient — bars are coloured by their position-in-band ratio (bull → mid → bear via plasma palette). At a glance you can see where price is sitting in the channel without reading the value.
  • Inner band fill — toggleable shoulder fill between BB and outer reversal bands with configurable transparency.
  • Inner BB lines and basis line are each independently toggleable for traders who want a minimalist or full envelope view.
  • Signal label style — Glyph (compact), Text (verbose), or Both.


A locked Plasma palette (yellow bull, magenta bear, violet mid) on a deep-void background gives the chart a distinctive look without competing with price action.

Dashboard

Monospaced table, positionable to any of nine corners, with togglable legend footer. Rows surface current basis, inner band values, outer reversion band values, channel ratio %, stdev / avgStdev ratio, regime label, last signal direction with age, and an exhaustion run counter.

Alerts

Four alert conditions, each independently controllable:

  • Strong Long / Short (outer band touch reversion)
  • Weak Long / Short (near-band threshold)
  • Vol Regime Change
  • Exhaustion Arrow (consecutive bars in outer-band zone)


스냅샷

How to read it

Two reads, in order of conviction:

  1. Strong signal in a Low or Normal regime — the script's intended sweet spot. The outer band has been touched, price is statistically far from its mean, and the volatility environment supports the idea of mean-reversion.
  2. Exhaustion arrow — when 3+ bars sit in the outer band, you usually have either a genuine breakout (the bands themselves will start to expand) or an exhaustion (the next reversal candle will be the signal). Either way, the next move is meaningful.


In a High regime, treat strong signals as cautionary at best — the bars are coloured by ratio for a reason; the gradient will tell you when one side is dominating.

Suggested settings

Defaults (length 20, stdev mult 2.0, ATR mult 1.5) are tuned to 1H–4H on liquid markets — the classical Bollinger settings plus a 1.5-ATR outer cushion. For 5m–15m, drop length to 14 and ATR multiplier to 1.0. For daily and above, raise length to 50 and ATR multiplier to 2.0. The regime thresholds (low 1.0×, high 2.0× of the long-run stdev average) are conservative — tighten the bands if your instrument is unusually quiet.

Originality / what's reused

Bollinger Bands and ATR are public-domain primitives. The implementation — the outer-band = inner-band ± ATR construction, the channel-ratio bar gradient, the regime classifier with auto-tinted background, the exhaustion-arrow consecutive-bar run logic, the weak/strong signal tiering, and the dashboard's monospaced regime-aware layout — is JOAT-original and tuned together. No third-party code reused.

Open source

Published open-source under the default Mozilla Public License 2.0. Section-headed source, tooltips on every input, helper functions documented inline. The band engine, the regime classifier, the exhaustion logic, and the dashboard are independent modules — fork or extend any single one without reading the whole file.

Limitations

Reversion bands are a counter-trend tool by construction. In sustained one-sided moves the outer band will be repeatedly touched without producing a profitable reversion — the High regime tint and the exhaustion-arrow run logic both exist to warn you when you are in this state. Signals are confirmed on bar close (non-repainting), so an intra-bar wick into the outer band that gets reabsorbed will not fire.



-made with passion by jackofalltrades

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.