Skip to main content

Z SCORE COLOR CODED for Amibroker (AFL)

sahasra about 15 years ago Amibroker (AFL)

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

Z SCORE INDICATOR COLOR CODED TO IDENTIFY EASILY OVER BOUGHT AND OVER SOLD..

Screenshots

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("ZSCORE");
periods = 20;
ZScore = ( Close - MA( Close, periods ) ) / StDev( Close, periods );
color = IIf( ZSCORE >=3.0, ColorRGB(255,0,0),IIf( ZSCORE >=2.75, ColorRGB(0,255,0),IIf( ZSCORE >=2.5, ColorRGB(0,0,255),
IIf( ZSCORE >=2.25, ColorRGB(240,200,13),IIf( ZSCORE >=2,ColorRGB(255,22,160),IIf( ZSCORE >=0,ColorRGB(126,126,184),

IIf( ZSCORE <=-3.0, ColorRGB(255,0,0),IIf( ZSCORE <=-2.75, ColorRGB(0,255,0),IIf( ZSCORE <=-2.5, ColorRGB(0,0,255),
IIf( ZSCORE <=-2.25, ColorRGB(240,200,13),IIf( ZSCORE <=-2,ColorRGB(255,22,160),ColorRGB(126,126,184))))))))))));

Plot( ZScore, "ZScore",color, ParamStyle("Style",styleHistogram |styleThick|styleNoTitle ,maskAll) );
Plot(2, "2", colorBlueGrey,4096);
Plot(0, "0", colorBlueGrey,4096 );
Plot(-2, "-2", colorBlueGrey,4096);

_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.