Indicator · Pine Script v6 · Own pane

Trading Toolkit (Michaël van de Poppe) [BigBeluga]

by theonetrade· code credited to BigBeluga

Calculates a Relative Strength Index (RSI) oscillator alongside support and resistance levels, RSI divergence detection, and price correction tracking.

View on GitHub

GitHub stars34on the repository
Pine versionv6current
Lines of code221
Settings14inputs
LicenceMIT
Last update2 weeks ago8 Nov 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

221 lines of Pine Script v6 from assets/indicator/bit-exact/comprehensive_trading_toolkit_bigbeluga_MJym5paR.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

comprehensive_trading_toolkit_bigbeluga_MJym5paR.pine
// This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International  
// https://creativecommons.org/licenses/by-nc-sa/4.0/
// © BigBeluga

//@version=6
indicator("Trading Toolkit (Michaël van de Poppe) [BigBeluga]", overlay = false, max_boxes_count = 500, max_bars_back = 500)

// INPUTS ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
// S/R
bool  show_sr = input.bool(true, "", group = "Support & Resistance", inline = "sr") 
int   len     = input.int(30, "Support/Resistance", group = "Support & Resistance", inline = "sr")
color bul_col = input.color(color.rgb(0, 230, 119, 70), "", inline = "sr")
color ber_col = input.color(color.rgb(255, 82, 82, 70), "", inline = "sr")

// RSI
int  length   = input.int(24, "RSI", group = "Rsi", inline = "lvl")
int  overs    = input.int(30, "OS/OB", group = "Rsi", inline = "lvl")
int  overb    = input.int(70, "", group = "Rsi", inline = "lvl")
bool show_div = input.bool(false, "", inline = "div"), div_len = input.int(10, "Divergence", inline = "div")
color bull_col = input.color(color.rgb(0, 230, 211, 20), "", inline = "div")
color bear_col = input.color(color.rgb(255, 82, 82, 20), "", inline = "div")

