TradingView
HPotter
Jul 7, 2014 4:09 AM

Z-Score 

Description

The author of this indicator is Veronique Valcu. The z-score (z) for a data
item x measures the distance (in standard deviations StdDev) and direction
of the item from its mean (U):
z = (x-StdDev) / U
A value of zero indicates that the data item x is equal to the mean U, while
positive or negative values show that the data item is above (x>U) or below
(x Values of +2 and -2 show that the data item is two standard deviations
above or below the chosen mean, respectively, and over 95.5% of all data
items are contained within these two horizontal references (see Figure 1).
We substitute x with the closing price C, the mean U with simple moving
average (SMA) of n periods (n), and StdDev with the standard deviation of
closing prices for n periods, the above formula becomes:
Z_score = (C - SMA(n)) / StdDev(C,n)
The z-score indicator is not new, but its use can be seen as a supplement to
Bollinger bands. It offers a simple way to assess the position of the price
vis-a-vis its resistance and support levels expressed by the Bollinger Bands.
In addition, crossings of z-score averages may signal the start or the end of
a tradable trend. Traders may take a step further and look for stronger signals
by identifying common crossing points of z-score, its average, and average of average.
Comments
Algokid
Great stuff Porter...this will be very useful for statistical arbitrage. Thanks for sharing
HPotter
You are welcome
HolRiz
Thanks @HPotter !

Can you clarify this: "identify common crossing points of z-score" ?

Any example scripts of this anywhere? :)
Captain_intrigue
I’d like to hire you to modify this script for me. I have an idea for modifying this z-score indicator to trigger alerts based on a change of direction of z-score. For example; if z-score if below a certain threshold at -2 and dropping, if it changes direction upward after the next time interval then a green line is displayed and can be used for an alert. Would you be interested in this? I can provide more details.
goldenylion
Sixth line: I guess the formula should be z=x-U/StdDev?
Ty for your attention
Alberto
cooney_s
Thanks. Very useful indicator! Could you possibly Normalize the data into price bars in a lower panel?



More