Indicator · Pine Script v6 · On the chart

Scalping BB CCI ROC

by rubbermetal· code credited to claygrace74

Scalping BB CCI ROC is an indicator that marks Scalp L or Scalp S labels when the close is outside a Bollinger Band while CCI and rate of change are both beyond their thresholds in the same direction.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code74
Settings9inputs
LicenceMPL-2.0
Last update4 months ago10 Jun 2026

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

74 lines of Pine Script v6 from Scalping Strategy.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

Scalping Strategy.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © claygrace74

//@version=6
indicator("Scalping BB CCI ROC", shorttitle="Scalp", overlay=true)

// ==================== Bollinger Band Settings ====================
var bb_group = "Bollinger Bands"
bb_length = input.int(20, "BB Length", minval=5, group=bb_group)
bb_std    = input.float(2.0, "BB StdDev", minval=0.5, step=0.5, group=bb_group)

// ==================== Oscillator Settings ====================
var osc_group = "Oscillator Settings"
cci_length = input.int(14, "CCI Length", minval=1, group=osc_group)
cci_level  = input.int(100, "CCI OB/OS Threshold", minval=50, group=osc_group)
roc_length = input.int(9, "ROC Length", minval=1, group=osc_group)
roc_level  = input.float(1.0, "ROC Threshold", minval=0.1, step=0.1, group=osc_group)

// ==================== Display Settings ====================
var disp_group = "Display Settings"
i_showSignals = input.bool(true, "Show Entry Signals", group=disp_group)
i_showBB      = input.bool(true, "Show Bollinger Bands", group=disp_group)
i_showSqueeze = input.bool(true, "Show BB Squeeze", group=disp_group)

// ==================================================================================
// Core Calculations
// ==================================================================================
ma       = ta.sma(close, bb_length)
bb_width = ta.stdev(close, bb_length) * bb_std
bb_upper = ma + bb_width
bb_lower = ma - bb_width
bb_pct   = (close - bb_lower) / (bb_upper - bb_lower)

cci = ta.cci(close, cci_length)
roc = ta.roc(close, roc_length)

// Entry signals — price at BB extreme + CCI extreme + ROC extreme
long_signal  = close < bb_lower and cci < -cci_level and roc < -roc_level
short_signal = close > bb_upper and cci > cci_level and roc > roc_level

// BB squeeze detection (volatility contraction)
bbWidth   = (bb_upper - bb_lower) / ma
avgBBWidth = ta.sma(bbWidth, 50)
squeeze   = bbWidth < avgBBWidth * 0.75

// ==================================================================================
// Plots
// ==================================================================================
pUpper = plot(i_showBB ? bb_upper : na, "BB Upper", color=color.new(color.red, 30), linewidth=1)
pMA    = plot(i_showBB ? ma : na, "BB Mid", color=color.new(color.blue, 30), linewidth=1)
pLower = plot(i_showBB ? bb_lower : na, "BB Lower", color=color.new(color.green, 30), linewidth=1)

// BB fill — color by where price sits in the bands
fillColor = bb_pct > 0.8 ? color.new(color.red, 85) : bb_pct < 0.2 ? color.new(color.green, 85) : color.new(color.gray, 92)
fill(pUpper, pLower, color=i_showBB ? fillColor : color(na), title="BB Fill")

// Entry signals
plotshape(i_showSignals and long_signal,  style=shape.triangleup,   location=location.belowbar, color=color.green, text="Scalp L", textcolor=color.green, size=size.small, title="Scalp Long")
plotshape(i_showSignals and short_signal, style=shape.triangledown, location=location.abovebar, color=color.red,   text="Scalp S", textcolor=color.red,   size=size.small, title="Scalp Short")

// Squeeze detection
bgcolor(i_showSqueeze and squeeze ? color.new(color.yellow, 92) : na, title="BB Squeeze")
plotshape(i_showSqueeze and squeeze and not squeeze[1], style=shape.diamond, location=location.bottom, color=color.new(color.yellow, 0), text="Squeeze", textcolor=color.yellow, size=size.tiny, title="Squeeze Start")

// Signal background
bgcolor(long_signal ? color.new(color.green, 90) : short_signal ? color.new(color.red, 90) : na, title="Signal BG")

// ==================================================================================
// Alert Conditions
// ==================================================================================
alertcondition(long_signal,                "Scalp Long Signal",  "BB lower + CCI oversold + ROC negative")
alertcondition(short_signal,               "Scalp Short Signal", "BB upper + CCI overbought + ROC positive")
alertcondition(squeeze and not squeeze[1], "BB Squeeze Start",   "Bollinger Band squeeze detected — low volatility")
alertcondition(not squeeze and squeeze[1], "BB Squeeze Release",  "Bollinger Band squeeze released — breakout likely")

Overview

Scalping BB CCI ROC draws the bands with a fill colored by price position, and highlights squeezes when band width falls below a fraction of its 50-bar average. It places no orders and has no exit rules. It draws on the price chart.

Details

Published by

rubbermetal on GitHub

Code credit

claygrace74, as written in the script's header

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Scalping, Mean reversion, Volatility & bands

Markets

Any symbol

Timeframes

M1-M5

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
BB Lengthint20bb_length
BB StdDevfloat2.0bb_std
CCI Lengthint14cci_length
CCI OB/OS Thresholdint100cci_level
ROC Lengthint9roc_length
ROC Thresholdfloat1.0roc_level
Show Entry Signalsbooltruei_showSignals
Show Bollinger Bandsbooltruei_showBB
Show BB Squeezebooltruei_showSqueeze
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

5 stars

Greeffer's Scalping Indicator overlays higher-timeframe exponential moving averages, Bollinger Bands, and Donchian channels on the price chart. It flags a long when price touches the lower Donchian and lower band while the faster averages are not stacked beari

Indicator v5 Moving averagesVolatility & bands
Updated 4 years ago · None stated GitHub repository of Greeffer's Scalping Indicator

GEKO Scalp

by grzegorzkowalskigk-jpg
1 stars

This indicator is a mean-reversion scalper for index futures on one to five minute charts. It plots session VWAP with one and two standard deviation bands and previous day high and low, and arms setups only when an Efficiency Ratio shows choppy rather than tre

Indicator v6 Mean reversionScalping
Updated 3 months ago · Custom licence GitHub repository of GEKO Scalp

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]

TylerG FVG BB Reversal

by TradersPost
218 stars

This indicator identifies mean-reversion setups by combining Bollinger Bands with Fair Value Gaps (FVGs). It tracks FVGs that print outside the upper or lower Bollinger Bands and counts them toward an alert threshold. Signals trigger upon gap mitigation (by to

Indicator v6 SMC / ICT / price actionVolatility & bands
Updated 3 months ago · None stated GitHub repository of TylerG FVG BB Reversal
147 stars

This indicator combines Bollinger Bands, RSI, Stochastic RSI, and volume spike detection to identify mean-reversion conditions during range-bound market regimes. It calculates Bollinger Band width to identify low-volatility states and triggers buy or sell sign

Indicator v5 Oscillators & momentumVolatility & bands
Updated 6 weeks ago · MIT GitHub repository of BTC Dec 2025 — Range + Gamma Flush

JMA-HMA-based Scalper

by capissimo
114 stars

This price-chart indicator builds a fast-minus-slow Jurik moving average of the selected price and wraps that series in upper and lower bands set by a standard-deviation multiplier and the fast lookback. It reads band direction, whether both bands rise or fall

Indicator v4 Moving averagesVolatility & bands
Updated 1 year ago · None stated GitHub repository of JMA-HMA-based Scalper

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