Table of Contents

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

period int

The 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

period int

The period of the EMA

smoothingFactor double

The 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

name string

The name of this indicator

period int

The period of the EMA

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

name string

The name of this indicator

period int

The period of the EMA

smoothingFactor double

The 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

bool

WarmUpPeriod

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

public override int WarmUpPeriod { get; }

Property Value

int

Methods

Forward(long, DoubleArray)

Computes the next value of this indicator from the given state

protected override DoubleArray Forward(long time, DoubleArray input)

Parameters

time long
input DoubleArray

The 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

period int

The period of the EMA

Returns

double

The default smoothing factor