// Correction
bool  show_cor = input.bool(false, "", group = "correction", inline = "cor"), correction = input.int(5, "Correction %", group = "correction", inline = "cor")
color corr_col = input.color(#2195f32d, "", group = "correction", inline = "cor")

color m_col     = chart.fg_color
color noneColor = color.new(color.white, 100)


series float rsi = ta.rsi(close, length)

// Divergence
int lookbackRight = div_len
int lookbackLeft = div_len
int rangeUpper = 60
int rangeLower = 5
// }


// CALCULATIONS――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{

_inRange(bool cond) =>
    bars = ta.barssince(cond)
    rangeLower <= bars and bars <= rangeUpper


rsi_divergence()=>

    plFound = false
    phFound = false

    bullCond = false
    bearCond = false

    rsiLBR = rsi[lookbackRight]

    pl_p = ta.pivotlow(low, lookbackLeft, lookbackRight)
    ph_p = ta.pivothigh(high, lookbackLeft, lookbackRight)

    //------------------------------------------------------------------------------
    // Regular Bullish
    // rsi: Higher Low
    inrangepl = _inRange(plFound[1])
    inrangeph = _inRange(phFound[1])

    pl = ta.pivotlow(rsi, lookbackLeft, lookbackRight)
    plFound := not na(pl)    
    rsiHL = rsiLBR > ta.valuewhen(plFound, rsiLBR, 1) and inrangepl
    // Price: Lower Low
    lowLBR = low[lookbackRight]
    priceLL = lowLBR < ta.valuewhen(plFound, lowLBR, 1)
    bullCond := priceLL and rsiHL and plFound

    //------------------------------------------------------------------------------
    // Regular Bearish
    // rsi: Lower High
    ph = ta.pivothigh(rsi, lookbackLeft, lookbackRight)
    phFound := not na(ph)
    rsiLH = rsiLBR < ta.valuewhen(phFound, rsiLBR, 1) and inrangeph
    // Price: Higher High
    highLBR = high[lookbackRight]
    priceHH = highLBR > ta.valuewhen(phFound, highLBR, 1)
    bearCond := priceHH and rsiLH and phFound

    [pl_p, ph_p, bearCond, bullCond, plFound, phFound, rsiLBR]


correction(correction)=>
    var boxes = array.new<box>()
    roc = ta.roc(close, 15)
    var roc_indx = int(na)
    var roc_src = float(na)

    if ta.cross(roc, 0)
        roc_indx := bar_index
        roc_src  := high

    if ta.crossunder(roc, -correction) 
        boxes.push(box.new(roc_indx, roc_src, bar_index+1, low, na, 0, bgcolor = corr_col, force_overlay = true))

    if boxes.size() > 1
        for i = 0 to boxes.size() - 1
            box_id = boxes.get(i)
            indx = i < boxes.size() - 1 ? i+1 : 0 
            box_id_1 = boxes.get(indx)

            if box_id.get_left() == box_id_1.get_left()
                box.delete(box_id_1) 
                //boxes.set(indx, box(na))

            if box_id.get_right() - box_id.get_left() >= 10
                box.delete(box_id) 

norm_candle_size()=>
    ((high-low) / ta.stdev(high-low, 200))


draw_levels()=>

    PH  = ta.pivothigh(len,len)
    PL  = ta.pivotlow(len, len)
    Atr = ta.atr(200)* 0.3

    candle_size = norm_candle_size()

    big_candle = candle_size[len] > 1
    style      = candle_size[len] > 1.5 ? line.style_solid : line.style_dashed

    var lines = array.new<line>()
    var boxes = array.new<box>()

    if big_candle
        if not na(PH)
            lines.push(line.new(bar_index-len, PH, bar_index, PH, extend = extend.right, style = style, color = m_col, force_overlay = true))
            boxes.push(box.new(bar_index-len, PH + Atr, bar_index+5, PH - Atr, na, 0, bgcolor = ber_col, force_overlay = true))
        if not na(PL)
            lines.push(line.new(bar_index-len, PL, bar_index, PL, extend = extend.right, style = style, color = m_col, force_overlay = true))
            boxes.push(box.new(bar_index-len, PL + Atr, bar_index+5, PL - Atr, na, 0, bgcolor = bul_col, force_overlay = true))

    for line_id in lines
        level  = line_id.get_y1()
        box_id = boxes.get(lines.indexof(line_id))
        box_id.set_right(bar_index+10)    

        if high[1] > level and high < level 
            box.set_lefttop(box_id, bar_index, level+Atr)
            box.set_rightbottom(box_id, bar_index+5, level-Atr)
            box.set_bgcolor(box_id, ber_col)

        if low[1] < level and low > level 
            box.set_lefttop(box_id, bar_index, level+Atr)
            box.set_rightbottom(box_id, bar_index+5, level-Atr)
            box.set_bgcolor(box_id, bul_col)

    if array.size(lines) > 0    
        if array.size(lines) > 6
            line.delete(array.shift(lines))
            box.delete(array.shift(boxes))
// }


// PLOT ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
if show_sr
    draw_levels()

if show_cor
    correction(correction)

[pl_p, ph_p, bearCond, bullCond, plFound, phFound, rsiLBR] = rsi_divergence()

// Divergence Plot
pr = plot(rsi, color = m_col)
p7 = plot(overb, display = display.none, editable = false)
p3 = plot(overs, display = display.none, editable = false)

h2 = hline(overs, "Oversold", color = m_col)
h1 = hline(overb, "OverBought", color = m_col)
hline(50, color = color.new(m_col, 50))

fill(h1, h2, color.new(m_col, 85))
fill(p3, pr, overs, 20, na, rsi < overs ? color.red : na)
fill(p7, pr, overb, 85, na, rsi > overb ? color.lime : na)

displ_div = show_div ? display.pane : display.none
plot(
     plFound ? rsiLBR : na,
     offset=-lookbackRight,
     title="Regular Bullish",
     linewidth=2,
     color=(bullCond ? bull_col : noneColor),
     display = displ_div
     )

plot(
     phFound ? rsiLBR : na,
     offset=-lookbackRight,
     title="Regular Bearish",
     linewidth=2,
     color=(bearCond ? bear_col : noneColor),
     display = displ_div
     )

plot(
     plFound ? low[lookbackRight] : na,
     offset=-lookbackRight,
     title="Regular Bullish",
     linewidth=1,
     color=(bullCond ? bull_col : noneColor),
     display = displ_div, force_overlay = true
     )

plot(
     phFound ? high[lookbackRight] : na,
     offset=-lookbackRight,
     title="Regular Bearish",
     linewidth=1,
     color=(bearCond ? bear_col : noneColor),
     display = displ_div, force_overlay = true
     )
// }

Overview

Trading Toolkit (Michaël van de Poppe) [BigBeluga] plots in a separate pane below the main price chart. Users can configure the RSI calculation length, overbought and oversold thresholds, divergence lookback periods, and support/resistance sensitivity settings. Divergence calculations use pivot points to identify potential market reversal conditions.

Details

Published by

theonetrade on GitHub

Code credit

BigBeluga, as written in the script's header

Draws

Separate pane below the chart

Markets

Any symbol

Timeframes

Any timeframe

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.

Topics

algorithmic-tradingbacktestingbitcoinccxtcrypto-tradingllm-agentoffline-backtestingopen-source-tradingpine-scriptpine-to-pythonpinescriptpynecorepythonquantquantitative-financestrategy-backtestingtechnical-analysistrading-indicatorstrading-strategiestradingview

Settings

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

SettingTypeDefaultVariable
show_srbooltrueshow_sr
Support/Resistanceint30len
bul_colcolorcolor.rgb(0, 230, 119, 70)bul_col
ber_colcolorcolor.rgb(255, 82, 82, 70)ber_col
RSIint24length
OS/OBint30overs
overbint70overb
show_divboolfalseshow_div
Divergenceint10div_len
bull_colcolorcolor.rgb(0, 230, 211, 20)bull_col
bear_colcolorcolor.rgb(255, 82, 82, 20)bear_col
show_corboolfalseshow_cor
Show all 14 settings
SettingTypeDefaultVariable
Correction %int5correction
corr_colcolor#2195f32dcorr_col
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

WaveTrend 3D

by nersent
29 stars

WaveTrend 3D is a redesigned oscillator that implements the classic WaveTrend algorithm with kernel-based regression for trend reversal confirmation and multi-timeframe support. It calculates a smoothed oscillator line and displays a symmetrical three-dimensio

Indicator v5 Oscillators & momentumDivergence
Updated 1 year ago · Custom licence GitHub repository of WaveTrend 3D

Benso RSI

by benso87
24 stars

This indicator calculates a Relative Strength Index using Wilder or Cutler calculation methods, accompanied by an optional smoothing moving average and a signal line. Plotted in a separate pane, it features defined bull and bear control and critical threshold

Indicator v5 Oscillators & momentumDivergence
Updated 4 years ago · MPL-2.0 GitHub repository of Benso RSI

QFA Pro Elite Refined

by JasonTeixeira
11 stars

This indicator plots a smoothed fear index in a separate pane. It measures how far the current low sits below the highest close over a lookback, scales that reading by an ATR percentile, and smooths it with a zero-lag EMA. A volatility regime raises or lowers

Indicator v6 Oscillators & momentumVolatility & bands
Updated 5 weeks ago · Custom licence GitHub repository of QFA Pro Elite Refined

The indicator scores whether a counter-move against the dominant structure is maturing and whether price has started turning back. It plots a composite score in a separate pane from weighted context, correction maturity, and exhaustion, scaled by trigger and a

Indicator v6 TrendOscillators & momentum
Updated 4 weeks ago · MIT GitHub repository of Directional Probability Engine v2 [WavesUnchained]

VuManChu B Divergences

by jerryinyang
5 stars

VuManChu B Divergences is a momentum indicator that plots WaveTrend oscillator values and an MFI area in a separate pane. It calculates signals for long entries on bullish crosses below zero levels and short entries on bearish crosses above zero levels. The sc

Indicator v4 Oscillators & momentumSupport & resistance
Updated 2 years ago · None stated GitHub repository of VuManChu B Divergences

Oscillator Scaffold

by jpantsjoha
3 stars

The Oscillator Scaffold calculates an RSI value using the selected source and bar length. It plots the oscillator in a separate pane along with horizontal lines for overbought and oversold levels. The script fills the region between those levels and draws cond

Indicator v6 Oscillators & momentumSupport & resistance
Updated 7 weeks ago · Custom licence GitHub repository of Oscillator Scaffold

More Oscillators & momentum 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