AverageTrueRange


Summary

Average true range. An indicator providing the degree of price volatility.

Remarks

Average true range is a volatility indicator originally developed by J. Welles Wilder. The indicator provides the degree of price volatility. The average true range is an N-day (exponential) moving average of the true range values. Wilder recommended a 14-period smoothing.

Syntax

public interface AverageTrueRange

Members

NameTypeSummary
Result PropertyThe resulting data series of Average True Range Indicator instance

Example 1

private AverageTrueRange averageTrueRange;
[Parameter(DefaultValue = 14)]
public int Periods { get; set; }
[Parameter(DefaultValue = 0.002)]
public double ATRValue { get; set; }
[Parameter("MA Type", DefaultValue = MovingAverageType.Exponential)]
public MovingAverageType MAType { get; set; }
protected override void OnStart()
{
    averageTrueRange = Indicators.AverageTrueRange(Periods, MAType);
}
protected override void OnTick()
{
    // if the 14 day Average True Range is higher than 0.002
    if(averageTrueRange.Result.LastValue >= ATRValue)
    {
        // Do Something
    }
}