Lean  $LEAN_TAG$
QuantConnect.Indicators.DoubleExponentialMovingAverage Class Reference

This indicator computes the Double Exponential Moving Average (DEMA). The Double Exponential Moving Average is calculated with the following formula: EMA2 = EMA(EMA(t,period),period) DEMA = 2 * EMA(t,period) - EMA2 The Generalized DEMA (GD) is calculated with the following formula: GD = (volumeFactor+1) * EMA(t,period) - volumeFactor * EMA2 More...

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

Public Member Functions

 DoubleExponentialMovingAverage (string name, int period, decimal volumeFactor=1m)
 Initializes a new instance of the DoubleExponentialMovingAverage class using the specified name and period. More...
 
 DoubleExponentialMovingAverage (int period, decimal volumeFactor=1m)
 Initializes a new instance of the DoubleExponentialMovingAverage class using the specified period. More...
 
override void Reset ()
 Resets this indicator to its initial state More...
 

Public Attributes

override bool IsReady => Samples > 2 * (_period - 1)
 Gets a flag indicating when this indicator is ready and fully initialized More...
 
int WarmUpPeriod => 1 + 2 * (_period - 1)
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 

Protected Member Functions

override decimal ComputeNextValue (IndicatorDataPoint input)
 Computes the next value of this indicator from the given state 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

This indicator computes the Double Exponential Moving Average (DEMA). The Double Exponential Moving Average is calculated with the following formula: EMA2 = EMA(EMA(t,period),period) DEMA = 2 * EMA(t,period) - EMA2 The Generalized DEMA (GD) is calculated with the following formula: GD = (volumeFactor+1) * EMA(t,period) - volumeFactor * EMA2

Definition at line 26 of file DoubleExponentialMovingAverage.cs.

Constructor & Destructor Documentation

◆ DoubleExponentialMovingAverage() [1/2]

QuantConnect.Indicators.DoubleExponentialMovingAverage.DoubleExponentialMovingAverage ( string  name,
int  period,
decimal  volumeFactor = 1m 
)

Initializes a new instance of the DoubleExponentialMovingAverage class using the specified name and period.

Parameters
nameThe name of this indicator
periodThe period of the DEMA
volumeFactorThe volume factor of the DEMA (value must be in the [0,1] range, set to 1 for standard DEMA)

Definition at line 39 of file DoubleExponentialMovingAverage.cs.

◆ DoubleExponentialMovingAverage() [2/2]

QuantConnect.Indicators.DoubleExponentialMovingAverage.DoubleExponentialMovingAverage ( int  period,
decimal  volumeFactor = 1m 
)

Initializes a new instance of the DoubleExponentialMovingAverage class using the specified period.

Parameters
periodThe period of the DEMA
volumeFactorThe volume factor of the DEMA (value must be in the [0,1] range, set to 1 for standard DEMA)

Definition at line 53 of file DoubleExponentialMovingAverage.cs.

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.DoubleExponentialMovingAverage.ComputeNextValue ( IndicatorDataPoint  input)
protected

Computes the next value of this indicator from the given state

Parameters
inputThe input given to the indicator
Returns
A new value for this indicator

Definition at line 73 of file DoubleExponentialMovingAverage.cs.

◆ Reset()

override void QuantConnect.Indicators.DoubleExponentialMovingAverage.Reset ( )

Resets this indicator to its initial state

Definition at line 88 of file DoubleExponentialMovingAverage.cs.

Member Data Documentation

◆ IsReady

override bool QuantConnect.Indicators.DoubleExponentialMovingAverage.IsReady => Samples > 2 * (_period - 1)

Gets a flag indicating when this indicator is ready and fully initialized

Definition at line 61 of file DoubleExponentialMovingAverage.cs.

◆ WarmUpPeriod

int QuantConnect.Indicators.DoubleExponentialMovingAverage.WarmUpPeriod => 1 + 2 * (_period - 1)

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

Definition at line 66 of file DoubleExponentialMovingAverage.cs.


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