GetTimeByBarIdx()

View as Markdown

Definition

Returns the ChartBars time value calculated from a bar index parameter provided.

Method Return Value

A DateTime struct representing a bar time value at a specific bar index value.

Syntax

ChartBars.GetTimeByBarIdx(ChartControl chartControl, int barIndex)

Method Parameters

ParameterDescription
chartControlThe ChartControl object used to determine the chart’s time axis
barIndexAn int value representing a bar index used to convert to a ChartBar index value

Examples

1protected override void OnBarUpdate()
2{
3 if (ChartBars != null)
4 {
5 Print(ChartBars.GetTimeByBarIdx(ChartControl, 50)); //8/11/2015 4:30:00 AM
6 }
7}