# Volume reference

> All 6 volume in AlgoBarsX, each with its parameters, defaults, ranges and an example: vwap, obv, cmf, ad_line, pvt, volume_osc.

Source: https://algobarsx.com/docs/ref-fn-volume/

### `vwap(anchor = "session", on = bars())` → series<price>

Volume-weighted average price, restarting at each session or period.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `anchor` | string | `"session"` | Where the average restarts. |
| `on` | BarSet | `bars()` | Bars to calculate on; defaults to the script's own bars. |

```algobarsx
fair = vwap(anchor: "session")
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `obv(on = bars())` → series<number>

On-balance volume.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `on` | BarSet | `bars()` | Bars to calculate on; defaults to the script's own bars. |

```algobarsx
balance_volume = obv()
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `cmf(length = 20, on = bars())` → series<number>

Chaikin money flow.

#### Parameters

| Name | Type | Default | Range | What it is |
| --- | --- | --- | --- | --- |
| `length` | int | `20` | 1 to 5000 | Number of bars in the calculation. |
| `on` | BarSet | `bars()` |  | Bars to calculate on; defaults to the script's own bars. |

```algobarsx
money_flow = cmf(20)
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `ad_line(on = bars())` → series<number>

Accumulation/distribution line.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `on` | BarSet | `bars()` | Bars to calculate on; defaults to the script's own bars. |

```algobarsx
ad = ad_line()
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `pvt(on = bars())` → series<number>

Price volume trend.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `on` | BarSet | `bars()` | Bars to calculate on; defaults to the script's own bars. |

```algobarsx
trend_volume = pvt()
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `volume_osc(fast = 5, slow = 10, on = bars())` → series<number>

Volume oscillator.

#### Parameters

| Name | Type | Default | Range | What it is |
| --- | --- | --- | --- | --- |
| `fast` | int | `5` | 1 to 5000 | Fast length. |
| `slow` | int | `10` | 1 to 5000 | Slow length. |
| `on` | BarSet | `bars()` |  | Bars to calculate on; defaults to the script's own bars. |

```algobarsx
vo = volume_osc(5, 10)
```

Works in: strategy, indicator, alert, library. Since 1.0.
