Class ExponentialMovingAverage
- Namespace
- FinanceSharp.Indicators
- Assembly
- FinanceSharp.dll
Represents the traditional exponential moving average indicator (EMA)
public class ExponentialMovingAverage : Indicator, IIndicator, IUpdatable
- Inheritance
-
ExponentialMovingAverage
- Implements
- Inherited Members
- Extension Methods
Constructors
ExponentialMovingAverage(int)
Initializes a new instance of the ExponentialMovingAverage class with the default name and period
public ExponentialMovingAverage(int period)
Parameters
periodintThe period of the EMA
ExponentialMovingAverage(int, double)
Initializes a new instance of the ExponentialMovingAverage class with the default name and period
public ExponentialMovingAverage(int period, double smoothingFactor)
Parameters
periodintThe period of the EMA
smoothingFactordoubleThe percentage of data from the previous value to be carried into the next value
ExponentialMovingAverage(string, int)
Initializes a new instance of the ExponentialMovingAverage class with the specified name and period
public ExponentialMovingAverage(string name, int period)
Parameters
ExponentialMovingAverage(string, int, double)
Initializes a new instance of the ExponentialMovingAverage class with the specified name and period
public ExponentialMovingAverage(string name, int period, double smoothingFactor)
Parameters
namestringThe name of this indicator
periodintThe period of the EMA
smoothingFactordoubleThe percentage of data from the previous value to be carried into the next value
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
SmoothingFactorDefault(int)
Calculates the default smoothing factor for an ExponentialMovingAverage indicator
public static double SmoothingFactorDefault(int period)
Parameters
periodintThe period of the EMA
Returns
- double
The default smoothing factor