GetBarIdxByTime()

View as Markdown

Definition

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

Method Return Value

An int representing the bar index value at a specific time.

Syntax

ChartBars.GetBarIdxByTime(ChartControl chartControl, DateTime time)

Method Parameters

ParameterDescription
chartControlThe ChartControl object used to determine the chart’s time axis
timeThe DateTime value used to convert to a ChartBar index value

Examples

1protected override void OnBarUpdate()
2{
3 if (ChartBars != null)
4 {
5 Print(ChartBars.GetBarIdxByTime(ChartControl, Time[0]));
6 }
7}