Class MovingAverageConvergenceDivergence
- Namespace
- FinanceSharp.Indicators
- Assembly
- FinanceSharp.dll
This indicator creates two moving averages defined on a base indicator and produces the difference between the fast and slow averages.
public class MovingAverageConvergenceDivergence : Indicator, IIndicator, IUpdatable
- Inheritance
-
MovingAverageConvergenceDivergence
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
MovingAverageConvergenceDivergence(int, int, int, MovingAverageType)
Creates a new MACD with the specified parameters
public MovingAverageConvergenceDivergence(int fastPeriod, int slowPeriod, int signalPeriod, MovingAverageType type = MovingAverageType.Exponential)
Parameters
fastPeriodintThe fast moving average period
slowPeriodintThe slow moving average period
signalPeriodintThe signal period
typeMovingAverageTypeThe type of moving averages to use
MovingAverageConvergenceDivergence(string, int, int, int, MovingAverageType)
Creates a new MACD with the specified parameters
public MovingAverageConvergenceDivergence(string name, int fastPeriod, int slowPeriod, int signalPeriod, MovingAverageType type = MovingAverageType.Exponential)
Parameters
namestringThe name of this indicator
fastPeriodintThe fast moving average period
slowPeriodintThe slow moving average period
signalPeriodintThe signal period
typeMovingAverageTypeThe type of moving averages to use
Properties
Fast
Gets the fast average indicator
public IndicatorBase Fast { get; }
Property Value
Histogram
Developed by Thomas Aspray in 1986, the MACD-Histogram measures the distance between MACD and its signal line, is an oscillator that fluctuates above and below the zero line. Bullish or bearish divergences in the MACD-Histogram can alert chartists to an imminent signal line crossover in MACD.
public IndicatorBase Histogram { get; }
Property Value
IsReady
Gets a flag indicating when this indicator is ready and fully initialized
public override bool IsReady { get; }
Property Value
Signal
Gets the signal of the MACD
public IndicatorBase Signal { get; }
Property Value
Slow
Gets the slow average indicator
public IndicatorBase Slow { 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()