Sidechair

volume

Browse the reference

The traded volume of the current bar, in shares, contracts or coins depending on the symbol.

Try it in the editor

volume is a series float. Stocks report shares, futures report contracts and crypto reports base-currency units. syminfo.volumetype says which.

On the live bar, volume grows with every trade, so a volume filter can switch on partway through the bar.

Type

series float

Remarks

  • Symbols without volume data return 0 or na on every bar, and ta.obv and ta.vwap then do not behave usefully.
  • volume[n] is na before the first bar of the chart.

Example

Pine ScriptVolume against its averageOpen in editor
//@version=6
indicator("Relative volume")
rel = volume / ta.sma(volume, 20)
plot(rel, "Relative volume", rel > 2 ? color.orange : color.gray, style = plot.style_columns)
hline(1, "Average")

See also

Runs on Sidechair