## Using the z score to determine trade size and boost performance

##### 2019-01-11 11:08   forextraders

Suppose that we have a trading method which gives us great confidence, produces satisfactory results over a long time, and which refined through a long period of study and experimentation. We are aware of the risks of high leverage, and do not gamble by entering trades which do not fully meet our requirements. We are pleased with our results, but still unsure about how much we should risk. What can we do to solve this problem?

What does a streak of wins or losses mean?

One of the major issues with any trading method is the length and frequency of streaks of wins or losses. A win streak is a period during which consecutive gains are registered in an account, and a loss streak is the opposite. What kind of bearing do these series of wins and losses have for trade sizes? Obviously, if a style generates wins and losses in streaks, the results are not independent of each other. A profitable trade is suggesting the likelihood that there will be more gains in case the trader increases his position size. Conversely, if a loss warns us that it will be followed by more losses, and we should discard our original approach and seek our wealth at other occasions. In other words, heads in one flip tells us that following coin tosses will bring us more heads, and tails will lead to more tails in subsequent trials. This knowledge may allow us to increase the size of our position with reasonable confidence, or to eliminate it in the case of loss.

The z-score

Z-score is the mathematical tool used for calculating the capability of a trading system for generating wins and losses in streaks. The simple formula allows us to test our performance, and to check if the streaks generated present a random pattern or not. If the pattern is random, or at a non-significant confidence level, our results are independent of each other, and there’s no point in trying to scale in, or build up a position in successive trades. On the other hand, if our strategy is prone to generating streaks in a non-random fashion, we can use this knowledge to maximize our profits.

The formula of the z-score is

Z=(N*(R-0.5)-P)/((P*(P-N))/(N-1))^(1/2)

where:

N – total number of trades in a series (for example, in a string of (+++—-++—-++) we have 15 trades (++++), and the N is 15 )

R – total number of series of profitable and losing trades (if we have a run for our method, and we have a string of (+++—-++—-++), there are five series S1(+++), S2(—), S3(++), S4(—-), S5(++). So R is 5)

P = 2*W*L;

W – total number of profitable trades in the series;

L – total number of losing trades in the series.

A series is simply an unbroken string of wins or losses. For examples, (++++) is a series, as is (—), but (+-+) is not.

So all that we need to do, in order to understand if our strategy allows us to repeat our profits or losses in a non-random way, is to check its z-score, and to compare this to a series of numbers which we will call the confidence level. The confidence level is simply the normal distribution equivalent of the z-score we receive from our tests. If this sounds complicated, all that the trader needs to know is that in order to be considered suitable for profit maximization in money management methods our test must produce results that are greater than 1.96 or less than -1.96 (corresponding to the 95 percentile of normal distribution).

Z-Score

 Confidence Limit (%) 3.00 99.73 2.58 99.00 2.33 98.00 2.17 97.00 2.05 96.00 2.00 95.45 1.96 95.00 1.64 90.00

Let's calculate the z-score for the above string of trades (+++—-++—-++).

Z=(N*(R-0.5)-P)/((P*(P-N))/(N-1))^(1/2)

Z=(15*(5-0.5)-112)/((112*(112-15))/(15-1))^(1/2)

Z=(-44.5)/27 = -1.64

We check the result on the above table and see that 1.64 corresponds to a 90 percent confidence level. This means that our results, while good, are not ideal in statistical terms, and we should be cautious in applying money management strategies to maximize our profits.

An example with a good z-score.

Below, we examine the case of a good z-score, and how it compares with an ordinary method. 