Indicator · Pine Script v5 · Own pane

Intraday Intensity Modes

by regalouisei· code credited to allanster on TradingView

Intraday Intensity Modes calculates David Bostian's Intraday Intensity Index with multiple calculation variations.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code93
Settings12inputs
LicenceNone statedfile: MPL-2.0
Last update8 months ago25 Feb 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

93 lines of Pine Script v5 from pinescript/editors_picks/intraday-intensity-modes.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

intraday-intensity-modes.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © allanster on TradingView

//@version=5
// Original concept by David Bostian, with variations featured in "Bollinger on Bollinger Bands".
indicator("Intraday Intensity Modes", 'Intensity')

toolTipA  = 'III (Individual):\nOsc Length 1\n[   ] Cumulative (Off)\n[   ] Normalized (Off)\n[   ] Inverse Volu' +
 'me (Off)\n[   ] Show Levels (Off)\n\n'
toolTipB  = 'II  (Cumulative):\nOsc Length 1\n[✓] Cumulative (On)\n[   ] Normalized (Off)\n[   ] Inverse Volume ' +
 '(Off)\n[   ] Show Levels (Off)\n\n'
toolTipC  = 'II% (Oscillator):\nOsc Length 21\n[   ] Cumulative (Off)\n[✓] Normalized (On)\n[   ] Inverse Volume' +
 ' (Off)\n[✓] Show Levels (On)'
toolTipD  = 'Enables examination of intensity per bar instead of per day, this is a departure from the original ' +
 'concept. Whenever this setting is enabled the indicator should be regarded as operating in an experimental mode.'
toolTipV  = '[   ] Inverse Volume (Off):\n\n   (2 * close - high - low) * volume\n ────────────────\n           ' +
 '         high - low\n\n\n[✓] Inverse Volume (On):\n\n            2 * close - high - low\n          ───────────' +
 '\n            (high - low) * volume'

