Skip to main content

Normalized difference for Amibroker (AFL)

danice about 15 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:
    amibroker

Normalized difference for pair trading (like z-score)

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("normalized_diff");

Ticker = ParamStr("Short ticker", "?");
tickersc = Foreign( ticker, "C");

ticker2 = C;

d = abs(C/tickersc);

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();

0 comments

Leave Comment

Please login here to leave a comment.