Skip to main content

MACD Dema Indicator for Amibroker (AFL)

Peixoto about 16 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 2)
  • Tags:
    oscillator, macd, amibroker

The classic MACD, rewritten using Double Exponential Moving Averages.

Indicator / Formula

Copy & Paste Friendly
Length1 = Param("Length1",10,2,40,2);
Length2 = Param("Length2",20,1,39,2);
Length3 = Param("Length3",9,1,20,1);

// The Moving Average Convergence Divergence calculations
MACD1 = 100 * (DEMA(C,Length1)-DEMA(C,Length2))/C;
MACD2 = DEMA(MACD1,Length3);
MACD3 = MACD1-MACD2;
Plot( Close, "Price", colorBlack, styleCandle );
GraphXSpace = 5;

// Plot the MACD lines.
Plot(MACD1,"MACD1",colorGreen,styleLine|styleLeftAxisScale,-1,1);
Plot(MACD2,"MACD2",colorBlue,styleLine|styleLeftAxisScale,-1,1);
Plot(MACD3,"MACD3",colorRed,styleLine|styleLeftAxisScale,-1,1);
Plot(0,"",colorRed,styleLine|styleLeftAxisScale,-1,1);

0 comments

Leave Comment

Please login here to leave a comment.