flow
Taker flow: the chart’s market (buy and sell volume, delta from the bars), the coin’s Binance cumulative delta, and the all-exchange flow of the coin (flow.agg_*, Pro and Elite). ChartDeck data.
#Functions
#flow.big_sincefunction
The time (ms) from which the Big trades the script reads are held (bars before it read na), na without data.
flow.big_since(): intReturns int.
Example
const from = flow.big_since()Since ChartScript 1
#flow.big_thresholdfunction
The Big trades size in use (USD): the chart’s fixed size, else the Auto size (the server’s hour of trades). na while it is measured.
flow.big_threshold(): floatReturns float.
Example
legend.info("Big trades from " + str.tostring(flow.big_threshold(), format.volume))Since ChartScript 1
#flow.big_tradesfunction
The chart’s Big trades bubbles of a bar, by time: the piles the Big trades row draws (every pile, not only those a view draws), at the chart’s size and exchanges. A script on ChartDeck’s servers (a protected script, a script alert) has no chart settings: it reads the defaults, This exchange and the Auto size. History: the plan’s Big trades reach (Beginner 15 min, Plus 24 h, Pro 30 days, Elite 90 days), a month at most back from the newest bar; signed out, empty. The stored prints are asked again every minute; in replay only prints at or before the clock. The chart’s own bars only: inside a request expression it reads empty (CS3124).
flow.big_trades({ back?: int = 0 }): array<flow.big_trade>| Parameter | Type | Description |
|---|---|---|
back | intdefault 0 | How many bars back: 0 = this bar, 1 = the one before. |
Returns array<flow.big_trade>.
Example
for (const b of flow.big_trades()) {
if (b.notional >= 5000000) {
label.new(b.time, b.price, str.tostring(b.notional, format.volume), xloc.bar_time)
}
}Since ChartScript 1
#flow.print_thresholdfunction
The notional value (price x size) that the given share of the market's recent prints stay under: 99, 99.5 and 99.9 from the server's last hour, 95 and 98 (or when the server has too few) from the live trade tape's newest 3,000 prints. na until enough prints were seen (the Large prints study's Auto threshold).
flow.print_threshold({ percentile?: simple float = 99.9, venue?: simple string = "" }): float| Parameter | Type | Description |
|---|---|---|
percentile | simple floatdefault 99.9 | 95, 98, 99, 99.5 or 99.9. |
venue | simple stringdefault "" | "" = the chart's market; "binance" = the coin's Binance perpetual. |
Returns float.
Example
const big = nz(flow.print_threshold(99.9), 100000)Since ChartScript 1
#flow.printsfunction
This bar's large trades from ChartDeck's trade tape: prints of at least min_notional (quote currency), oldest first. Live data: the history reaches back as far as ChartDeck kept the market's prints (15 minutes to 24 hours by plan) and grows while the chart is open.
flow.prints({ min_notional?: float = 0, side?: simple string = "both", venue?: simple string = "" }): array<flow.print>| Parameter | Type | Description |
|---|---|---|
min_notional | floatdefault 0 | The smallest print kept, in the quote currency (price x size). |
side | simple stringdefault "both" | "both", "buy" (taker buys) or "sell" (taker sells). |
venue | simple stringdefault "" | "" = the chart's market; "binance" = the coin's Binance perpetual (USDT-margined), on any chart. Every plan, inside its prints window. |
Returns array<flow.print>.
Example
for (const p of flow.prints(250000)) {
label.new(p.time, p.price, str.tostring(p.notional, format.volume), xloc.bar_time)
}Since ChartScript 1
#flow.prints_sincefunction
The time (ms) of the oldest print ChartDeck holds for this market, na when it holds none.
flow.prints_since({ venue?: simple string = "" }): int| Parameter | Type | Description |
|---|---|---|
venue | simple stringdefault "" | "" = the chart's market; "binance" = the coin's Binance perpetual. |
Returns int.
Example
const from = flow.prints_since()Since ChartScript 1
#Variables
#flow.agg_buyvariable
Taker buys of the bar summed over every exchange ChartDeck merges for the coin, perpetuals and spot, in USD (the quote currency; the Aggregated delta / CVD study’s data). From the data hub’s recorded minutes, then the live 10-second buckets; before the hub’s minutes start the history is the STRATA recording of perpetuals on 9 exchanges (perpetuals only). na before the history. Pro and Elite (the all-exchange trade feed).
flow.agg_buy: floatType series float.
Example
const v = flow.agg_buySince ChartScript 1
#flow.agg_cvdvariable
All-exchange cumulative delta, perpetuals and spot, in USD: flow.agg_delta summed from the first loaded bar with flow (the Aggregated delta / CVD study’s line). Pro and Elite.
flow.agg_cvd: floatType series float.
Example
const v = flow.agg_cvdSince ChartScript 1
#flow.agg_deltavariable
All-exchange delta of the bar: flow.agg_buy minus flow.agg_sell, in USD (the Aggregated delta / CVD study’s bars). Pro and Elite.
flow.agg_delta: floatType series float.
Example
const v = flow.agg_deltaSince ChartScript 1
#flow.agg_perp_cvdvariable
All-exchange cumulative delta of the coin’s perpetuals only, in USD, from the first loaded bar with flow. Pro and Elite.
flow.agg_perp_cvd: floatType series float.
Example
const v = flow.agg_perp_cvdSince ChartScript 1
#flow.agg_sellvariable
Taker sells of the bar summed over every exchange, perpetuals and spot, in USD (see flow.agg_buy). Pro and Elite.
flow.agg_sell: floatType series float.
Example
const v = flow.agg_sellSince ChartScript 1
#flow.agg_spot_cvdvariable
All-exchange cumulative delta of the coin’s spot markets only, in USD, from the first loaded bar with spot flow; na on bars where only perpetuals were recorded. Pro and Elite.
flow.agg_spot_cvd: floatType series float.
Example
const v = flow.agg_spot_cvdSince ChartScript 1
#flow.big_buy_usdvariable
The value (USD) of the chart’s Big trades on taker buys in the bar: the piles the Big trades row draws (one bar, one side, prices within the pile band), at the chart’s Big trades size (Chart settings: a fixed size, else Auto) and exchanges (This exchange / All exchanges). na before the data the chart holds (never 0 there); 0 on a bar inside it with none.
flow.big_buy_usd: floatType series float.
Example
const b = flow.big_buy_usdSince ChartScript 1
#flow.big_countvariable
How many Big trades bubbles (piles) the bar has, both sides. na before the data the chart holds (never 0 there); 0 on a bar inside it with none.
flow.big_count: floatType series float.
Example
const n = flow.big_countSince ChartScript 1
#flow.big_sell_usdvariable
The same for taker sells. na before the data the chart holds (never 0 there); 0 on a bar inside it with none.
flow.big_sell_usd: floatType series float.
Example
const s = flow.big_sell_usdSince ChartScript 1
#flow.buy_volvariable
Taker-buy volume of the bar, base coin (the same split as the Volume delta study). Read from the bar itself: na on a venue whose candles carry no taker volume (only Binance and Aster candles, and every tick / range bar, do) and on seconds bars.
flow.buy_vol: floatType series float.
Example
const v = flow.buy_volSince ChartScript 1
#flow.cvdvariable
Cumulative volume delta of the coin’s Binance perpetual, in USDT (the CVD study’s perp line): cumulative over the loaded bars, starting at the first bar with flow; na on a bar with no flow yet. Seconds charts: the minute flow, each bar at its end. Tick / range charts: summed from the bars’ own taker volume (base coin).
flow.cvd: floatType series float.
Example
const v = flow.cvdSince ChartScript 1
#flow.deltavariable
Volume delta of the bar: taker buy minus taker sell, base coin (the Volume delta study). na where the bar carries no taker volume.
flow.delta: floatType series float.
Example
const v = flow.deltaSince ChartScript 1
#flow.sell_volvariable
Taker-sell volume of the bar, base coin: volume minus flow.buy_vol. na where the bar carries no taker volume.
flow.sell_vol: floatType series float.
Example
const v = flow.sell_volSince ChartScript 1
#flow.spot_cvdvariable
Cumulative volume delta of the coin’s Binance spot market, in USDT (the CVD study’s spot line); na where Binance lists no spot pair, and on tick / range charts.
flow.spot_cvd: floatType series float.
Example
const v = flow.spot_cvdSince ChartScript 1