Skip to content

Latest commit

 

History

History
96 lines (58 loc) · 4.25 KB

TAMath.Sum.md

File metadata and controls

96 lines (58 loc) · 4.25 KB

TAMath.Sum Method

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.

TAMath.Sum(int, int, double[], int) Method

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);

Parameters

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.

Returns

SumResult
A SumResult containing the sum values over each rolling window.

Remarks

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.

TAMath.Sum(int, int, float[], int) Method

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);

Parameters

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.

Returns

SumResult
A SumResult containing the sum values over each rolling window.

Remarks

This overload accepts a float array and converts it to a double array before processing. The conversion may result in minor precision differences.