Strategy · Pine Script v6 · On the chart

VCP probe 05 - cumulative vol delta

by pineforge-4pass· code credited to PineForge contributors 2026

This strategy calculates synthetic buy and sell volume from candlestick price action and computes a ten-bar rolling cumulative volume delta.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code54
Settings0inputs
LicenceApache-2.0
Last update5 days ago23 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 strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

54 lines of Pine Script v6 from validation/composite-vcp-cumulative-volume-delta-01/strategy.pine, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.

strategy.pine
// This Pine Script® code is licensed under Apache-2.0
// SPDX-License-Identifier: Apache-2.0
// © PineForge contributors 2026
//
// VCP probe 05 — candle-position volume delta + cumulative sum
//
// Purpose: isolate the cumulative-volume-delta half of the VCP integration
// probe family. That family synthesises buy/sell volume from candle position
// with a tiny
// epsilon in the denominator (``high - low + 0.0001``) to avoid
// division-by-zero on doji bars, computes the per-bar delta, and
// then runs a 10-bar rolling ``math.sum`` on top. ``cumDelta`` then
// gates ``volumeBullish`` / ``volumeBearish`` (which feed the volume
// confluence). Two candidate sources of TV/engine drift here:
//   (1) the doji-epsilon arithmetic on bars where ``high == low``
//       (extremely rare on ETH 15m but possible);
//   (2) the rolling ``math.sum`` window precision over 10 bars.
//
// This probe routes a trivial entry/exit through ONLY the cumulative
// delta. Any TV/engine drift here is attributable to candle-position
// buy/sell synthesis and the 10-bar ``math.sum``, NOT to VCP's other
// filters.
//
// Trade shape: long-only, pyramiding=1. Enter long on cumDelta crossing
// ABOVE zero (was <= 0 last bar, > 0 this bar). Close on cumDelta
// crossing BELOW zero.
//
// TV setup: 15m chart, ETH-USDT-USDT, same window as
// data/ohlcv_ETH-USDT-USDT_15m.csv. Export the trade list to trades.csv
// in this folder.
//@version=6
strategy("VCP probe 05 - cumulative vol delta", shorttitle="VCP_p05",
     overlay=true, initial_capital=1000000,
     commission_type=strategy.commission.percent, commission_value=0,
     slippage=0, default_qty_type=strategy.fixed, default_qty_value=1,
     pyramiding=1, process_orders_on_close=false)

// ---- buy/sell volume — IDENTICAL to VCP (incl. 0.0001 epsilon) ----
float buyVolume  = close > open ? volume : volume * (close - low) / (high - low + 0.0001)
float sellVolume = close < open ? volume : volume * (high - close) / (high - low + 0.0001)
float volumeDelta = buyVolume - sellVolume

// ---- 10-bar cumulative delta (matches VCP line 309) ----------------
float cumDelta = math.sum(volumeDelta, 10)

bool crossUp   = cumDelta > 0 and cumDelta[1] <= 0
bool crossDown = cumDelta < 0 and cumDelta[1] >= 0

// ---- trivial entry / exit ------------------------------------------
if crossUp and strategy.position_size == 0
    strategy.entry("L", strategy.long, qty=1, comment="cumDelta cross-up")

if crossDown and strategy.position_size > 0
    strategy.close("L", comment="cumDelta cross-down exit")

Overview

VCP probe 05 - cumulative vol delta signals long entries with a fixed position size of one unit when the cumulative delta crosses above zero, and closes open positions when it crosses below zero. The script executes directly on the main price chart and includes no user-configurable input settings. As a validation probe, it trades strictly long, provides no stop loss or take profit mechanisms, and lacks broader trade filters.

Details

Published by

pineforge-4pass on GitHub

Code credit

PineForge contributors 2026, as written in the script's header

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Volume, Oscillators & momentum

Markets

Crypto

Timeframes

M15-H1

Risk Notes

  • The strategy enters trades without a stop loss

Topics

algorithmic-tradingbacktestingparitypine-scriptpinescriptquantitative-financetest-corpustradingview

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

106 stars

This strategy enters long on an outside bar when the candle is bullish, the Klinger Volume Oscillator is positive, and price is above a Hull moving average. It enters short on an inside bar when the candle is bearish, the oscillator is negative, and price is b

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Advanced OutSide Forex strategy
105 stars

This overlay strategy looks for gold scalps from break of structure and change of character. It enters long when a bullish break, a bullish character change, and an optional volume filter align, and short on the opposite set. Optional RSI levels can block trad

Strategy v6 SMC / ICT / price actionOscillators & momentum Repaints

CombinedBinHAndClucV8

by viktors1982
36 stars

This strategy trades on the price chart using multiple indicators. It enters long positions when price dips meet conditions on Bollinger Bands 40 and 20, RSI, MFI, volume and other thresholds. It exits at custom ROI profit levels based on RSI or after timeout

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of CombinedBinHAndClucV8
13 stars

The Ruckard Cuneyt OBVRSI A002 strategy combines On-Balance Volume (OBV) and Relative Strength Index (RSI) thresholds to generate trade entries, DCA rebuys, and exits. Built primarily for crypto automation via Zignaly webhooks, it opens positions when OBV RSI

Strategy v5 Oscillators & momentumVolume
Updated 1 year ago · None stated GitHub repository of Ruckard Cuneyt OBVRSI A002
12 stars

This strategy plots on the price chart and looks for three-candle fair value gaps and inverse gaps on Bitcoin. It enters long when a wide enough bullish gap appears in an uptrend with RSI above 30 and volume above its average, and short on the opposite bearish

Strategy v6 SMC / ICT / price actionTrend Repaints
Updated 4 months ago · None stated GitHub repository of BTC 4h FVG/iFVG Strategy

Combined Strategy

by Dropio12
7 stars

This strategy plots buy and sell markers on the price chart by combining a fast and slow ALMA crossover with a simple close-to-close momentum check. A long marker appears when the fast ALMA crosses above the slow ALMA and momentum is positive. A short marker a

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Combined Strategy

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers