1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
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.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Intrabar timeframe
timeframe
1
ltf
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.
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
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
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
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
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
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