OPEN-SOURCE SCRIPT

Bollinger Band [scoopup]

561
Overview
A Bollinger Bands–based indicator that shows trend direction (up/down) through the basis line color, displays band width (volatility) as a percentage, and marks the most recent meaningful lows (demand zones) on the weekly and daily timeframes as boxes. It lets you view statistical volatility and the real low zones where buying previously stepped in — all on a single chart.

Default settings are Length 21 and StdDev 1.618, based on the Fibonacci number (21) and the golden ratio (1.618).

Components
1. Bollinger Bands (Upper / Basis / Lower)

Defaults: Length 21, StdDev 1.618
Upper band, basis (middle), and lower band. The bands widen and narrow with volatility.
2. Basis Line Trend Color (Daily-based)

The color of the middle basis line indicates trend direction.
Logic: over a set lookback, it compares the cumulative size of the "close-to-lower" area (red) versus the "upper-to-close" area (green).
Red area dominant → uptrend → basis line GREEN
Green area dominant → downtrend → basis line RED
The longer the close stays near the lower band (larger red area), the more it is read as base-building before a move higher.
This color is always calculated from Daily data, regardless of the chart timeframe. Whether you view it on the 15m, 1h, or 4h chart, the daily trend color stays consistent.
3. Fill

Upper band ↔ close: semi-transparent green
Close ↔ lower band: semi-transparent red
Lets you quickly read where the close sits within the bands.
4. Band Width (%)

Formula: (Upper − Lower) / Basis × 100
Displays the current band width in a corner table as Band Width: X.XX%.
Lower = volatility contraction (squeeze) → often precedes a large move; higher = volatility expansion.
The Data Window also shows band width % and band width (price difference), including on historical bars.
5. Recent Lows

Weekly recent low = yellow box / Daily recent low = red box
Shows only the most recent pivot (swing) low that sits below the current close. (Lows above the close are skipped; if the latest low is above the close, the prior low is used instead.)
Box height spans the low ↔ the close at that point, and extends to the right to show a still-valid support/demand zone.
How to Read It
Basis green + close near the lower band → watch for a potential bounce after base-building.
Basis red + close near the upper band → watch for overextension/pullback risk.
Band Width % contracting (squeeze) → watch for an upcoming volatility expansion.
Recent low boxes (yellow/red) act as first support candidates on a pullback. A close below the box signals support failure.
Key Settings
Bollinger Bands: Source, Length (default 21), StdDev (default 1.618), Band Color / Width / Style
Basis Line: Show Basis, Basis Width, Ratio Length, Up / Down Color
Fill: Show Fill, Upper / Lower Fill Transparency
Band Width: Show Band Width %, Table Position, Text Size
Recent Lows: weekly/daily toggles, Pivot Length, Box Color
Tips
This is a supporting tool for reading trend direction + volatility + support zones together, not a standalone trade signal.
Reliability increases when the daily trend color and a recent low box line up in the same area.
Adjust StdDev and Ratio Length to fit each instrument's volatility.
Disclaimer
This indicator is for reference only and does not guarantee trading profits. All trading decisions and responsibility rest solely with the user.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.