Create;
Create();
The Create constructor creates a data series.
Use the TimeSeries.CreateEx and TimeSeries.CreateLevel constructors to create a data series using additional parameters.
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, True) Then
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.
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, True) Then
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: