You are on page 1of 11

Take the

Bond Challenge!
Use the IBKR Bond Scanner to compare
available yields against those of your broker.

Start Trading Today!


Interactive Brokers Rated #1
Best Online Broker 2019 by Barron’s* ibkr.com/comparechallenge

Member - NYSE, FINRA, SIPC – Supporting documentation for any claims and statistical information will be provided upon request. *Interactive Brokers
rated #1, Best Online Broker according to Barron’s Best Online Brokers Survey of 2019: February 25, 2019. For more information see, ibkr.com/info
Barron’s is a registered trademark of Dow Jones & Co. Inc.
03-IB20-1280CH1278
Because you
can never have
too many
PowerTools

17 is Here
Featuring the NEW OptionScope™
and QuoteCenter™ PowerTools
Discover the latest features at metastock.com/whats-new
Stocks & Commodities V. 35:06 (14–19): Gain Probability Index by Mike B. Siroky, MD

Gains vs. Losses

Gain Probability Index


You have to know (or estimate) your probability of gain and gain on each spin of the wheel and since there are six red
your payoff odds before entering a trade, but how do you slots out of every 10 slots, the probability of red — p — is
estimate gain probability and payoff odds? Let’s find out. 0.6 and the probability of black — q — is 0.4. Under these

I
conditions, if you were to bet $2 on red 100 times, you would
by Mike B. Siroky, MD place at risk $200 and you can expect to win $1.00 x 60 wins
Wheel: RVECTOR/BINARY CODE: ALENA AKMETOVA/

and lose $2.00 x 40 losses for a net loss of $20.00. You can
magine a roulette wheel that has six red slots for say that your expectancy for red is -10%.
SHUTTERSTOCK/COLLAGE: JOAN BARRETT

every four black slots. If red comes up, the payoff is Of course, due to chance, there will be some variance of this
$3 to $2 while if black comes up, the payoff is $4 to result. If you were to do the 100 spins a hundred times, you
$2. Should you bet on red, black, or not bet at all? could calculate the standard error of the expectancy, which is
the standard deviation/square root of n. For a binomial situ-
What’re the odds ation with more than about 30 trials, the standard deviation
With the payoff information you know the payoff odds. They can be estimated as √(npq) where n = number of trials, p is
are 3:2 and 2:1. But you also need to know the probability of gain probability, and q is loss probability. In this example, the

Copyright © Technical Analysis Inc. www.Traders.com


Stocks & Commodities V. 35:06 (14–19): Gain Probability Index by Mike B. Siroky, MD
MONEY MANAGEMENT

standard deviation is √(100*0.6*0.4)= 4.90 and the standard 3. The results must be independent, that is, the event has
error is 4.9/√100 or 0.49. So the 95% confidence limit for wins no “memory.”
would be 60 ± 0.98 or approximately between 59 and 61 and
the 95% confidence limit for losses would be 40 ± 0.98 or However, stock prices rarely act in accordance with the above
approximately between 39 and 41. assumptions (see The (Mis)behavior Of Markets by Benoit
If you were to bet $2 on black 100 times, again you have Mandelbrot in “further reading” at end). Here’s a look at
risked $200 and you can expect to win $2.00 x 40 wins and why not:
lose $2.00 x 60 losses for a net loss of $40.00. You can say that
your expectancy for black is -20%. The standard deviation is 1. Daily stock price changes are not strictly binary since
again √(npq) = 4.90 and the standard error is 0.49. closing prices may be unchanged. Over the last 20 years,
Clearly, both red and black are poor bets so we should not SPY had 41 or 0.8% daily bars that were unchanged
bet at all. Betting on red, you can expect to lose 10% of your from the prior bar. Over the last 100 years (1914–2014),
capital every 100 trials. Betting on black, you can expect to the Dow Jones Industrial Average (DJIA) has finished
lose 20% of your capital every 100 trials. If we had to bet, we unchanged 0.58% in more than 25,000 trading days.
should pick red. In this example, black has the higher payoff In contrast, a coin does not land on its edge at a rate of
odds, but this is offset by a lower probability of winning and one half of one percent, which would be five times in
thus red has the higher expectancy. However, in this example, 1,000 flips.
both red and black are losing bets and over the long term you 2. Stock price changes are not well modeled by the “fair
will likely lose all of the money you are willing to risk. coin” analogy, which requires that heads and tails have
Similarly, you have to know (or estimate) your probability equal probability. Over the last 100 years (> 25,000
of gain and your payoff odds before entering a trade, but how trading days), I have found that the DJIA has closed up
do you estimate gain probability and payoff odds? about 53% of the time and down 47% of the time. For
a sample size of 25,000, the 95% confidence interval
Figuring it out should be from 49.4% to 50.6%. So there is a significant
The probability of an event is defined as its likelihood or chance long-term bias toward gaining days over declining days
of occurring, expressed as a ratio between zero and 1. There (or heads over tails).
are three commonly used methods to estimate probability: Furthermore, the mean daily return is 0.02% while
the median daily return is 0.046%. When the mean
1. Historical performance: Determine the historical fre- is less than the median, it usually indicates a skewed
quency of the event of interest and set this equal to its distribution and there are more values in the right tail
current probability. For example, to estimate the prob- than the left tail. This is confirmed by a skew reading
ability of winning the state lottery, divide the number of -0.54%. For a normal distribution, the skew should
of winning tickets sold in the past by the total tickets be zero. A negative skew indicates that there are fewer
sold in the past. Note that it is assumed prior results will values in the left tail than the right.
carry forward into the future. Finally, and most important, the kurtosis of the daily
2. Mathematical modeling: If the event of interest has returns over the last 100 years of trading in the DJIA
a known mathematical model, you can calculate the stocks is 22.88; this Excel calculation of excess kurtosis
probability from the frequency distribution or relevant should be zero for a normal distribution. So this tells us
equation. For example, flipping a fair coin is often mod- that there are very “fat tails” that encompass far more
eled using the well-known binomial distribution. “rare” events than a normal distribution would allow.
3. Computer simulation: A computer can run multiple 3. While the coin has no memory, market prices ap-
trials and determine the frequency distribution for the parently do have some memory (sometimes called
event of interest (Monte Carlo simulation). However, persistence). There are four possible combinations of
computer simulation requires a mathematical model up/down over any two-day period (UpUp, UpDown,
from which to draw random samples. DownUp, DownDown). Therefore, you would expect
two up days to occur 25% of the time and two down
For example, assume you will use the binomial distribution days to also occur 25% of the time. However, over the
to determine the probability of a winning stock trade. This past two years, SPY has been up two days in a row 31%
requires that several assumptions be met: of the time and down two days in a row only 19% of
the time. Over the past 100 years, the DJIA has been
1. The results must be binary—either heads or tails, win up two days in a row 28.6% and down two days in a
or lose. row 23.3%. For three days in a row, there are eight pos-
2. The results must be random—here, the term “random” sible combinations, which means this could occur with
is used to mean that the outcome of a trade cannot be a frequency of 12.5% (or 1/8). In reality, it occurred
predicted with anything close to certainty. in the DJIA series 14.96% while three down days in a

Copyright © Technical Analysis Inc. www.Traders.com


Stocks & Commodities V. 35:06 (14–19): Gain Probability Index by Mike B. Siroky, MD

row occurred 11.3%. These results give a p value


< 0.01 by the chi square test. 184.5
184.0
183.5
183.0
182.5

So there is strong evidence of persistence in stock 182.0


181.5
10 Day Period
trades that would not be expected from flipping a
181.0
180.5
180.0

“fair coin.” 179.5


179.0

Clearly, assuming that stock prices will act similarly


178.5
178.0

to a “fair coin flip” will lead to significant error and


177.5
177.0
176.5

this makes it necessary to measure the probability of


176.0
175.5

