Indicator · Pine Script v6 · Own pane

Cumulative Volume Delta + VWAP + EMA & Volume OWI By ADK

by theonetrade

An indicator that calculates and plots Cumulative Volume Delta (CVD) as candlesticks in a separate pane.

View on GitHub

GitHub stars34on the repository
Pine versionv6current
Lines of code83
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

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

adk_cvd_mxwilY1g.pine
//@version=6
indicator("Cumulative Volume Delta + VWAP + EMA & Volume OWI By ADK", "ADK CVD", format=format.volume)

import TradingView/ta/12

anchorInput = input.timeframe("1D", "Anchor Period", group = "CVD Settings")
dataAggregationTooltip = "Defines how lower timeframe data is aggregated for the delta calculation. \"1 tick\" computes the delta on tick data and is available only on expert plans."
dataAggregationInput = input.string("Time", "Data Aggregation", options = ["Time", "1 tick"], tooltip = dataAggregationTooltip, group = "CVD Settings")
useTicks = dataAggregationInput == "1 tick"
lowerTimeframeTooltip = "The indicator scans lower timeframe data to approximate up and down volume used in the delta calculation. By default, the timeframe is chosen automatically. These inputs override this with a custom timeframe."
 + " \n\nHigher timeframes provide more historical data, but the data will be less precise."
useCustomTimeframeInput = input.bool(true, "Custom timeframe", tooltip = lowerTimeframeTooltip, active = not useTicks, group = "CVD Settings")
lowerTimeframeInput = input.timeframe("", "Timeframe", active = useCustomTimeframeInput and not useTicks, group = "CVD Settings")

var lowerTimeframe = switch
    useTicks                => "1T"
    useCustomTimeframeInput => lowerTimeframeInput
    timeframe.isseconds     => "1S"
    timeframe.isintraday    => "1"
    timeframe.isdaily       => "5"
    => "60"

[openVolume, maxVolume, minVolume, lastVolume] = ta.requestVolumeDelta(lowerTimeframe, anchorInput)

col = lastVolume >= openVolume ? color.blue : color.red
hline(0)
plotcandle(openVolume, maxVolume, minVolume, lastVolume, "CVD", color = col, bordercolor = col, wickcolor = col)

newSession = timeframe.change("1D")

// ──────────────── CVD VWAP (हमेशा daily session-reset — यही practical/useful hai) ────────────────
showCvdVwapInput = input.bool(false, "Show CVD VWAP", group = "CVD VWAP")

var float vwapNumSession = 0.0
var float vwapDenSession = 0.0
if newSession
    vwapNumSession := 0.0
    vwapDenSession := 0.0
if not na(lastVolume) and not na(volume)
    vwapNumSession += lastVolume * volume
    vwapDenSession += volume
cvdVwap = vwapDenSession > 0 ? vwapNumSession / vwapDenSession : na

plot(showCvdVwapInput ? cvdVwap : na, "CVD VWAP", color = color.new(color.black, 0), linewidth = 2)

// ──────────────── CVD EMA (हमेशा continuous — ta.ema khud hi short-memory hai, reset ki zaroorat nahi) ────────────────
showMaInput = input.bool(false, "Show CVD EMA", group = "CVD EMA")
maLengthInput = input.int(20, "EMA Length", minval = 1, group = "CVD EMA")

cvdEma = ta.ema(lastVolume, maLengthInput)

plot(showMaInput ? cvdEma : na, "CVD EMA", color = color.new(color.fuchsia, 0), linewidth = 1)

var cumVol = 0.
cumVol += nz(volume)
deltaIsNa = na(openVolume) and na(maxVolume) and na(minVolume) and na(lastVolume)
if barstate.islast
    if cumVol == 0
        runtime.error("The data vendor doesn't provide volume data for this symbol.")
    if str.endswith(lowerTimeframe, "T") and deltaIsNa
        runtime.error("Not enough tick depth for the current anchor period. The available tick depth ends before reaching the start of the anchor period (" + anchorInput + "). Please shorten the 'Anchor period' input or switch the calculation base from '1 Tick' to 'Time' or higher custom timeframe.")
        
