Indicator · Pine Script v4 · On the chart

BBW RSI 60 Study

by SammyEnigma· code credited to Greeffer

BBW RSI 60 Study combines Bollinger Bands, Bollinger Band Width (BBW), and the Relative Strength Index (RSI) to monitor volatility compression and momentum reversals.

View on GitHub

GitHub stars18on the repository
Pine versionv4older, still runs
Lines of code58
Settings3inputs
LicenceNone statedfile: MPL-2.0
Last update6 years ago15 Oct 2020

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

58 lines of Pine Script v4 from BBW-RSI-60-Study.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

BBW-RSI-60-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
// 210.14% profit in backtesting. Trading BTCUSDT 60 minute time frame on Binance Spot Exchange
//@version=4

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

// V a r i a b l e s
source = close
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)

// R S I
myRsi = rsi(source, length)
plot(myRsi, title="myRsi", color=color.blue, display=display.none)
//hline(buy, title='buy', color=color.red, display=display.none) //linestyle=hline.style_dotted, linewidth=1)
//hline(sell, title='sell', color=color.red, display=display.none) //linestyle=hline.style_dotted, linewidth=1)

// B o l l i n g e r   B a n d s 
[middle, upper, lower] = bb(source, length, 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)
plot(bbW, title="bbWidth", color=color.orange, display=display.none)

//  C o n d i t i o n s 
buyCondition = crossunder(bbW, 0.01)
sellCondition = cross(source, upper) and myRsi >= sell
stopCondition = crossunder(source, middle) and bbW>0.05

if(stopCondition)
    //strategy.close(id, when, comment, qty, qty_percent) 
    strategy.close("long", when=strategy.position_size > 0, comment="stop", qty_percent=100)

if(buyCondition)
    // strategy.entry(id, long, qty, limit, stop, oca_name, oca_type, comment, when)
    strategy.entry("long", strategy.long, qty=100, stop=lower, oca_name="long0", oca_type=strategy.oca.reduce, when=strategy.position_size <= 0)

if(sellCondition)
    // strategy.order(id, long, qty, limit, stop, oca_name, oca_type, comment, when)
    strategy.order("short", strategy.short, qty=10, stop=upper, oca_name="long0", oca_type=strategy.oca.reduce, when=myRsi>=95)
    strategy.order("short", strategy.short, qty=20, stop=upper, oca_name="long0", oca_type=strategy.oca.reduce, when=myRsi>=80)
    strategy.order("short", strategy.short, qty=10, stop=upper, oca_name="long0", oca_type=strategy.oca.reduce, when=strategy.position_size>40)

// B u y
alertcondition(buyCondition, title='Buy', message='{"direction":"buy","close":"{{close}}","time":"{{time}}"}')

// S e l l
alertcondition(sellCondition, title='Sell', message='{"direction":"sell","close":"{{close}}","time":"{{time}}"}')

// S t o p
alertcondition(stopCondition, title='Stop', message='{"direction":"stop","close":"{{close}}","time":"{{time}}"}')

Overview

BBW RSI 60 Study plots standard Bollinger Bands directly on the price chart while internally calculating RSI and BBW values. Buy alert signals trigger when BBW contracts below a low threshold, sell alerts trigger when price crosses the upper band while RSI is overbought, and stop alerts trigger on middle band crosses during high volatility. Key inputs allow customization of RSI length and threshold levels.

Details

Published by

SammyEnigma on GitHub

Code credit

Greeffer, as written in the script's header

Type

Indicator, Pine Script v4

Draws

On the price chart

Category

Oscillators & momentum, Volatility & bands, Moving averages

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
Sellint75sell
Buyint25buy
Lengthint14length
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

This overlay indicator plots a Supertrend from an ATR length and factor, four exponential moving averages, and a selectable VWAP or TWAP taken from a chosen timeframe on the price chart. It also shows MACD and stochastic with adjustable lengths, smoothing, ver

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup: Vijay Thakare Option Buying Scalping Setup

This indicator plots trade entry and exit signals on the price chart by combining Bollinger Bands with optional filter conditions. It calculates standard Bollinger Bands along with RSI, Aroon, and moving average filters. Reversal signals trigger when price bre

Indicator v4 Volatility & bandsOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Bollinger Bands Winner IND [Alorse]

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

8zz反指標v2

by hansai-art
121 stars

The 8zz Contrarian Indicator plots reverse sentiment trading signals directly on the price chart based on tracked retail post activity. It generates bullish signals during retail panic and bearish signals during market euphoria. The indicator features adjustab

Indicator v6 Moving averagesOscillators & momentum
Updated 3 months ago · None stated GitHub repository of 8zz反指標v2
114 stars

ADX Strategy (original) is an overlay indicator that identifies trend-following trade signals using the Average Directional Index (ADX) combined with a Simple Moving Average filter. A long signal is generated when the ADX rises above a user-defined trend level

Indicator v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of ADX Strategy (original)
56 stars

Double Screened Decision is a multi-timeframe trend and momentum indicator overlaid directly on the price chart. It dynamically selects a higher timeframe based on the active chart resolution to evaluate higher-timeframe MACD, Bollinger Bands, RSI, and Stochas

Indicator v5 TrendMoving averages Repaints
Updated 4 months ago · None stated GitHub repository of Double Screened Decision

More indicators

Trade Your Charts With a Regulated Broker

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

Compare brokers