Table of Contents

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

fastPeriod int

The fast moving average period

slowPeriod int

The slow moving average period

signalPeriod int

The signal period

type MovingAverageType

The 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

name string

The name of this indicator

fastPeriod int

The fast moving average period

slowPeriod int

The slow moving average period

signalPeriod int

The signal period

type MovingAverageType

The type of moving averages to use

Properties

Fast

Gets the fast average indicator

public IndicatorBase Fast { get; }

Property Value

IndicatorBase

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

IndicatorBase

IsReady

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

public override bool IsReady { get; }

Property Value

bool

Signal

Gets the signal of the MACD

public IndicatorBase Signal { get; }

Property Value

IndicatorBase

Slow

Gets the slow average indicator

public IndicatorBase Slow { get; }

Property Value

IndicatorBase

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

Reset()

Resets this indicator to its initial state

public override void Reset()