TimeSeries.CreateEx

Fore Syntax

CreateEx(CalendarLevel: DimCalendarLevel; CalendarSettings: ITsCalendarSettings);

Fore.NET Syntax

CreateEx(
    CalendarLevel: Prognoz.Platform.Interop.Dimensions.DimCalendarLevel;
    CalendarSettings: Prognoz.Platform.Interop.Transform.TsCalendarSettings;
    Context: Prognoz.Platform.Interop.Fore.ForeRuntimeContext);

Parameters

CalendarLevel. Series calendar frequency.

CalendarSettings. Calendar level parameters.

Context. Context. It is relevant only for Fore.NET.

Description

The CreateEx constructor creates a series with the specified calendar level parameters.

Comments

Use the TimeSeries.Create default constructor to create a series without additional parameters.

Fore Example

A custom series calculation method is given in the example. To execute the example, add links to the Dimensions, Ms, Transform system assemblies.

Function TimeS(Input: ITimeSeries): ITimeSeries;
Var
    pContext: ITsCalculationContext;
    i: Integer;
    CalendSett: ITsCalendarSettings;
    pSeries: ITimeSeries;
Begin
    pContext := TsCalculation.Current;
    CalendSett := New MsCalendarSettings.Create;
    CalendSett.RestDays := DayOfWeekSet.SaturdaySunday;
    CalendSett.FirstDay := DayOfWeekSet.Monday;
    pSeries := New TimeSeries.CreateEx(DimCalendarLevel.Day, CalendSett);
    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 TimeS;

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.Dimensions;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Transform;

Public Function TimeS(Input: TimeSeries): ITimeSeries;
Var
    CClass: TsCalculationClass;
    pContext: ITsCalculationContext;
    i: Integer;
    CalendSett: TsCalendarSettings;
    pSeries: ITimeSeries;
Begin
    CClass := New TsCalculationClass.Create();
    pContext := CClass.Current[Null];
    CalendSett := New TsCalendarSettings.Create();
    CalendSett.RestDays := DayOfWeekSet.dowsSaturdaySunday;
    CalendSett.FirstDay := DayOfWeekSet.dowsMonday;
    pSeries := New TimeSeriesClass.Create();
    pSeries.CreateEx(DimCalendarLevel.dclDay, CalendSett, Null);
    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 TimeS;

See also:

TimeSeries