Table of Contents

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

period int

The smoothing period used to smooth the true range values

movingAverageType MovingAverageType

The 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

name string

The name of this indicator

period int

The smoothing period used to smooth the true range values

movingAverageType MovingAverageType

The 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

bool

TrueRange

Gets the true range which is the more volatile calculation to be smoothed by this indicator

public IndicatorBase TrueRange { get; }

Property Value

IndicatorBase

WarmUpPeriod

Required period, in data points, for the indicator to be ready and fully initialized.

public override int WarmUpPeriod { get; }

Property Value

int

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

previous DoubleArray

The previous trade bar

current DoubleArray

The 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

time long
input DoubleArray

The 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()