gain over any time window of interest. This article


175.0
174.5
174.0

will discuss how to develop a simple gain probability


16 Jan 17 Jan 21 Jan 22 Jan 23 Jan 24 Jan 27 Jan 28 Jan 29 Jan 30 Jan 31 Jan 3 Feb 4 Feb 5 Feb 6 Feb 7 Feb 10 Feb 11 Feb 12 Feb 13 Feb

index based on historical performance and investigate


90

STOCKCHARTS.COM
70

its utility for technical analysis.


50
30
10

Gain probability index (GPI) 16 Jan 17 Jan 21 Jan 22 Jan 23 Jan 24 Jan 27 Jan 28 Jan 29 Jan 30 Jan 31 Jan 3 Feb

FIGURE 1: UP DAYS AND DOWN DAYS. For SPY, the more recent 10-day period of the 20
4 Feb 5 Feb 6 Feb 7 Feb 10 Feb 11 Feb 12 Feb 13 Feb

To estimate gain probability, use historical performance trading days shown is highlighted in gray. The one-day RSI shows there are seven up days
over any sample period of time. Plotting a moving and three down days. The 10-day simple moving average is 70.
series of the number of up bars divided by the sum
of up bars and down bars for a time period of n bars
gives you the gain probability index or GPI. Unlike with However, Wilder’s relative strength index (RSI) is widely
momentum indicators, the GPI is not based on the amount of available and provides a means of plotting an indicator that
price change but rather on the number of bars participating in emulates GPI:
price advances compared to the number of bars participating Recall that Wilder’s RSI is:
in price declines.
For a period of n bars with price change <> 0, For n bars, RSI = 100 - 100 / (1+RS) (2)

GPI = 100 * [(number up bars) / where RS = [sum of up change] / [sum of down change].
(number up bars + number down bars)] (1) Suppose n=1, which means only a single bar needs to be
considered. If the bar is down, there is no up change and RS=0
GPI is calculated in several steps: and therefore RSI=0.
If the bar is up, down change is zero so the denominator of
1. For any period of n bars, sum the number of up bars [UP] RS becomes zero. Dividing by zero is infinity, so the charting
and sum the number of down bars [DN]. Unchanged bars software evaluates this as RSI=100. Thus, for a one-bar RSI,
are ignored, so the number of trials is n = [UP + DN] there are only two possible outcomes: RSI = 0 or RSI =100.
2. Find the ratio [UP/n or equivalently, UP/(UP+DN))] Figure 1 shows a chart of the SPY with a one-bar RSI
3. Multiply the result by 100. plotted. The RSI oscillates between zero and 100. During
the 10-day period highlighted, there are seven up days and
three down days. Plotting a 10-day simple moving average
A GPI of 50 means the number of up bars and down bars of the RSI(1) gives a ratio of up days to total days, which in
is equal. The odds of gain versus decline are 1:1, or, the prob- this case is 70. In most software programs, the RSI calcula-
ability of gain is 0.5. tion ignores the unchanged bars just as GPI would. The GPI
The GPI is not available in most software trading platforms. calculation specifically ignores unchanged bars because we
want the probability of wins and the probability of losses to
add up to 1.
The GPI emulates a market
breadth indicator, showing the GPI as a standalone indicator
The GPI is extremely useful by itself since it acts similarly to
percentage of bars participating a market advance/decline indicator, except that it applies to a
(or not participating) in any price specific stock or other tradable asset. The GPI thus emulates
movement over a given period of a market breadth indicator, showing the percentage of bars
participating (or not participating) in any price movement over
time. It also gives the probability a given period of time. Finally, the GPI gives the probability
of a gain versus a loss over any of a gain versus a loss over any given period of time.
given period of time. Figure 2 shows a five-year period of SPY price action along
with a 200-day GPI and a 200-day moving average of price.
Note the following:

Copyright © Technical Analysis Inc. www.Traders.com


Stocks & Commodities V. 35:06 (14–19): Gain Probability Index by Mike B. Siroky, MD

