Class AverageTrueRange
- Namespace
- FinanceSharp.Indicators
- Assembly
- FinanceSharp.dll
The AverageTrueRange indicator is a measure of volatility introduced by Welles Wilder in his book: New Concepts in Technical Trading Systems. This indicator computes the TrueRange and then smoothes the TrueRange over a given period.
TrueRange is defined as the maximum of the following: High - Low ABS(High - PreviousClose) ABS(Low - PreviousClose)
public class AverageTrueRange : BarIndicator, IIndicator, IUpdatable
- Inheritance
-
AverageTrueRange
- Implements
- Inherited Members
- Extension Methods
Constructors
AverageTrueRange(int, MovingAverageType)
Creates a new AverageTrueRange indicator using the specified period and moving average type
public AverageTrueRange(int period, MovingAverageType movingAverageType = MovingAverageType.Wilders)
Parameters
periodintThe smoothing period used to smooth the true range values
movingAverageTypeMovingAverageTypeThe type of smoothing used to smooth the true range values
AverageTrueRange(string, int, MovingAverageType)
Creates a new AverageTrueRange indicator using the specified period and moving average type
public AverageTrueRange(string name, int period, MovingAverageType movingAverageType = MovingAverageType.Wilders)
Parameters
namestringThe name of this indicator
periodintThe smoothing period used to smooth the true range values
movingAverageTypeMovingAverageTypeThe type of smoothing used to smooth the true range values
Properties
IsReady
Gets a flag indicating when this indicator is ready and fully initialized
public override bool IsReady { get; }
Property Value
TrueRange
Gets the true range which is the more volatile calculation to be smoothed by this indicator
public IndicatorBase TrueRange { get; }
Property Value
WarmUpPeriod
Required period, in data points, for the indicator to be ready and fully initialized.
public override int WarmUpPeriod { get; }
Property Value
Methods
ComputeTrueRange(DoubleArray, DoubleArray)
Computes the TrueRange from the current and previous trade bars
TrueRange is defined as the maximum of the following: High - Low ABS(High - PreviousClose) ABS(Low - PreviousClose)
public static double ComputeTrueRange(DoubleArray previous, DoubleArray current)
Parameters
previousDoubleArrayThe previous trade bar
currentDoubleArrayThe current trade bar
Returns
- double
The true range
Forward(long, DoubleArray)
Computes the next value of this indicator from the given state
protected override DoubleArray Forward(long time, DoubleArray input)
Parameters
timelonginputDoubleArrayThe input given to the indicator
Returns
- DoubleArray
A new value for this indicator
Reset()
Resets this indicator to its initial state
public override void Reset()