Normalized diffrence for Amibroker (AFL)
Copy & Paste Friendly
_SECTION_BEGIN("normalized_diff");
ticker = ParamStr("Pair ticker", "?");
tsc = Foreign( ticker, "C");
ticker2 = C;
d = abs(C / tsc);
p = Param("Period",10);
nd = (d - MA(d,p)) / MA(d,p);
Plot(nd,"normalized difference",colorRed,styleLine);
Plot(0,"",colorBlue,styleLine|styleNoLabel);
_SECTION_END();