QuantStudio Financial Data Analysis and Trading Framework

MACD Class

Moving Average Convergence Divergence (MACD)

For a list of all members of this type, see MACD Members.

System.Object
   RQuant.Indicator.TTimeArray
      RQuant.Indicator.TDoubleArray
         RQuant.Indicator.TIndicator
            RQuant.Indicator.MACD

[Visual Basic]
Public Class MACD
    Inherits TIndicator
[C#]
public class MACD : TIndicator

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The MACD, developed by Gerald Appel, is both a trend follower and an oscillator. The abbreviation stands for Moving Average Convergence Divergence. It is the difference between a fast Exponential Moving Average (EMA) and a slow Exponential Moving Average. The name ?Moving Average Convergence Divergence? originated from the fact that the fast EMA is continually converging towards or diverging away from the slow EMA.

This indicator is described in more details in the Steve Achelis' book "Technical Analysis from A to Z".

Formula:

Example

TDataManager.cd("Demo");

TDailyArray Daily1 = TDataManager.GetStock("YHOO").DailyArray;

DateTime Date1 = DateTime.Parse("1999/02/08"); 
DateTime Date2 = DateTime.Parse("2000/12/29"); 

TDailyArray Daily = Daily1.Clone(Date1, Date2);

TCanvas Canvas = new TCanvas("Canvas","MACD DEMO",600,400);

MACD MACD = new MACD(Daily, 14, 10);

Canvas.cd(1);
Daily.Draw("c");

Canvas.cd(2);
MACD.Draw();

Requirements

Namespace: RQuant.Indicator

Assembly: RQuant.Indicator (in RQuant.Indicator.dll)

See Also

MACD Members | RQuant.Indicator Namespace