GetVolume()

View as Markdown

Definition

Returns the volume at the selected bar index value.

Method Return Value

A long value represents the volume at the desired bar index.

Syntax

Bars.GetVolume(int index)

Parameters

ParameterDescription
indexAn int representing an absolute bar index value

Examples

1protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
2{
3 base.OnRender(chartControl, chartScale);
4 // loop through all the rendered bars on the chart
5 for(int barIndex = ChartBars.FromIndex; barIndex <= ChartBars.ToIndex; barIndex++)
6 {
7 // get the volume value at the selected bar index value
8 long volumeValue = Bars.GetVolume(barIndex);
9 Print("Bar #" + barIndex + " volume value is " + volumeValue);
10 }
11}