PointCount: Integer;
PointCount: Integer;
The PointCount property returns the number of series points.
The PointCount property is calculated as m-1, where m is the maximum number of points which is loaded before problem calculation. Before loading problem calculation dates are extended by one year from both sides, therefore the PointCount property is not intended to get the number of calculation dates.
To get the number of series calculation dates use the following formula: ITimeSeries.EndIndex - ITimeSeries.StartIndex + 1.
This example describes custom method.The data series is passed by points.
Add links to the MathFin, Ms system assemblies.
Public Function UserFuncP(Input: ITimeSeries): Double;
Var
i: Integer;
Begin
If Input.PointCount > 0 Then
i := Input.CurrentIndex;
Return Math.Log10(Input.Item(i));
Else Return Double.Nan;
End If;
End Function UserFuncP;
The method returns the base-10 logarithm of the series.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.MathFin;
Imports Prognoz.Platform.Interop.Ms;
…
Public Function UserFuncP(Input: ITimeSeries): Double;
Var
i: Integer;
Math: MathClass = New MathClass();
Begin
If Input.PointCount > 0 Then
i := Input.CurrentIndex;
Return Math.Log10(Input.Item[i] As double);
Else Return Double.Nan
End If;
End Function UserFuncP;
See also: