ITimeSeries.DateToIndex

Syntax

DateToIndex(Value: DateTime): Integer;

Parameters

Value. Calendar series point.

Description

The DateToIndex method returns index of the specified calendar series point.

Example

This example describes custom method. The data series is passed by points.

Public Function UserFunc(Input: ITimeSeries): Double;

Var

i: Integer;

 Begin

i := Input.CurrentIndex;

If Input.DateToIndex(DateTime.Now) <> i

Then Return Math.Log10(Input.Item(i));

Else Return Double.Nan

End If;

End Function UserFunc;

The method returns the natural logarithm for all series points, except for one that falls into the current date.

See also:

ITimeSeries