Skip to main content

MACD Normalized System for Amibroker (AFL)

Tinych over 14 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 9)
  • Tags:
    oscillator, trading system, amibroker

The system is based on Normalized MACD indicator, it looks like MACD – %-normalized created for MetaStock by Jose Silva .

The indicator oscillates from 0 to 100. Buy signal occurs, when indicator crosses the level 5 and sale signal starts when it crosses level 95. The trigger red line is the same, as at usual MACD.
The parameters of the indicator can be change over a wide range. Sound alert starts when buy/sell signals occur.

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("MACD normalized");

sma = Param("short EMA periods",12,1,21);

lma = Param ("long EMA periods",21, 2, 2520);

tsp = Param ("MACD trigger signal periods",9,1,21);

np = Param ("normalizing periods (1=none)", 50,1, 2520);

x = Param ("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6",4,1,6);

x = IIf (x==1,Open, IIf (x==2,High, IIf (x==3,Low, IIf (x==5, Volume, IIf (x==6,C,C)))));

sh = EMA(x, sma);

lon = EMA(x, lma);

ratio = Min(sh,lon)/Max(sh,lon);

Mac = (IIf (sh>lon,2-ratio,ratio)-1)*100;

MacNorm = (Mac-LLV(Mac, np)) /(HHV(Mac, np)-LLV(Mac, np)+.000001)*100;

MacNorm = IIf (np <2,Mac,MacNorm);

Trigger = EMA (MacNorm, tsp);

Hist = MacNorm-trigger;


Plot(MacNorm , " Signals ", colorGreen, styleLine, Null, Null, 0 );

Plot(Trigger, " Trigger ", colorRed, styleLine, Null, Null, 0 );

_SECTION_END();

Line1 = 5;
Plot( Line1, ",", colorTan); 
Line2 = 95;
Plot( Line2, ",", colorTan ); 

Buy = Cross(MacNorm, Line1);

Sell = Cross(Line2, MacNorm);



PlotShapes(IIf(Buy, shapeUpArrow , shapeNone), colorGreen);
PlotShapes(IIf(Sell, shapeDownArrow , shapeNone), colorRed);

AlertIf( Buy, "SOUND C:\\Windows\\Media\\Windows Vista Notify.wav", "Audio alert", 2 );
AlertIf( Sell, "SOUND C:\\Windows\\Media\\Windows Vista Notify.wav", "Audio alert", 2 );

4 comments

1. Tinych
over 14 years ago

The picture of the MACD Normalized System is: http://savepic.su/668328.htm

over 14 years ago

good indicatore i have searching for this long period thank you dude

3. Kevin
over 14 years ago

Thank You Thank You Thank….I too have been looking for this type of code for a long long time!!! Great work!!!

Leave Comment

Please login here to leave a comment.