TimeSeries.Create

Fore Syntax

Create;

Fore.NET Syntax

Create();

Description

The Create constructor creates a data series.

Comments

Use the TimeSeries.CreateEx and TimeSeries.CreateLevel constructors to create a data series using additional parameters.

Fore Example

A custom series calculation method is given in the example. To execute the example, add a link to the Ms system assembly.

Function TimeFunc(Input: ITimeSeries): ITimeSeries;
Var
    i: Integer;
    pSeries: ITimeSeries;
Begin
    pSeries := New TimeSeries.Create;
    If pSeries.CheckCompatible(Input, TrueThen
        For i := pSeries.StartIndex To pSeries.EndIndex Do
            pSeries.Item(i) := 1 + Input.Item(i);
        End For;
    End If;
    Return pSeries;
End Function TimeFunc;

The method increases input series values if it is compatible with the user calculation method context.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Ms;

Public Function TimeFunc(Input: TimeSeries): ITimeSeries;
Var
    i: Integer;
    pSeries: ITimeSeries;
Begin
    pSeries := New TimeSeriesClass.Create();
    If pSeries.CheckCompatible(Input, TrueThen
        For i := pSeries.StartIndex To pSeries.EndIndex Do
            pSeries.Item[i] := 1 + (Input.Item[i] As double);
        End For;
    End If;
    Return pSeries;
End Function TimeFunc;

See also:

TimeSeries