Indicator · Pine Script v4 · On the chart

BBW RSI 15 Study

by modster· code credited to Greeffer

BBW RSI 15 Study is an overlay indicator designed for automated crypto trading via webhooks.

View on GitHub

GitHub stars32on the repository
Pine versionv4older, still runs
Lines of code66
Settings10inputs
LicenceNone statedfile: MPL-2.0
Last update3 years ago10 Dec 2022

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

66 lines of Pine Script v4 from pine-scripts/bbw-study.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

bbw-study.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Greeffer
// github.com/modster or modster.github.io
// Trading BTCUSDT 15 minute time frame on Binance Spot Exchange

//@version=4

// S t u d y
study('BBW/RSI/15 Study', 'BBW/RSI/15 Study', overlay=true, precision=4)

// V a r i a b l e s
source = input(close, title="RSI Source")
sell = input(title="Sell", defval=75, minval=0, maxval=100)
buy = input(title="Buy", defval=25, minval=0, maxval=100)
length = input(title="Length", defval=14, minval=1, maxval=500)
volMA = sma(volume,7)
showMA = input(true)

// V o l u m e
barColorsOnPrevClose = input(title="Color bars based on previous close", type=input.bool, defval=false)
palette = barColorsOnPrevClose ? close[1] > close ? color.red : color.green : open > close ? color.red : color.green
plot(volume, color = palette, style=plot.style_columns, title="Volume", display=display.none)
plot(showMA ? sma(volume,20) : na, style=plot.style_area, color=color.blue, display=display.none)

// S t o c h   R S I 
smoothK = input(3, minval=1) // <-----------------------------------------------
smoothD = input(3, minval=1) // <-----------------------------------------------
lengthRSI = input(14, minval=1)
lengthStoch = input(14, minval=1)

rsi1 = rsi(source, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
//plot(k, color=color.blue)
//plot(d, color=color.orange)
//h0 = hline(80)
//h1 = hline(20)
//fill(h0, h1, color=color.purple, transp=80, display=display.none)

// B o l l i n g e r   B a n d s 
[middle, upper, lower] = bb(source, length, 2.2)
plot(middle, title="middle", color=color.red, linewidth=2, style=plot.style_line, transp=70)
plot(upper, title="upper", color=color.green, linewidth=2, style=plot.style_line, transp=70)
plot(lower, title="lower", color=color.green,  linewidth=2, style=plot.style_line, transp=70)

// B o l l i n g e r  B a n d  W i d t h 
bbW = bbw(source, length, 2.2)
plot(bbW, title="bbWidth", color=color.orange, display=display.none)

//  C o n d i t i o n s
buyCondition = bbW<0.008 and volume>=volMA
//buyCondition = crossover(k, d) and k<25
//buyCondition = K>D and rsi<60 and bbw < 0.022
sellCondition = crossover(close, upper)
stopCondition = crossunder(source, middle) and bbW > 0.05

// B U Y
alertcondition(buyCondition, title='Buy', message='{"direction":"buy","ticker":"{{ticker}}","frame":"1minute","close":"{{close}}","time":"{{time}}"}')
//alertcondition(crossunder(myRsi, buy) and crossunder(close, lower), title='Buy', message='{"direction":"buy","ticker":"{{ticker}}","frame":"1minute","close":"{{close}}","time":"{{time}}"}')

// S E L L
alertcondition(sellCondition, title='Sell', message='{"direction":"sell","ticker":"{{ticker}}","frame":"1minute","close":"{{close}}","time":"{{time}}"}')
//alertcondition(crossover(myRsi, sell) and crossover(close, upper), title='Sell', message='{"direction":"sell","ticker":"{{ticker}}","frame":"1minute","close":"{{close}}","time":"{{time}}"}')

// S T O P
alertcondition(stopCondition, title='Stop', message='stop')

Overview

BBW RSI 15 Study plots standard-deviation-adjusted Bollinger Bands directly on the price chart while calculating secondary metrics such as Stochastic RSI, volume moving averages, and Bollinger Band Width. The script triggers custom alert conditions with JSON payloads when low volatility squeeze conditions coincide with above-average volume, as well as exits on upper band breakouts or high-volatility middle band crossunders.

Details

Published by

modster on GitHub

Code credit

Greeffer, as written in the script's header

Type

Indicator, Pine Script v4

Draws

On the price chart

Markets

Crypto

Timeframes

M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
RSI Sourcesourceclosesource
Sellint75sell
Buyint25buy
Lengthint14length
showMAbooltrueshowMA
Color bars based on previous closeboolfalsebarColorsOnPrevClose
smoothKint3smoothK
smoothDint3smoothD
lengthRSIint14lengthRSI
lengthStochint14lengthStoch
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.

Similar Pine Scripts

Snag - VWAP

by dearvn
257 stars

This indicator plots a custom Anchored Volume-Weighted Average Price (VWAP) directly on the price chart along with optional standard deviation bands. Users can anchor the VWAP to standard time periods like sessions, weeks, or months, or to corporate events suc

Indicator v5 Moving averagesVolatility & bands Repaints
Updated 6 weeks ago · None stated GitHub repository of Snag - VWAP

LiqSpikeBounceLong Feb2026

by agutinbaigo28
147 stars

LiqSpikeBounceLong Feb2026 is an indicator designed to identify long bounce entries following high-volume liquidation cascades in bearish market contexts. It checks if price is below an exponential moving average, then detects large single-bar drops exceeding

Indicator v5 Volatility & bandsVolume
Updated 6 weeks ago · MIT GitHub repository of LiqSpikeBounceLong Feb2026

Adaptive MA Slope

by capissimo
114 stars

This indicator calculates Kaufman's Adaptive Moving Average (KAMA) on a chosen price source and determines trend direction based on the slope across a configurable lookback window. Signals can be filtered by short-term volatility expansion using ATR comparison

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Adaptive MA Slope

RSTEmaVwap

by readysetcryptocodes
43 stars

This indicator overlays exponential moving averages and a session VWAP on the price chart. It builds a daily VWAP from typical price and volume, then plots one- and two-standard-deviation bands around it on selected intraday charts. EMA lengths change by timef

Indicator v4 Moving averagesVolume
Updated 2 years ago · None stated GitHub repository of RSTEmaVwap
9 stars

This indicator plots a volume-weighted moving average as a central trend baseline and surrounds it with ATR-based volatility bands. It colors the trend and optional price bars according to whether price is on the bullish or bearish side of those bands. Users c

Indicator v6 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Volume Weighted Trend [QuantAlgo]

MattSuite V3

by mmarbmatt
8 stars

MattSuite V3 is an overlay indicator that combines market-structure and trend tools on the price chart. It identifies bullish and bearish fair value gaps and estimates their strength, flags break of structure and change of character, and marks order blocks. It

Indicator v5 SMC / ICT / price actionVolatility & bands
Updated 1 year ago · None stated GitHub repository of MattSuite V3

More Volatility & bands scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers