Lean  $LEAN_TAG$
QuantConnect.Indicators.AverageRange Class Reference

Represents the Average Range (AR) indicator, which calculates the average price range More...

Inheritance diagram for QuantConnect.Indicators.AverageRange:
[legend]

Public Member Functions

 AverageRange (string name, int period)
 Initializes a new instance of the AverageRange class with the specified name and period. More...
 
 AverageRange (int period)
 Initializes the AR indicator with the default name format and period. More...
 
override void Reset ()
 Resets the indicator and clears the internal state, including the SMA. More...
 

Public Attributes

override bool IsReady => _sma.IsReady
 Indicates whether the indicator has enough data to start producing valid results. More...
 
int WarmUpPeriod => _sma.WarmUpPeriod
 The number of periods needed to fully initialize the AR indicator. More...
 

Protected Member Functions

override decimal ComputeNextValue (IBaseDataBar input)
 Computes the next value of the Average Range (AR) by calculating the price range (high - low) and passing it to the SMA to get the smoothed value. More...
 
- Protected Member Functions inherited from QuantConnect.Indicators.BarIndicator
 BarIndicator (string name)
 Creates a new TradeBarIndicator with the specified name More...
 

Additional Inherited Members

- Properties inherited from QuantConnect.Indicators.IIndicatorWarmUpPeriodProvider
int WarmUpPeriod [get]
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 

Detailed Description

Represents the Average Range (AR) indicator, which calculates the average price range

Definition at line 23 of file AverageRange.cs.

Constructor & Destructor Documentation

◆ AverageRange() [1/2]

QuantConnect.Indicators.AverageRange.AverageRange ( string  name,
int  period 
)

Initializes a new instance of the AverageRange class with the specified name and period.

Parameters
nameThe name of the AR indicator.
periodThe number of periods over which to compute the average range.

Definition at line 35 of file AverageRange.cs.

◆ AverageRange() [2/2]

QuantConnect.Indicators.AverageRange.AverageRange ( int  period)

Initializes the AR indicator with the default name format and period.

Definition at line 43 of file AverageRange.cs.

Member Function Documentation

◆ Reset()

override void QuantConnect.Indicators.AverageRange.Reset ( )

Resets the indicator and clears the internal state, including the SMA.

Definition at line 61 of file AverageRange.cs.

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.AverageRange.ComputeNextValue ( IBaseDataBar  input)
protected

Computes the next value of the Average Range (AR) by calculating the price range (high - low) and passing it to the SMA to get the smoothed value.

Parameters
inputThe input data for the current bar, including open, high, low, close values.
Returns
The computed AR value, which is the smoothed average of price ranges.

Definition at line 73 of file AverageRange.cs.

Member Data Documentation

◆ IsReady

override bool QuantConnect.Indicators.AverageRange.IsReady => _sma.IsReady

Indicates whether the indicator has enough data to start producing valid results.

Definition at line 51 of file AverageRange.cs.

◆ WarmUpPeriod

int QuantConnect.Indicators.AverageRange.WarmUpPeriod => _sma.WarmUpPeriod

The number of periods needed to fully initialize the AR indicator.

Definition at line 56 of file AverageRange.cs.


The documentation for this class was generated from the following file: