Stocks & Commodities V. 23:1 (39-45): Sidebar: Runs tests, Z score by Norman J. Brown
Here are calculations for the approximate derivation of the Z score. Suppose you have a run sequence xx/yyyy/x/yy/xxx/y/x/y
x is an up day or positive return
y is a down day or negative return
This series has N=15, with eight streak runs (OR trades), and four switches (OR round trips).