1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
270 lines of Pine Script v5 from bollinger-bands/06-ema-bb-signal.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
A smoothing factor controls the kernel bandwidth, and an optional setting can allow the estimate to repaint. Users can show two band levels, plot lines, and place labels from pivots, close, or high and low. Optional notifications fire when price breaks the first band level. Separate inputs set neighbor count, lookback length, and signal thresholds, though the visible code does not show how those values are applied.
Nadaraya-Watson smoothed Bollinger Bands
Short, medium, and long band sets
Optional labels from pivots, close, or high and low
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Smoothing Factor
float
6
h
Repaint Smoothing
bool
false
repaint
Period
int
20
short_period
Deviation
float
3
short_stdev
Period
int
75
med_period
Deviation
float
4
med_stdev
Period
int
100
long_period
Deviation
float
4.25
long_stdev
Label Source
string
High/Low
label_src
Labels
bool
true
labels
Plot Lines
bool
true
plots
Line Width
int
2
plot_thickness
Show all 25 settings
Setting
Type
Default
Variable
Level 1 Bands
bool
true
bands_lvl1
Level 2 Bands
bool
true
bands_lvl2
Bearish
color
color.red
pallete_bear
Bullish
color
color.green
pallete_bull
Transparency: Level 1
float
.90
alpha1
Level 2
float
.85
alpha2
Band Breaks
bool
false
notifs
K - Number of neighbors
int
5
k
LookbackPeriod
int
400
lookbackPeriod
Signal Low
int
40
trend_low
Signal High
int
60
trend_high
Lookback
int
10
sig_lookback
Length
int
100
sig_length
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This indicator uses a Hidden Markov Model (HMM) framework combined with an adaptive dual moving average engine and Directional Movement Index (DMI) features to identify market regimes (bullish, bearish, or ranging/chop). It calculates regime probabilities on e
This overlay indicator plots a SuperTrend-style band on the price chart using ATR length, a selectable source, and a base factor. Optional settings enable an adaptive factor driven by rate of change, a volatility filter, K-means clustering, and an LSTM layer w
This indicator plots an oscillator in a separate pane. It builds several SuperTrend series across a user-defined factor range and step, using ATR as the band width. On each bar it measures the distance between the close and each SuperTrend output, then groups
The Expectation Maximization Gaussian Mixture Regime indicator clusters market states into two to five components using an online Expectation-Maximization Gaussian Mixture Model. It processes three input features: volatility-normalized momentum, relative volat
This indicator plots an ATR-based Chandelier Exit trailing stop on the price chart. It tracks a long stop under recent highs and a short stop above recent lows, then switches direction when price crosses the opposite stop. Buy and sell labels mark those flips.
This overlay indicator marks ICT liquidity void fills on the price chart and can show long and short signals. It places a Fibonacci level inside a displacement candle, defaulting to the midpoint, and draws lines in a chosen style. Optional filters limit the fi