i_length  = input.int  (21,         'Osc Length',     minval = 1, tooltip = toolTipA + toolTipB + toolTipC)
i_cumltv  = input.bool (false,      'Cumulative')
i_normal  = input.bool (true,       'Normalized')
i_candle  = input.bool (false,      'Intrabar',                   tooltip = toolTipD)
i_invert  = input.bool (false,      'Inverse Volume',             tooltip = toolTipV)
i_colrUp  = input.color(#00BCD4,  'Colors For Up',                                             inline = 'a')
i_colrDn  = input.color(#E040FB,  'Down',                                                      inline = 'a')
i_styles  = input.string('Columns', 'Style & Width', options = ['Columns', 'Histogram', 'Line'], inline = 'b')
i_widths  = input.int  (1,          '',               minval = 1,                                inline = 'b')
i_shoLvl  = input.bool (true,       '',                                                          inline = 'c')
i_levelH  = input.int  (25,         'Show Levels Above',                                         inline = 'c')
i_levelL  = input.int  (-25,        'Below',                                                     inline = 'c')

id_cum(source) => // perform cumulative sum once per day when using realtime intraday source values
    var carrySum  = float(na)
    var dailySum  = float(na)
    if not timeframe.isintraday
        carrySum := ta.cum(nz(source))
    else
        dailySum := timeframe.change('D') ? nz(carrySum) : nz(dailySum)
        carrySum := nz(dailySum) + nz(source)

altSum(source, length) => normal = math.sum(nz(source), length) // treat na as 0 and return sum

var idRangeH = float(na)
var idRangeL = float(na)
var idVolume = float(na)
startDay  = timeframe.change('D')
idRangeH := not timeframe.isintraday or startDay ?   high : high > nz(idRangeH)        ? high : idRangeH // intraday high
idRangeL := not timeframe.isintraday or startDay ?    low :  low < nz(idRangeL, 10e99) ?  low : idRangeL // intraday low
idVolume := not timeframe.isintraday or startDay ? volume : nz(idVolume) + volume                        // intraday volume
idUseVol  = i_invert ? 1 / idVolume : idVolume
iiiValue  = nz(((2 * close - idRangeH - idRangeL) / (idRangeH - idRangeL)) * idUseVol)                   // intraday intensity

use_iii   = i_invert ?
 (2 * close - high - low) / ((high - low) * volume) :
 ((2 * close - high - low) / (high - low)) * volume

usePrcnt = i_normal ? 100 : 1

iiSource = 
 usePrcnt * altSum(i_cumltv ? i_candle ? ta.cum(nz(use_iii)) : id_cum(iiiValue) : i_candle ? nz(use_iii) : iiiValue, i_length) / 
 (i_normal ? altSum(i_cumltv ? i_candle ? ta.cum(volume) : id_cum(idVolume) : i_candle ? volume : idVolume, i_length) : 1)

colrSign = altSum(i_candle ? use_iii : iiiValue, i_length) / (i_normal ? i_candle ? volume : altSum(idVolume, i_length) : 1)
pltStyle = i_styles == 'Columns' ? plot.style_columns : i_styles == 'Histogram' ? plot.style_histogram : plot.style_line
plot(iiSource, 'III, II, or II%', math.sign(colrSign) != -1 ? i_colrUp : i_colrDn, i_widths, pltStyle)

plot(startDay ? 1 : 0, 'startDay', #ffff00, display = display.data_window)
plot(close,    'close',            #ffff00, display = display.data_window)

plot(high,     'high',             #ffff00, display = display.data_window)
plot(low,      'low',              #ffff00, display = display.data_window)
plot(volume,   'volume',           #ffff00, display = display.data_window)

plot(idRangeH, 'idRangeH',         #ffff00, display = display.data_window)
plot(idRangeL, 'idRangeL',         #ffff00, display = display.data_window)
plot(idVolume, 'idVolume',         #ffff00, display = display.data_window)

plot(iiiValue, 'iiiValue',         #ffff00, display = display.data_window)
plot(iiSource, 'iiSource',         #ffff00, display = display.data_window)

hline(i_shoLvl ? i_levelH : na)
hline(i_shoLvl ? i_levelL : na)

// Reference Equations Used For Normal Volume
// III = (((2 * close) - high - low) / (high - low)) * volume
// II  = ta.cum((((2 * close) - high - low) / ((high - low)) * volume)
// II% = 100 * math.sum((((2 * close) - high - low) / ((high - low)) * volume, 21) / math.sum(volume, 21)

// Reference Equations Used For Inverted Volume
// III = ((2 * close) - high - low) / ((high - low) * volume)
// II  = ta.cum(((2 * close) - high - low) / ((high - low) * volume))
// II% = 100 * math.sum(((2 * close) - high - low) / ((high - low) * volume), 21) / math.sum(volume, 21)

Overview

Intraday Intensity Modes evaluates price positioning within the high-low range relative to volume, offering cumulative, normalized oscillator, and inverse volume options. The indicator plots in a separate pane as columns, a histogram, or a line along with threshold levels. Settings adjust the oscillator length, cumulative accumulation, normalization, and visual styles, including an experimental intrabar intensity calculation mode.

Details

Published by

regalouisei on GitHub

Code credit

allanster on TradingView, as written in the script's header

Type

Indicator, Pine Script v5

Draws

Separate pane below the chart

Category

Volume, Oscillators & momentum

Markets

Any symbol

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
Osc Lengthint21i_length
Cumulativeboolfalsei_cumltv
Normalizedbooltruei_normal
Intrabarboolfalsei_candle
Inverse Volumeboolfalsei_invert
Colors For Upcolor#00BCD4i_colrUp
Downcolor#E040FBi_colrDn
Style & WidthstringColumnsi_styles
i_widthsint1i_widths
i_shoLvlbooltruei_shoLvl
Show Levels Aboveint25i_levelH
Belowint-25i_levelL
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

Money Flow Index

by everget
948 stars

Calculates the standard Money Flow Index (MFI) oscillator alongside an exponential moving average signal line in a separate pane. The script visually highlights trend conditions through dynamic ribbon filling, optional difference histogram bars, and overbought

Indicator v4 Oscillators & momentumVolume
Updated 10 days ago · GPL-3.0 GitHub repository of Money Flow Index

Commitment Gauge

by harryguiacorn
219 stars

This indicator measures directional momentum by evaluating candlestick body proportions and volume over a user-defined lookback window. It computes the ratio of candle body to total range, weights the cumulative value by volume and absolute body size, and dete

Indicator v4 VolumeCandlestick patterns
Updated 1 year ago · None stated GitHub repository of Commitment Gauge

Aggregate Signal

by capissimo
114 stars

This indicator builds an aggregate oscillator in a separate pane. It scales open, high, low, close, and volume into a 0 to 1 range, then averages scaled readings from MACD, a MACD histogram, RSI, stochastic, CCI, momentum, OBV, a directional index, volume-weig

Indicator v4 Oscillators & momentumVolume Repaints
Updated 1 year ago · None stated GitHub repository of Aggregate Signal

This indicator calculates the Bill Williams Market Facilitation Index as the high-low range divided by volume, or zero when volume is zero. It compares the index and volume with the previous bar and assigns one of four zones: green for both rising, fade for bo

Indicator v6 VolumeOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Bill Williams Market Facilitation Index

PPO ATR Bands

by cryptorife
75 stars

PPO ATR Bands plots a percentage price oscillator in a separate pane. It compares a Hull average of typical price with a volume-weighted exponential average of Parabolic SAR, then scales three true-range bands around the slow average into matching oscillator l

Indicator v4 Oscillators & momentumMoving averages
Updated 3 years ago · GPL-3.0 GitHub repository of PPO ATR Bands

Chaikin Oscillator

by be-thomas
65 stars

Calculates the Chaikin Oscillator by taking the difference between a fast exponential moving average and a slow exponential moving average of the Accumulation/Distribution line. It plots the resulting line in a separate pane alongside a dashed zero reference l

Indicator v4 Oscillators & momentumVolume
Updated 4 days ago · GPL-3.0 GitHub repository of Chaikin Oscillator

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