Skip to content

Latest commit

 

History

History
112 lines (67 loc) · 5.46 KB

TAMath.TrueRange.md

File metadata and controls

112 lines (67 loc) · 5.46 KB

TAMath.TrueRange Method

Overloads
TrueRange(int, int, double[], double[], double[]) Calculates the True Range (TRANGE) indicator.
TrueRange(int, int, float[], float[], float[]) Calculates the True Range (TRANGE) indicator using float arrays.

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

Calculates the True Range (TRANGE) indicator.

public static TechnicalAnalysis.Functions.TrueRangeResult TrueRange(int startIdx, int endIdx, double[] high, double[] low, double[] close);

Parameters

startIdx System.Int32

The starting index for the calculation.

endIdx System.Int32

The ending index for the calculation.

high System.Double[]

An array of high prices.

low System.Double[]

An array of low prices.

close System.Double[]

An array of closing prices.

Returns

TrueRangeResult
A TrueRangeResult object containing the calculated values.

Remarks

True Range is the greatest of the following: - Current high minus current low - Absolute value of current high minus previous close - Absolute value of current low minus previous close

True Range captures volatility from gaps and limit moves. It is a component of the Average True Range (ATR) indicator. Unlike the traditional range calculation, True Range accounts for gaps between trading sessions.

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

Calculates the True Range (TRANGE) indicator using float arrays.

public static TechnicalAnalysis.Functions.TrueRangeResult TrueRange(int startIdx, int endIdx, float[] high, float[] low, float[] close);

Parameters

startIdx System.Int32

The starting index for the calculation.

endIdx System.Int32

The ending index for the calculation.

high System.Single[]

An array of high prices.

low System.Single[]

An array of low prices.

close System.Single[]

An array of closing prices.

Returns

TrueRangeResult
A TrueRangeResult object containing the calculated values.

Remarks

This overload accepts float arrays and converts them to double arrays before processing. This may result in a minor performance overhead due to the conversion process.