[blackcat] L1 Dynamic Multi-Layer Bollinger Bands

4 005
█ OVERVIEW

This indicator extends classic Bollinger Bands into a two-layer volatility envelope around a 21-period moving average, complete with dynamic trend coloring and automatic BUY/SELL labels. It is built for mean-reversion setups: fade price extremes back toward the mean while the band fill keeps you aligned with the prevailing trend direction.

█ CONCEPTS

The script layers standard-deviation channels around a simple moving average:

 • Middle band: 21-period SMA of the close — the baseline value the price oscillates around
 • Inner bands: middle band ± 1.382 standard deviations — the primary signal zone for entries and exits
 • Outer bands: middle band ± 2.56 standard deviations — the overextension zone that marks statistically stretched moves
 • Trend coloring: the area between the inner bands turns green while the middle band is rising and red while it is falling, giving an at-a-glance bias filter

Signals follow a mean-reversion logic: price that pierces a band and then re-enters the envelope is treated as exhaustion of the current swing.

█ HOW TO USE

1 — Add the indicator to your chart; it runs on the price panel with no configuration needed
2 — Check the fill color first: green favors long-side setups, red favors short-side setups
3 — Wait for a BUY label (close crossing back above the lower inner band) or a SELL label (close crossing back below the upper inner band)
4 — Use the middle band as the mean-reversion target and the outer bands as overextension references
5 — Confirm with your own analysis — band re-entries are best treated as setup signals, not standalone trade commands

Fixed Parameters
This legacy version uses hard-coded settings for reproducibility (no user inputs):

 • Period: 21 bars for the moving average and standard deviation
 • Inner multiplier: 1.382 standard deviations
 • Outer multiplier: 2.56 standard deviations

█ FEATURES

 • Two concentric volatility envelopes (inner and outer bands) in a single plot
 • Dynamic fill that tracks the slope of the middle band (green = rising, red = falling)
 • Automatic BUY/SELL labels printed on the bar where the signal fires
 • Built-in alerts ("Buy Alert" / "Sell Alert") for both directions
 • Historical labels persist on the chart, so past signals remain visible for visual review

█ SIGNALS

Visual Elements
 • Green BUY label below the bar: close crossed back above the lower inner band — potential long mean-reversion entry
 • Red SELL label above the bar: close crossed back below the upper inner band — potential short entry or long exit
 • Green band fill: middle band rising — bullish bias
 • Red band fill: middle band falling — bearish bias
 • Outer band touch: statistically stretched move; snap-back potential toward the mean increases

█ IMPLEMENTATION NOTES

Open-source under the Mozilla Public License 2.0. Built with built-ins only: ta.sma and ta.stdev construct the bands, ta.crossover / ta.crossunder detect the signals, and alertcondition exposes the alerts. Core of the calculation:

Pine Script®


No request.security calls — nothing is drawn from higher timeframes, so the script does not repaint from external data. Signals are evaluated on the developing bar, so create alerts with the "Once Per Bar Close" option to avoid intrabar flicker.

█ LIMITATIONS

 • Mean-reversion logic struggles in strong trends: price can walk along a band and generate repeated counter-trend signals
 • Parameters are hard-coded; changing the period or multipliers requires editing the source
 • Best suited to ranging or moderately trending markets; very low timeframes add noise
 • This is the legacy V1 release of the L1 series, kept for reference — later versions refine the same idea

█ NOTES

 • Original author: blackcat1402 — released under the Mozilla Public License 2.0
 • Labels accumulate on the chart by design in this legacy version (old signals are not deleted)
 • Not financial advice — always validate signals within your own risk framework

════════════════════════════════════════════════════════════════════════
For questions or feedback, please use the comments section below.
Feel free to use and modify — attribution appreciated.

면책사항

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