Class DoubleExponentialMovingAverage
- Namespace
- FinanceSharp.Indicators
- Assembly
- FinanceSharp.dll
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
public class DoubleExponentialMovingAverage : IndicatorBase, IIndicator, IUpdatable
- Inheritance
-
DoubleExponentialMovingAverage
- Implements
- Inherited Members
- Extension Methods
Constructors
DoubleExponentialMovingAverage(int, double)
Initializes a new instance of the DoubleExponentialMovingAverage class using the specified period.
public DoubleExponentialMovingAverage(int period, double volumeFactor = 1)
Parameters
periodintThe period of the DEMA
volumeFactordoubleThe volume factor of the DEMA (value must be in the [0,1] range, set to 1 for standard DEMA)
DoubleExponentialMovingAverage(string, int, double)
Initializes a new instance of the DoubleExponentialMovingAverage class using the specified name and period.
public DoubleExponentialMovingAverage(string name, int period, double volumeFactor = 1)
Parameters
namestringThe name of this indicator
periodintThe period of the DEMA
volumeFactordoubleThe volume factor of the DEMA (value must be in the [0,1] range, set to 1 for standard DEMA)
Properties
IsReady
Gets a flag indicating when this indicator is ready and fully initialized
public override bool IsReady { 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
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()