1. From March 2012 to mid-2014,


the 200-day GPI stayed well 230
225
above 50. 90 220

2. Peaks in GPI approximately mir-


215
210

ror price peaks with much less lag


205
200

than a 200-day moving average


70 195
190
(dark green). 185
180
3. A major divergence occurred 50
175
170
between GPI and price at the end 165

of 2014 and extended into 2015 as


160
Non-confirm price 155

indicated by the trendline. 30 150


145

4. In November 2015, GPI fell below 140


135
50 well before the early 2016 10
130
125
decline in price. 120

5. GPI resumes its upward trajec-


115
M A M J J A S O N D 13 F M A M J J A S O N D 14 F M A M J J A S O N D 15 F M A M J J A S O N D 16 F M A M J J A S O N D 14 F
tory in March 2016, confirming FIGURE 2: GPI AS A STANDALONE INDICATOR. On this five-year chart of SPY, you see the price action along
the crossover above the 200-day with the 200-day GPI and a 200-day moving average of price. Note that the lag is much less than that of the
moving average. 200-day moving average (dark green). Also note the divergence between GPI and price at the end of 2014 and
into 2015 as indicated by the trendline.

Estimating expectancy of
a trade
Recall the roulette wheel from the beginning of this article. We Substituting equations 5 and 6 into equation 4 gives us:
needed to know both the probability of winning and the payoff
ratio. The GPI gives us an estimate of the probability of a gain RSI * (100-GPI)
on any trade, but how can we estimate the payoff ratio? Payoff odds = (7)
(100-RSI) * GPI
Method 1: Use a spreadsheet over any time period n to find
the ratio sum of up changes/number of up bars and sum of From equation 7 it can be seen that if RSI is higher than
down changes/number of down bars. In other words, calculate GPI, the payoff odds are going to be higher than 1:1.
the average gain and average loss over time period n bars. Equation 7 provides only an estimate of the true payoff
The payoff odds are the ratio of average gain divided by odds calculated by method 1 using a spreadsheet. This is due
average decline. entirely to the fact that RSI by tradition incorporates Wilder’s
smoothing rather than raw data.
Payoff odds = [UP/u] ÷ [DN/d] (3) Here’s an example. On May 15, 2014 Apple (AAPL) had
a GPI of 50 and RSI of 58 for a period of n=64 daily bars.
where The estimated payoff ratio is 58/42 * 50/50 = 1.38. Does that
UP = sum of up price changes and u = number of up bars. DN = mean buy, sell, or not trade?
sum of down price changes and d = number of down bars.
• Expected profit: 0.50 win probability × 1.38 payoff
Note that n=u+d. This equation can be rewritten as: odds = 0.69
Payoff odds = [UP/DN] * [d/u] (4) • Expected loss: 0.50 loss probability × 1.00 payoff odds
= 0.50
Method 2: Instead of using a spreadsheet, apply Wilder’s • Net position: 0.69 - 0.50 = 0.19 profit for every dollar
RSI and GPI. Recall that Wilder’s RSI is derived from the risked
total gains divided by the total losses over any given time
period. Therefore,

[UP/DN] = RSI ÷ (100-RSI) (5)


These simple calculations show
For example, if RSI = 75, the UP/DN ratio is 75/25 or 3 to 1.
The second term in EQN 4 is d/u and can be calculated
the power of knowing both the
directly from GPI as: probability of gain and the payoff
odds to calculate expectancy.
d/u = (100-GPI) ÷ GPI (6)

Copyright © Technical Analysis Inc. www.Traders.com


Stocks & Commodities V. 35:06 (14–19): Gain Probability Index by Mike B. Siroky, MD

In this example, the gain probability


Positive payoff 231 is low at 0.41, but the payoff ratio is 1.5,
making the trade somewhat profitable at
230
90 229

12.5% expectancy.
228
227
Negative payoff
These simple calculations do not consti-
226
225
70
tute a complete trading system. However,
224
223

they show the power of knowing both the


222
221

probability of gain and the payoff odds to


220
50
219

calculate expectancy. By using GPI and


218
217

RSI, this can be determined for any stock


216
30 215

on any day for any time period.


214
213

Expectancy can be calculated as:


212
211
10 210
209
208
E = pb – q (8)
15 22 29 Sep 6 12 19 26 Oct 10 17 24 Nov 7 14 21 28 Dec 5 12 19 27 2017 9 17 23 30Feb 6

FIGURE 3: SPY DURING A RECENT SIX-MONTH PERIOD. The green line is a 16-day RSI and the purple
line is a 16-day GPI. The heavy green line is the 200-day moving average.
where expectancy is E, p is probability of
gain, q is probability of loss or (1-p), and b
is payoff odds. So p=GPI/100 and q=(100-
Note that even though the probability of winning is only GPI)/100 or (1-GPI/100) while b=payoff odds is given in
50%, the payoff on the wins is higher than the drawdown on equation 7. Substituting these quantities into equation 8 and
the losses resulting in a net positive expected profit of 19%. rearranging terms gives:
Here’s another example. On May 16, 2014 Rackspace Host-
ing (RAX) jumped 17%. For n=64 days, GPI is 41 and RSI E = (RSI / (100 - RSI) - 1) *
is 51. The payoff ratio is thus 51/49 * 59/41 = 1.50. Does that (1 - GPI/100) (9)
mean buy, sell, or not trade?
Keep in mind that expectancy E is not a prediction of future
• E xpected profit: 0.41 win probability × 1.50 payoff ratio prices. It is simply a mathematical estimate of what would be
= 0.615 expected to happen if a trade with gain probability (p), loss
• Expected loss: 0.59 loss probability × 1.00 payoff ratio probability (q), and payoff ratio (b) were executed multiple
= 0.59 times. There is, of course, going to be some variance around
• Net position: 0.615–0.59 = 0.125 profit for every dollar the expected value.
invested or 12.5%.
Combining GPI with RSI
If the simple random-walk model were correct, stock prices
would meander up and down with equal probability and
3.00
GPI vs calculated payoff odds breakeven line focus line Start Current
equal step size only to end up where they started. But this
is not the case. Stock prices move up or down over extended
periods of time and these trends are due to two components
of movement—probability of gain, which is greater or less
than 0.5, and the payoff odds greater or less than 1:1. The
2.00 probability represents the likelihood the step will occur to
the right or left, up or down. The payoff odds represent the
Probability Ratio

ratio of step size. These two components may or may not be


in sync. GPI estimates gain probability while RSI estimates
payoff odds. So if both RSI and GPI are above 50 and RSI is
1.00 greater than GPI, the probability of gain is better than 50%
and the payoff ratio is better than 1:1. Both components are
in sync and favor further gains in price. If RSI and GPI are
both below 50 and RSI is lower than GPI, they are in sync to
the downside and a negative expectancy will be found.
0.00 Figure 3 shows SPY over a six-month period ending on
0.00 1.00 2.00 3.00
Payoff Odds February 10, 2017. The green line is a 16-day RSI and the
purple line is a 16-day GPI. The heavy green line is a 200-day
FIGURE 4: PAYOFF AND PROBABILITY. Over a recent 12-month period, for
the SPY, the 10-day average payoff ratio is plotted against the 10-day average
moving average. Note the following:
probability ratio, which is p÷q. The brown line is the breakeven line that denotes
where expectancy = 0. 1. In late 2016, RSI tracked lower than GP indicating a

Copyright © Technical Analysis Inc. www.Traders.com


Stocks & Commodities V. 35:06 (14–19): Gain Probability Index by Mike B. Siroky, MD

negative payoff ratio. This changed to a positive payoff 2. The graph breaks above the breakeven line on the prob-
ratio after the November election. ability side.
2. RSI has remained equal to or above GPI since Novem- 3. After months of back and forth, the graph breaks into
ber 6, 2016. the payoff side and moves steadily away from the
3. The six months ending February 10, 2017 produced breakeven line.
a 7.27% gain in SPY. From low to high there was an
increase of approximately 11%. Mike B Siroky, MD is a retired surgeon living in Phoenix, AZ.
He has more than 25 years of investment experience and is
In Figure 4, the 10-day average payoff ratio is plotted against particularly interested in quantitative technical analysis.
10-day average probability ratio, which is p/q, for the SPY over
a 12-month period ending in February 2017. The brown line Further reading
is the breakeven line, or where expectancy equals zero. The Mandelbrot, Benoit, and Richard L. Hudson [2006]. The
green focus line breaks the space into two segments: above (Mis)behavior Of Markets: A Fractal View Of Financial
the focus line indicates probability is dominant, below the line Turbulence, Basic Books.
indicates payoff is dominant. Note the following:

1. The starting point is below the breakeven line, indicating


a negative expectancy.

Copyright © Technical Analysis Inc. www.Traders.com


Powerful Signals for Stocks & Commodities

Long Term & Short Term

Works with stocks, commodities, futures, options, FOREX, bonds for intra-day or position trading
Triple Confirmed Buy/Sell Signals

Traders Rave Over AbleTrend

SINCE 1994
ABLETREND 7.0 COLLECTED BY

Test-drive it to See All the Signals!

THESE RESULTS ARE BASED ON SIMULATED OR HYPOTHETICAL PERFORMANCE RESULTS THAT HAVE CERTAIN INHERENT LIMITATIONS. UNLIKE THE RESULTS SHOWN IN AN ACTUAL PERFORMANCE RECORD, THESE RESULTS DO NOT
REPRESENT ACTUAL TRADING. ALSO, BECAUSE THESE TRADES HAVE NOT ACTUALLY BEEN EXECUTED, THESE RESULTS MAY HAVE UNDER-OR OVER-COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS
LACK OF LIQUIDITY. SIMULATED OR HYPOTHETICAL TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY
ACCOUNT
ACCOUN WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THESE BEING SHOWN. THE TESTIMONIAL MAY NOT BE REPRESENTATIVE OF THE EXPERIENCE OF OTHER CLIENTS AND THE TESTIMONIAL IS NO GUARANTEE
OF FUTURE PERFORMANCE OR SUCCESS. TECHNICAL ANALYSIS OF STOCKS & COMMODITIES LOGO AND AWARD ARE TRADEMARKS OF TECHNICAL ANALYSIS, INC.
Traders take many paths to reach their destination.
Can your platform get you there?

Search apps and services to personalize the


NinjaTrader platform to meet your requirements.
Indicators, automated strategies, free tools & more.

Explore now at ninjatraderecosystem.com

Futures, foreign currency and options trading contains substantial risk and is not for every investor. Only
risk capital should be used for trading and only those with sufficient risk capital should consider trading.
subscribe or renew today!
Every Stocks & Commodities subscription
(regular and digital) includes:
• Full access to our Digital Edition
The complete magazine as a PDF you can download.
• Full access to our Digital Archives 8999
1 year.................
$
That’s 35 years’ worth of content!

2 years............ 149
• Complete access to WorkingMoney.com $ 99
The information you need to invest smartly and successfully.

3 years............ 199
• Access to Traders.com Advantage $ 99
Insights, tips and techniques that can help you trade smarter.

PROFESSIONAL TRADERS’ STARTER KIT


A 5-year subscription to S&C magazine that includes
everything above PLUS a free* book, Charting The Stock
Market: The Wyckoff Method, all for a price that saves
you $150 off the year-by-year price! *Shipping & han-
dling charges apply for foreign orders.

5 years..........
$
29999
That’s around $5 a month!

Visit www.Traders.com to find out more!


Email: Circ@Traders.com • Phone: 206-938-0570 facebook.com/STOCKSandCOMMODITIES @STOCKSandCOMM

You might also like