Indicator · Pine Script v6 · Own pane

Intrabar Delta

by jayadevrana

Intrabar Delta estimates buying and selling volume within each chart bar by fetching lower timeframe OHLCV data.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code51
Settings1inputs
LicenceMPL-2.0
Last update4 days ago26 Oct 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

51 lines of Pine Script v6 from scripts/intrabar-delta.pine.txt, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

intrabar-delta.pine.txt
//@version=6
indicator("Intrabar Delta", overlay = false)

ltf = input.timeframe("1", "Intrabar timeframe")

[o, c, v] = request.security_lower_tf(syminfo.tickerid, ltf,
  [open, close, volume])

n = array.size(c)
float buyVol = 0.0
float sellVol = 0.0

if n > 0
    for i = 0 to n - 1
        vol = nz(array.get(v, i))
        oi = array.get(o, i)
        ci = array.get(c, i)
        if ci > oi
            buyVol += vol
        else if ci < oi
            sellVol += vol
        else
            buyVol += vol / 2
            sellVol += vol / 2

delta = n > 0 ? buyVol - sellVol : na
deltaCol = delta >= 0 ? color.teal : color.red
plot(delta, "Delta", deltaCol, style = plot.style_columns)
hline(0, "Zero", color.gray)

var float cvd = 0.0
if timeframe.change("D")
    cvd := 0.0
if not na(delta)
    cvd += delta
plot(n > 0 ? cvd : na, "Cumulative delta", color.orange, 2)

total = n > 0 ? array.sum(v) : na
fmt(float x) => str.tostring(x, format.volume)
var table panel = table.new(position.top_right, 2, 6,
  bgcolor = color.new(color.black, 15), border_width = 1,
  frame_width = 1, frame_color = color.gray)
if barstate.islast
    names = array.from("intrabars", "volume", "buy (est)",
      "sell (est)", "delta", "buy share")
    share = total > 0 ? str.tostring(100 * buyVol / total, "#") + "%" : "-"
    vals = array.from(str.tostring(n), fmt(total), fmt(buyVol),
      fmt(sellVol), fmt(delta), share)
    for i = 0 to 5
        table.cell(panel, 0, i, names.get(i), text_color = color.gray)
        table.cell(panel, 1, i, vals.get(i), text_color = color.white)

Overview

Intrabar Delta categorizes lower timeframe bars as bullish, bearish, or neutral to calculate buy and sell volume. The script plots the net intrabar volume delta as a teal or red histogram in a separate pane, alongside a daily cumulative volume delta line. A summary panel in the top-right corner displays detailed metrics, including total intrabar count, volume breakdown, net delta, and buy share percentage. Users can adjust the intrabar timeframe setting.

Details

Published by

jayadevrana on GitHub

Draws

Separate pane below the chart

Markets

Any symbol

Timeframes

M15-H1, H4 and above

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-tradingbacktestingema-crossoverpine-scriptpine-script-v6pinescriptrsitechnical-analysistrading-automationtrading-indicators

Settings

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

SettingTypeDefaultVariable
Intrabar timeframetimeframe1ltf
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

Oscillator Suite

by TamaraKGreen
46 stars

Oscillator Suite plots a normalised price oscillator in a separate pane and overlays a signal line that can use SMA, EMA, WMA, HMA, RMA, VWMA, T3, ZEMA, KAMA, or GKEMA. It marks bullish and bearish divergences, a smoothed money-flow series, confluence areas an

Indicator v5 Oscillators & momentumDivergence
Updated 8 weeks ago · None stated GitHub repository of Oscillator Suite

Relative Strength Table

by ChartsLector
41 stars

This indicator builds a table of relative strength for up to six user-chosen symbols against a benchmark, defaulting to SPY. It measures strength over four lookback periods, can average the visible periods, and can add relative volume as current volume divided

Indicator v6 Screeners & dashboardsVolume
Updated 4 days ago · None stated GitHub repository of Relative Strength Table

This indicator calculates the Relative Strength Index (RSI) alongside a simple moving average to generate directional momentum signals in a separate pane. It supports Break Flip and Break Continuous scanning modes for long and short setups. A wide array of opt

Indicator v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of Momentum Setup: RSI Direction Confirmation
11 stars

This indicator plots a smoothed Z-score of cumulative volume delta in a separate pane, showing whether buying or selling pressure is dominant and when the reading enters extreme zones. It marks spot accumulation, climax or exhaustion, and pivot-based price-vol

Indicator v6 Oscillators & momentumVolume Repaints
Updated 7 weeks ago · MIT GitHub repository of CVD Z-Score [NeuNue]

The Candle Pressure Index measures buying versus selling pressure from candle geometry and relative volume. Each bar combines close location, body ratio, and volume rank into a raw pressure value. An exponential moving average of that pressure forms the CPI os

Indicator v6 Oscillators & momentumVolume
Updated 3 days ago · MIT GitHub repository of Candle Pressure Index [WavesUnchained]

Nexural OrderFlow Matrix

by JasonTeixeira
9 stars

Nexural OrderFlow Matrix is an order flow visualization tool that plots a detailed heatmap table and stacked imbalance bars in a separate pane. It calculates volume metrics using lower timeframe volume delta data, displaying per-candle metrics such as Delta, D

Indicator v6 VolumeScreeners & dashboards
Updated 2 weeks ago · Custom licence GitHub repository of Nexural OrderFlow Matrix

More Volume 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