> ## Documentation Index
> Fetch the complete documentation index at: https://gocharting.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# orderflow functions

> Reference for the 1 functions of the orderflow namespace: orderflow.cvd, each with its definition and an example.

> [!NOTE]
>
> Language version: 2 · Reference version: 2.7 · Date: 2026-10-25 · Compiler build: df7b3b14 · Namespace: orderflow · Entries: 2

## `orderflow` (library)

**Definition**

Ten integer series read from a bar's footprint data — buy and sell trade counts, buy and sell volumes, delta with its intra-bar extremes, and the commitment-of-traders high and low — plus one function, `orderflow.cvd()`.

That is the whole of the orderflow surface a script can reach. Every variable in it reads `na` on a bar with no footprint data, which is also how a script tests whether the data is there at all.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("orderflow Library Example", overlay=false)
plot(orderflow.delta, title="Delta", color=color.blue, style=plotStyle.histogram)
plot(orderflow.cvd(), title="Cumulative Delta", color=color.orange)
```

## `orderflow.cvd` (function)

**Definition**

Cumulative volume delta. On each bar it adds that bar's delta - the balance of buying against selling, taken as at the bar's close - to a running total, and hands you that total as one whole number per bar.

The total restarts from zero on the first bar of every session. What you read is therefore the delta accumulated within the current session, not a figure running from the start of the chart, and a fall to zero at a session boundary is the restart rather than a move in the market.

There are no arguments, so the session restart cannot be moved or switched off. Where a bar's delta is `na`, the running total carries forward unchanged instead of becoming `na`.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
orderflow.cvd() → series int
```

**Returns**

`series int`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Cumulative Volume Delta (CVD)", overlay=false)
cvd = orderflow.cvd()
plot(cvd, title="CVD", style=plotStyle.line, color=color.orange)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.