| Overloads | |
|---|---|
| Sum(int, int, double[], int) | Calculates the summation of values over a specified time period (SUM). |
| Sum(int, int, float[], int) | Calculates the summation of values over a specified time period (SUM) using float arrays. |
Calculates the summation of values over a specified time period (SUM).
public static TechnicalAnalysis.Functions.SumResult Sum(int startIdx, int endIdx, double[] real, int timePeriod=30);startIdx System.Int32
The starting index for the calculation range.
endIdx System.Int32
The ending index for the calculation range.
real System.Double[]
Input array of real values.
timePeriod System.Int32
The number of periods to sum.
SumResult
A SumResult containing the sum values over each rolling window.
The SUM function calculates the total sum of values within a moving window of the specified time period. This is a fundamental calculation used in many other indicators and can help identify cumulative trends or total volume/value over specific periods.
Calculates the summation of values over a specified time period (SUM) using float arrays.
public static TechnicalAnalysis.Functions.SumResult Sum(int startIdx, int endIdx, float[] real, int timePeriod=30);startIdx System.Int32
The starting index for the calculation range.
endIdx System.Int32
The ending index for the calculation range.
real System.Single[]
Input array of real values.
timePeriod System.Int32
The number of periods to sum. Default is 30.
SumResult
A SumResult containing the sum values over each rolling window.
This overload accepts a float array and converts it to a double array before processing. The conversion may result in minor precision differences.