// ==================== VOWI SECTION ====================
showVOWI = input.bool(false,  "Show Vol-OWI", group = "VOWI Settings")
smaLength     = input.int(20, "SMA Length", group = "VOWI Settings")
useTimeFilter = input.bool(true, "Enable Time Filter", group = "VOWI Settings")
startHour     = input.int(9,  "Start Hour (ET)", group = "VOWI Settings")
startMinute   = input.int(45, "Start Minute (ET)", group = "VOWI Settings")
endHour       = input.int(16, "End Hour (ET)", group = "VOWI Settings")
endMinute     = input.int(15, "End Minute (ET)", group = "VOWI Settings")

// Volume calculations
buyVolume  = high == low ? 0.0 : volume * (close - low) / (high - low)
sellVolume = high == low ? 0.0 : volume * (high - close) / (high - low)

// Time filter
startTime      = timestamp("America/New_York", year, month, dayofmonth, startHour, startMinute)
endTime        = timestamp("America/New_York", year, month, dayofmonth, endHour, endMinute)
isUSMarketTime = time >= startTime and time <= endTime

// Plot volume columns (only when showVOWI is true)
plot(showVOWI ? volume     : na, "SELL V", color = color.red,   style = plot.style_columns)
plot(showVOWI ? buyVolume  : na, "BUY V",  color = color.green, style = plot.style_columns)

Overview

Cumulative Volume Delta + VWAP + EMA & Volume OWI By ADK aggregates lower-timeframe or tick volume data over a customizable anchor period. Users can optionally display a volume-weighted CVD VWAP with daily session resets, an exponential moving average of the CVD, and volume OWI metrics. Input controls allow tweaking data aggregation modes, manual timeframe overrides, and session time filters.

Details

Published by

theonetrade on GitHub

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
Anchor Periodtimeframe1DanchorInput
Data AggregationstringTimedataAggregationInput
Custom timeframebooltrueuseCustomTimeframeInput
TimeframetimeframelowerTimeframeInput
Show CVD VWAPboolfalseshowCvdVwapInput
Show CVD EMAboolfalseshowMaInput
EMA Lengthint20maLengthInput
Show Vol-OWIboolfalseshowVOWI
SMA Lengthint20smaLength
Enable Time FilterbooltrueuseTimeFilter
Start Hour (ET)int9startHour
Start Minute (ET)int45startMinute
Show all 14 settings
SettingTypeDefaultVariable
End Hour (ET)int16endHour
End Minute (ET)int15endMinute
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

[TVT] OBV with EMA

by namuan
321 stars

Calculates On-Balance Volume (OBV) alongside two Exponential Moving Averages (EMAs) applied directly to the cumulative OBV line. The indicator tracks volume flow relative to price movement and smooths it using short-term and longer-term EMAs to highlight volum

Indicator v6 VolumeOscillators & momentum
Updated 8 days ago · MIT GitHub repository of [TVT] OBV with EMA

Aggregate Signal (v.2)

by capissimo
114 stars

Aggregate Signal (v.2) is an oscillator indicator that combines multiple technical factors into a single composite score. It scales OHLCV data using minimax normalization and evaluates indicators such as MACD, RSI, Stochastic, CCI, Momentum, On-Balance Volume,

Indicator v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of Aggregate Signal (v.2)

Volume-Weighted MACD

by mihakralj
99 stars

This indicator plots a volume-weighted MACD in a separate pane. It subtracts a slow volume-weighted moving average of close from a faster one, then smooths that line with an exponential moving average to form the signal. A column histogram shows the gap betwee

Indicator v5 Oscillators & momentumMoving averages
Updated 8 weeks ago · Apache-2.0 GitHub repository of Volume-Weighted MACD

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

RSI-VWMA

by Zettt
43 stars

This indicator calculates the Relative Strength Index using a volume-weighted moving average of the closing price as its source. It plots the resulting oscillator in a separate pane alongside configurable overbought and oversold threshold lines. The plot line

Indicator v4 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of RSI-VWMA

Trap Shorts - Hamza Naveed

by ProfHamzaNaveed
43 stars

This indicator tracks and visualizes cryptocurrency net positioning across multiple derivative exchanges, including Binance, BitMEX, and Kraken. It calculates aggregated net longs, net shorts, net delta, and ratio metrics, or an optional Position RSI, renderin

Indicator v5 VolumeOscillators & momentum
Updated 10 months ago · None stated GitHub repository of Trap Shorts - Hamza Naveed

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