03 August 2011

Z-Score Indicator

Z-Score Indicator
The Z-Score indicator is used in statistics to determine how far a data element is from the mean.

68% of a given dataset will be 1 standard deviation from the mean or +-1 from the mean. 94% of a given dataset will be +-2 standard deviations from the mean.

This would tell us that if a value in a sample (stock price in for this discussion) is beyond +-2 standard deviations from the mean it would be considered an anomaly or to use other stock technical analysis terms overbought or oversold. This would also tell use that typically 68% of the data should fall within +-1 standard deviation from the mean, in other words moving beyond +-1 standard deviation can prove to be the acceleration of a trend (or jump in price) that may soon reverse.


The chart of the S&P 500 below shows when the Z-Score indicator could have been applied to determine if the trend was about to change.
Z-Score Indicator

How to Plot: Select the Z-Score indicator from the drop down box as shown below. Enter the number of days in the parameter box to the right of the indicator.
Z-Score Indicator

How To Use: Use the Z-Score indicator with indicators such as Momentum and RSI to confirm the turning point in stock prices based on a +-1 or +-2 standard deviations.

If you are an AMIBroker user you can download this formula from the AMIBroker site.

MTR Investors Group - www.MTRIG.com

Statistical Z-Score Indicator: Tracks how many standard
deviations the price is from the mean.

For more information on this indicator see the links below.

MTRIG - Reference

Z-Score Trader's Notebook Article

AMIBroker forumula on Traders.com

Z-Score in Wikipedia

periods = Param( "Period", 20, 1,3, 1);

ZScore = ( Close - MA( Close, periods ) ) / StDev( Close, periods );

Plot(ZScore, "Z-Score", colorDarkGrey );
Plot(2, "2", colorBlueGrey);
Plot(0, "0", colorBlueGrey );
Plot(-2, "-2", colorBlueGrey);

//3 Gradient Color

_SECTION_BEGIN("3 color gradient");


pxwidth = Status("pxwidth");
pxheight = Status("pxheight");

chartwidth = pxwidth-priceAxesWidth;
chartheight = pxheight-dateAxesHeight;

topColor=ParamColor("topColor",ColorRGB(207,254,240) );
centerColor=ParamColor("centerColor", ColorRGB(249,236,164));
botColor=ParamColor("BottomColor", ColorRGB( 253,223,196));
priceAxesColor=ParamColor("priceAxesColor", colorWhite );
dateAxesColor=ParamColor("dateAxesColor", colorWhite);


GfxSetBkMode( 1 );
GfxGradientRect(0,0,chartwidth,TitleHeight, colorWhite ,colorWhite);
GfxGradientRect(chartwidth,0,pxwidth,pxheight, priceAxesColor
GfxGradientRect(0,chartheight,chartwidth,pxheight, dateAxesColor
GfxGradientRect(x0,y0,x1,y1, CenterColor ,CenterColor );
GfxGradientRect(0,TitleHeight,chartwidth, y0,topColor, CenterColor );
GfxGradientRect(0,y1,chartwidth, chartheight, CenterColor ,botColor);


No comments:

My Blog List

Total Pageviews

Search This Blog