# Volume weighted moving average

`vwma`

Average that weights each price by the volume traded at it.

## Inputs

| Name | Type | Default | Range |
| --- | --- | --- | --- |
| source | source | close |  |
| volume | volume | tick |  |
| period | int | 20 | 1 to 5000 |

## Outputs

| Name | Kind |
| --- | --- |
| vwma | value |

Warm-up: period - 1 bars (19 at the defaults).

Repaints: No.

## Formula

VWMA[i] = sum(x[j] * v[j]) / sum(v[j]) over the last period bars

No value until period bars exist, or where the volume in the window adds to zero.
