This indicator displays cumulative volume delta in candle form. It uses intrabar information to obtain more precise volume delta information than methods using only the chart's timeframe.
█ CONCEPTS
Bar polarity
By [I]bar polarity, we mean the direction of a bar, which is determined by looking at the bar's close vs its open.
Intrabars
[I]Intrabars are chart bars at a lower timeframe than the chart's. Each 1H chart bar of a 24x7 market will, for example, usually contain 60 bars at the lower timeframe of 1min, provided there was market activity during each minute of the hour. Mining information from intrabars can be useful in that it offers traders visibility on the activity inside a chart bar.
Lower timeframes (LTFs)
A [I]lower timeframe is a timeframe that is smaller than the chart's timeframe. This script uses a LTF to access intrabars. The lower the LTF, the more intrabars are analyzed, but the less chart bars can display CVD information because there is a limit to the total number of intrabars that can be analyzed.
Volume delta
The volume delta concept divides a bar's volume in "up" and "down" volumes. The delta is calculated by subtracting down volume from up volume. Many calculation techniques exist to isolate up and down volume within a bar. The simplest techniques use the polarity of interbar price changes to assign their volume to up or down slots, e.g., On Balance Volume or the Klinger Oscillator. Others such as Chaikin Money Flow use assumptions based on a bar's OHLC values. The most precise calculation method uses tick data and assigns the volume of each tick to the up or down slot depending on whether the transaction occurs at the bid or ask price. While this technique is ideal, it requires huge amounts of data on historical bars, which usually limits the historical depth of charts and the number of symbols for which tick data is available.
This indicator uses intrabar analysis to achieve a compromise between the simplest and most precise methods of calculating volume delta. In the context where historical tick data is not yet available on TradingView, intrabar analysis is the most precise technique to calculate volume delta on historical bars on our charts. Our Volume Profile indicators use it. Other volume delta indicators in our Community Scripts such as the Realtime 5D Profile use realtime chart updates to achieve more precise volume delta calculations, but that method cannot be used on historical bars, so those indicators only work in real time.
This is the logic we use to assign intrabar volume to up or down slots:
• If the intrabar's open and close values are different, their relative position is used.
• If the intrabar's open and close values are the same, the difference between the intrabar's close and the previous intrabar's close is used.
• As a last resort, when there is no movement during an intrabar and it closes at the same price as the previous intrabar, the last known polarity is used.
Assistant
User
magyarul
Assistant
Once all intrabars making up a chart bar have been analyzed and the up or down property of each intrabar's volume determined, the up volumes are added and the down volumes subtracted. The resulting value is volume delta for that chart bar.
█ FEATURES
CVD Candles
Cumulative Volume Delta Candles present volume delta information as it evolves during a period of time.
This is how each candle's levels are calculated:
• open: Each candle's' open level is the cumulative volume delta for the current period at the start of the bar.
This value becomes zero on the first candle following a CVD reset.
The candles after the first one always open where the previous candle closed.
The candle's high, low and close levels are then calculated by adding or subtracting a volume value to the open.
• high: The highest volume delta value found in intrabars. If it is not higher than the volume delta for the bar, then that candle will have no upper wick.
• low: The lowest volume delta value found in intrabars. If it is not lower than the volume delta for the bar, then that candle will have no lower wick.
• close: The aggregated volume delta for all intrabars. If volume delta is positive for the chart bar, then the candle's close will be higher than its open, and vice versa.
The candles are plotted in one of two configurable colors, depending on the polarity of volume delta for the bar.
CVD resets
The "cumulative" part of the indicator's name stems from the fact that calculations accumulate during a period of time. This allows you to analyze the progression of volume delta across manageable chunks, which is often more useful than looking at volume delta cumulated from the beginning of a chart's history.
You can configure the reset period using the "CVD Resets" input, which offers the following selections:
• None: Calculations do not reset.
• On a fixed higher timeframe: Calculations reset on the higher timeframe you select in the "Fixed higher timeframe" field.
• At a fixed time that you specify.
• At the beginning of the regular session.
• On a stepped higher timeframe: Calculations reset on a higher timeframe automatically stepped using the chart's timeframe and following these rules:
Pine Script®
Chart TF HTF
code
< 1min 1H
< 3H 1D
<= 12H 1W
< 1W 1M
>= 1W 1Y
Expand 2 lines
The indicator's background shows where resets occur.
Intrabar precision
The precision of calculations increases with the number of intrabars analyzed for each chart bar. It is controlled through the script's "Intrabar precision" input, which offers the following selections:
• Least precise, covering many chart bars
• Less precise, covering some chart bars
• More precise, covering less chart bars
• Most precise, 1min intrabars
As there is a limit to the number of intrabars that can be analyzed by a script, a tradeoff occurs between the number of intrabars analyzed per chart bar and the chart bars for which calculations are possible.
Total volume candles
You can choose to display candles showing the total intrabar volume for the chart bar. This provides you with more context to evaluate a bar's volume delta by showing it relative to the sum of intrabar volume. Note that because of the reasons explained in the "NOTES" section further down, the total volume is the sum of all intrabar volume rather than the volume of the bar at the chart's timeframe.
Total volume candles can be configured with their own up and down colors. You can also control the opacity of their bodies to make them more or less prominent. This publication's chart shows the indicator with total volume candles. They are turned off by default, so you will need to choose to display them in the script's inputs for them to plot.
Divergences
Divergences occur when the polarity of volume delta does not match that of the chart bar. You can identify divergences by coloring the CVD candles differently for them, or by coloring the indicator's background.
Information box
An information box in the lower-left corner of the indicator displays the HTF used for resets, the LTF used for intrabars, and the average quantity of intrabars per chart bar. You can hide the box using the script's inputs.
█ INTERPRETATION
The first thing to look at when analyzing CVD candles is the side of the zero line they are on, as this tells you if CVD is generally bullish or bearish. Next, one should consider the relative position of successive candles, just as you would with a price chart. Are successive candles trending up, down, or stagnating? Keep in mind that whatever trend you identify must be considered in the context of where it appears with regards to the zero line; an uptrend in a negative CVD (below the zero line) may not be as powerful as one taking place in positive CVD values, but it may also predate a movement into positive CVD territory. The same goes with stagnation; a trader in a long position will find stagnation in positive CVD territory less worrisome than stagnation under the zero line.
After consideration of the bigger picture, one can drill down into the details. Exactly what you are looking for in markets will, of course, depend on your trading methodology, but you may find it useful to:
• Evaluate volume delta for the bar in relation to price movement for that bar.
• Evaluate the proportion that volume delta represents of total volume.
• Notice divergences and if the chart's candle shape confirms a hesitation point, as a Doji would.
• Evaluate if the progress of CVD candles correlates with that of chart bars.
• Analyze the wicks. As with price candles, long wicks tend to indicate weakness.
Always keep in mind that unless you have chosen not to reset it, your CVD resets for each period, whether it is fixed or automatically stepped. Consequently, any trend from the preceding period must re-establish itself in the next.
█ NOTES
Know your volume
Traders using volume information should understand the volume data they are using: where it originates and what transactions it includes, as this can vary with instruments, sectors, exchanges, timeframes, and between historical and realtime bars. The information used to build a chart's bars and display volume comes from data providers (exchanges, brokers, etc.) who often maintain distinct feeds for intraday and end-of-day (EOD) timeframes. How volume data is assembled for the two feeds depends on how instruments are traded in that sector and/or the volume reporting policy for each feed. Instruments from crypto and forex markets, for example, will often display similar volume on both feeds. Stocks will often display variations because block trades or other types of trades may not be included in their intraday volume data. Futures will also typically display variations.
Note that as intraday vs EOD variations exist for historical bars on some instruments, differences may also exist between the realtime feeds used on intraday vs 1D or greater timeframes for those same assets. Realtime reporting rules will often be different from historical feed reporting rules, so variations between realtime feeds will often be different from the variations between historical feeds for the same instrument. The Volume X-ray indicator can help you analyze differences between intraday and EOD volumes for the instruments you trade.
If every unit of volume is both bought by a buyer and sold by a seller, how can volume delta make sense?
Traders who do not understand the mechanics of matching engines (the exchange software that matches orders from buyers and sellers) sometimes argue that the concept of volume delta is flawed, as every unit of volume is both bought and sold. While they are rigorously correct in stating that every unit of volume is both bought and sold, they overlook the fact that information can be mined by analyzing variations in the price of successive ticks, or in our case, intrabars.
Our calculations model the situation where, in fully automated order handling, market orders are generally matched to limit orders sitting in the order book. Buy market orders are matched to quotes at the ask level and sell market orders are matched to quotes at the bid level. As explained earlier, we use the same logic when comparing intrabar prices. While using intrabar analysis does not produce results as precise as when individual transactions — or ticks — are analyzed, results are much more precise than those of methods using only chart prices.
Not only does the concept underlying volume delta make sense, it provides a window on an oft-overlooked variable which, with price and time, is the only basic information representing market activity. Furthermore, because the calculation of volume delta also uses price and time variations, one could conceivably surmise that it can provide a more complete model than ones using price and time only. Whether or not volume delta can be useful in your trading practice, as usual, is for you to decide, as each trader's methodology is different.
For Pine Script™ coders
As our latest Polarity Divergences publication, this script uses the recently released request.security_lower_tf() Pine Script™ function discussed in this blog post. It works differently from the usual request.security() in that it can only be used at LTFs, and it returns an array containing one value per intrabar. This makes it much easier for programmers to access intrabar information.
Look first. Then leap.
Jun 12, 2022
Release Notes
v2
• Added a selection of resets on a fixed time or at the beginning of regular sessions.
• Added a selection for the lower timeframe that always uses the greatest amount of detail, i.e., 1min intrabars.
Jul 11, 2022
Release Notes
v3
• Added a new reset mode: "At the first visible chart bar". As you scroll or zoom your chart, it will reset the cumulative count at the leftmost visible bar.
• You can now change the color of the information box.
Sep 20, 2022
Release Notes
v4
• Added an optional line that plots the close of the candles. You can use it instead of the candles.
• Added an optional MA of the close of the candles, which will reset when CVD resets.
• Added more choices for the intrabar precision selection.
• You can now disable the plotting of the zero line, which can be helpful when CVD does not reset and values get quite large.
Oct 19, 2022
Release Notes
v5
• Additional LTF selections were added for 2min intrabars and 250 intrabars.
• You can now choose to calculate volume delta as a percentage of the bar's total volume. This can provide a useful perspective on volume delta.
You will not be able to display total volume candles when using this new calculation mode.
• Resets can now be calculated on Supertrend or Aroon trend changes. This can help you assess if VD is confirming the trend.
An up or down arrow is displayed on trend changes, to indicate the trend's direction.
• A warning now appears in the information box when an average of less that 5 intrabars is detected,
to remind you that calculations are then less reliable.
Nov 19, 2022
Release Notes
v6
• Added Parabolic SAR as one of the trends available when resetting on trend changes.
• Added information on the quantity of chart bars covered by the script's calculations in the information box.
Mar 25, 2023
Release Notes
v7
This indicator was updated to include version 4 of the lower_tf library, which now supports seconds-based timeframes.
We've adjusted the stepped LTF calculation for "Less/More Precise" intrabar precision options according to the following table: Magyerul
It looks like you've posted a detailed description of a Cumulative Volume Delta (CVD) Candles indicator with intrabar precision, its concepts, features, interpretation, notes, and some implementation details in Pine Script™ (TradingView scripting language). This indicator appears to provide volume delta analysis at a higher precision than just using chart bars by leveraging intrabar data from lower timeframes.
If you want help with this indicator, here are some ways I can assist:
Explain the concepts in simpler terms
Help write or improve Pine Script™ code for this indicator
Help understand how to interpret the indicator outputs in your trading
Help configure the indicator inputs and parameters for best usage
Debug Pine Script code if you have it
Help create alerts or signals based on the CVD candles
Compare this method with other volume delta approaches
Example Simplified Explanation of Key Concepts
Volume Delta = (Volume on upward price movement) - (Volume on downward price movement) within a bar
Calculated here by splitting each chart bar into many smaller "intrabar" bars from a lower timeframe.
Each intrabar's volume is classified as up or down based on price moves inside the bar.
These are summed to get volume delta per chart bar, showing whether buyers or sellers dominated that bar.
Then Cumulative Volume Delta (CVD) tracks this volume delta cumulatively across bars, resettable by user.
The CVD is displayed as custom candles showing open, high, low, close volume delta levels for each bar period.
You get more precise and detailed volume sentiment info than just bar close/open volume data.
You might want to ask me for:
A Pine Script example implementing this technique — using request.security_lower_tf() for intrabar data, handling volume delta calculations, candle drawing, and resets.
Interpretation tips — e.g., how to use CVD candles in trending markets, spotting divergences, combining with price action.
Configuration advice — best lower timeframes, reset interval recommendations, visual settings for volumes, opacity, colors.
Specific questions on any part of your description — e.g., "What does 'stepped higher timeframe reset' mean?", "How is polarity assigned in ties?", "Why would I use total volume candles?".
How about I provide you an initial Pine Script code snippet that does volume delta calculation at 1min lower timeframe intrabars, computes cumulative delta with a reset option, and plots custom volume delta candles?
pine
//@version=5
indicator("CVD Candles - Intrabar Volume Delta", overlay=true)
// User inputs
chart_tf = timeframe.period
lower_tf = input.timeframe("1", "Lower Timeframe (Intrabars)")
// Reset options - only simple example here
reset_on_new_session = input.bool(true, "Reset CVD on New Session")
// Request intrabar data
[intrabar_close] = request.security_lower_tf(syminfo.tickerid, lower_tf, [close])
[volumes] = request.security_lower_tf(syminfo.tickerid, lower_tf, [volume])
[intrabar_open] = request.security_lower_tf(syminfo.tickerid, lower_tf, [open])
// Calculate intrabar polarities and volume delta
var int last_polarity = 0
var float up_volume = 0.0
var float down_volume = 0.0
// We get arrays of intrabar closes, opens, volumes for all intrabars in current chart bar
// intrabar_close, intrabar_open, volumes are arrays
// Function to assign polarity per intrabar
// 1: up volume, -1: down volume
polarity(intra_open, intra_close, last_close) =>
if intra_open != intra_close
intra_close > intra_open ? 1 : -1
else
diff = intra_close - last_close
if diff != 0
diff > 0 ? 1 : -1
else
last_polarity
var float bar_delta = 0.0
last_close_value = na
last_polarity := 0
// Iterate intrabars to get delta sums
for i = 0 to array.size(intrabar_close) - 1
o = array.get(intrabar_open, i)
c = array.get(intrabar_close, i)
v = array.get(volumes, i)
pol = polarity(o, c, last_close_value)
last_polarity := pol
last_close_value := c
bar_delta += v * pol
// Cumulative delta with reset on session
var float cum_delta = 0.0
if reset_on_new_session and ta.change(time("D"))
cum_delta := 0
cum_delta += bar_delta
// Plot custom candle - open, close, high low
// Here we'd have to track intrabar extremes for high/low delta if needed (simplified: not done)
// Plotting a histogram bar instead (simplified example)
plot(cum_delta, title="Cumulative Volume Delta", color=(cum_delta >= 0 ? color.green : color.red))
This is a very rudimentary demo to show how you might use request.security_lower_tf to get intrabar arrays and calculate volume delta. A full implementation would handle:
High/low of volume delta within the bar using intrabar data
Proper candle plotting with OHLC style for CVD candles
Color options, divergent coloring, resets on different intervals
Optional plotting of total volume candles
Information boxes etc.
Next Steps
Let me know if you want me to draft a full, polished Pine Script with all features.
Or if you want deeper explanation on any part of the text you shared.
Or help translating it into another language, or for another platform.
Or tips on how to integrate this indicator with your trading strategy.
Feel free to ask for anything specific!
Természetesen! Az alábbiakban összefoglalom magyarul a leírt Kumulatív Volume Delta (CVD) Gyertyák indikátor lényegét, koncepcióját, jellemzőit, valamint értelmezési szempontjait. Ha szeretnéd, szívesen segítek Pine Script kódban is, vagy bármilyen további részletben!
A Volume Delta azt mutatja meg, hogy adott időszak (pl. gyertya) kereskedési volumenéből mennyi volt „vételi” (emelkedő) és mennyi „eladási” (csökkenő) volumen. Ezt úgy számítjuk, hogy a „felmenő” (up) volumenből kivonjuk a „lemenő” (down) volument. Ezzel láthatóvá válik, hogy a vásárlói vagy eladói oldal dominált-e.
Mi az az intrabar elemzés?
Egy gyertya (pl. 1 óra) sok kisebb időszakból (pl. 1 perc) állhat össze — ezek a "lower timeframe" (alacsonyabb időkeretű) belső gyertyák, azaz intrabarok. Ezek segítségével pontosabb adatokhoz jutunk arról, hogyan alakult a volumen az adott nagyobb időszak alatt, nem csak a gyertya nyitó és záró értékei alapján.
Hogyan számoljuk a Volume Deltát ebben az indikátorban?
Az indikátor kiveszi az alacsonyabb időszakú belső gyertyák adatait.
Minden intrabaron elemzi az ármozgást (nyitó és záró ár, vagy az előző intrabar záró árával való különbség).
Ez alapján eldönti az intrabaron belüli volumen, hogy „fel” vagy „le” volumen volt-e.
Az összes „up” volumen összeadódik, az összes „down” volumen pedig kivonódik.
Ezek alapján jön ki az adott nagyobb idősáv volume deltat értéke.
CVD Gyertyák jellemzői
A gyertyák nem az árfolyamot, hanem a volume delta értékeket mutatják OHLC (nyitó, legmagasabb, legalacsonyabb, záró) formában.
A gyertya open értéke a kumulatív volume delta a periódus elején (vagy nulláról indul, ha épp volt CVD reset).
A close érték az adott bar összesített volume delta értéke.
A gyertya high és low értéke az intrabarokon belüli legmagasabb és legalacsonyabb volume delta értékeket mutatja, ami gyertya kanócokat hoz létre.
A gyertyák színe a volume delta polaritásától függ (pozitív vagy negatív).
CVD Reset-ek
A kumulált volume delta időszakonként visszaállítható (resetelhető). Ezt a reset periódust többféleképpen lehet beállítani:
Nincs reset (folyamatos kumuláció).
Fix magasabb időkereten (például naponta, hetente).
Meghatározott időpontban (pl. kereskedési időszak elején).
Automatikusan „léptetett” magasabb időkeret alapján a chart időkeretének függvényében (pl. ha chart 1 perc, akkor 1 óra reset).
Trendváltozáskor is lehet resetelni (pl. Supertrend vagy Aroon indikátor alapján).
Miért hasznos?
Pontosabb volumen elemzést kapsz, mert az intrabarokat is figyelembe veszi, nem csak a chart gyertyák egyszerű OHLC adatait.
Láthatod a vevő-eladó erő viszonyát akár teljes gyertyákon keresztül is kumulatívan, trendeket és divergenciákat észlelhetsz.
Segít felismerni, ha a volume delta nem egyezik az ármozgással (differenciát), ami kereskedési lehetőségeket jelezhet.
Információs doboz mutatja a reset időkeretet, az intrabar időkeretet, az intrabarok átlagos számát gyertyánként.
Fontos tudni a volumennel kapcsolatban
A volumen adatok forrása és jellege eltérő lehet instrumentumtól, piaci szektortól, tőzsdétől függően.
Más lesz az adat intraday (napi kereskedés alatt) és end-of-day (nap végi) feedekben, pl. részvénynél más lehet a volumen.
A volume delta értelmezéséhez tudni kell, hogy minden egység volumet egyszerre vesznek és adnak el, de az ármozgás változásából, illetve az intrabarok polaritásából tudjuk szegmentálni, hogy mi volt vételi és eladási volumen.
Ez az elemzési módszer azért működik, mert a tőzsdei megbízás párosítás során a piaci megbízások a limit könyvből vesznek volumeneket különböző árakon.
Elemzési tippek
Figyeld, hogy a CVD gyertyák a nulla vonal felett vagy alatt helyezkednek el — ez jelzi a volumen delta alap irányát (vételi vagy eladási oldal dominál).
Nézd a gyertya trendet (emelkedő, csökkenő vagy stagnáló).
Keress divergenciákat: ha ár emelkedik, de a CVD csökken vagy stagnál, az gyengeség jele lehet.
Figyeld a gyertya kanócokat - hosszú kanócok gyengeséget vagy bizonytalanságot jelezhetnek.
Használd az indikátor által nyújtott kumulatív elemzés és reset funkciókat tudatosan.
Total volume (összes volumen) gyertyákkal is összevetheted, így tudod, hogy a volume delta az össz volumen hány százaléka.
Összefoglalás
Ez az indikátor egy fejlettebb, intrabar elemzést használó kumulatív volume delta mutató, amely pontosabb képet ad a piac vevői és eladói aktivitásáról. Lehetővé teszi a volumen delta trendek és divergenciák kimutatását egyedi, a volume deltat ábrázoló gyertyák formájában. Alkalmazásával a kereskedők jobb belátásra tehetnek szert a piaci aktivitás dinamikájába, ami segítheti a jobb döntéseket.
Ha szeretnéd, lefordítom a legfontosabb Pine Script kód részleteket is magyarul, vagy segítek elkészíteni a teljes indikátort magyar kommentekkel, színek beállításával és egyéb funkciókkal. Csak jelezd, mire van szükséged!
Ha van konkrét kérdésed vagy segíthetek valamiben, írd meg bátran!