Written and copyright © 2008-2013 by Thomas N. Bulkowski. All rights reserved.
This page reviews the J. Welles Wilder relative strength index (RSI) and discusses testing of the indicator using a portfolio of stocks. You should
conduct your own research to verify this trading idea before relying on the results. Historical testing
may not reflect real-time trading and past performance does not guarantee future results. See Privacy/Disclaimer for more information.
Wilder's RSI: Summary
The RSI indicator shows that it beats the performance of the S&P 500 index 72% of the time (4,120 winners and 1,574 losing trades) over the same test period.
In the test, I included both bull and bear markets, where the bear market ranges from March 24, 2000 to October 10, 2002 and the bull market is everything else. The test
included data started from January 1990 and ending on May 18, 2008 and used 552 stocks held in a portfolio, but few stocks spanned the entire period.
A year by year breakdown of the results show the RSI beats the S&P in 13 out of 19 years. The indicator performed especially well during the bear market but draw downs
were severe. Using the RSI to trade is not for traders or investors that cannot stomach massive draw downs as the stock plummets and then rises back to the RSI sell signal.
The average hold time is about 5 months, so anything can happen during that time. To duplicate the results of this test in actual trading, you must be willing to hold onto
the stock, trading only when the RSI signals you to do so, and not because the value has dropped by 98.9% (as was the case in Sonus Networks, resulting in a loss of 94.7%).
Using a stop to stem the losses dramatically hurts performance. In other words, if you want to trade using the RSI, you should not use stops if you want the best performance,
but you must be willing to buy and hold.
Variations to improve performance showed the following.
- The best performance comes with using buy/sell thresholds of 50/85, with 14/18 day buy/sell look backs, but it requires an average hold time of 4.5 years. More recent and thorough testing
(with the gracious help of Tom Helget) showed that buying at a threshold of 61, selling at a threshold of 58, using a buy look back of 25, and a sell look back of 145 worked well
when the results were sorted according to the following rules:
- Each test must have at least 100 trades;
- Average hold time must be below 2 years (504 trading days);
- Losing trades must be below 40%;
- The average loss must be less than 15%;
- and the net percentage profit was the highest of the group.
- Placing an initial stop on the buy date hurts performance, but the maximum potential loss (max drop below the buy price) is cut 40%, to 58.9% from 98.1%.
- Using a trailing stop also hurts performance, but cuts the maximum loss nearly in half (to 53.3%)
- Since a stop hurts performance, it suggests the stock continues moving lower after buying, stopping you out so you miss the big winners.
- A stop loss order does not protect you from a dead-cat bounce or 9/11 scenario.
- As the sell threshold increases (default 70), the hold time, average profit per completed trade, win/loss ratio, and net profit increases.
Wilder's RSI: Background
The indicator discussed on this page is the relative strength index, created by J. Welles Wilder, and not industry, stock, or other types of relative strength. Background
for the indicator comes from an article in Technical Analysis of Stocks & Commodities magazine, September 1994 issue, page 77, written by Bruce Faber. Wilder discusses
the RSI in his book,
New Concepts in Technical Trading Systems,
but I have not read that text. My implementation of the RSI is based on the
RSI is a momentum indicator that compares the movement of price over time for a stock, index, or other security. It does not compare one stock with another. Faber writes
that "the RSI is most widely used among traders of commodities and futures." The article does not cite any survey to prove this assertion, but it sounds a note of caution.
I am testing the indicator in stocks, not commodities or futures.
The indicator compares the average price change of up closes to down closes and presents the results on a scale from 1 to 100. Faber writes that "Depending on the look back
period selected for a market, the RSI can be a leading indicator forewarning of changes in the trend of the market. If, however, the look back period is too short and the market
is in a persistent trend, then the RSI may indicate the end of a trend prematurely. Thus, you should consider looking for more technical evidence of a change in the trend
and not rely solely upon the RSI."
The default look back period is 14 days, but I found in a test years ago that 16 worked best for both buy and sell signals. Faber says that 9 and 25 days are also popular values
for the indicator. I tested variations to tune the results.
According to Wilder, signals above 70 indicate that the security is overbought and price may be nearing a top or a significant correction.
Readings below 30 mean the security is oversold and closer to a bottom or a signification bullish reaction. Both apply to charts on the daily or weekly scale. Faber says
that "some traders look for the RSI to top out at 60 during bear market rallies and to hold at 40 during bull market reactions." Then he mentions another use suggested by
Thomas A. Meyers in his book,
Technical Analysis Course.
It says to buy when the RSI crosses up over 50 and sell when it crosses down through 50, and for indices, a 21-week average
is best. It is unclear if the 21-week average replaces the 14-day look back or if it is a new smoothing technique that he is suggesting. I tested the 50/50 147/147 (147 = 21 week)
variation and found that it ranks near the bottom (worst) of the list. The reasons for this can be many (such as different data or RSI indicator implementation and weekly versus daily scales).
More recent testing has revealed that when sorting for more than just the percentage net profit, the results improve dramatically. It may be that Meyers included the draw down and other factors
when he settled on his results.
Faber makes an interesting comment when he writes that "Chart patterns are often observed on the plot of the RSI. Many times, support and resistance breakouts are shown
by the RSI before it becomes obvious in the price chart" (emphasis added). He shows a chart of Exploration Co. Louisiana (it no longer trades under XCL) from March 1993 to March 1994
in which price reaches bottom, moves up and then trends horizontally in mid January 1994. The RSI also moves horizontally, following overhead resistance, and breaks out
upward a few days before price begins its move up.
Divergence between the indicator and price shows when price trends one way and the indicator moves another. Faber says that "When the RSI
pattern diverges with the price chart pattern, chances are that the market will soon follow the RSI." He also talks about failure swings and I
discuss that pattern in the link.
According to the article, the formula for RSI comes in two parts: RS = (Average of X day's closes up)/(Average of X day's closes down). Then RSI = 100 - (100/(1+RS)).
X is the number of look back periods (14 is the default). Closes up is the price change of up closes (if today closed higher than yesterday, then use the difference between today's
close and yesterday's, otherwise use 0). Closes down is the actual price change on down closes (same idea as up closes but only tally when price closes lower than the previous
day). The article's sidebar shows a spreadsheet
example of the calculation and also discloses that Wilder used a smoothing technique on both the up and down closes: ((13*(prior up average)) + current up)/14, as an example
when the look back is 14 days. The same would apply to down closes. For different periods, replace 13 with the new look back minus 1 (example: for a 26 bar look back, use 25) and replace the
14 with the new look back value (26 in this example).
In words, calculate the change in up closes or 0 if the day closed lower. Calculate the change for down closes, or 0 if the day closed higher. Do this for 14 days and average
the up closes and down closes, separately. Then apply the smoothing formula to each, separately. The ratio of the two is RS and the rest of the formula is easy, just plug in RS to get RSI.
Wilder's RSI: Methodology
I only programmed the indicator as discussed in a sidebar to the Technical Analysis of Stocks & Commodities magazine article on page 82 and as discussed on this page.
For the test, I used 552 stocks from January 1990 to May 2008 but not all stocks covered the entire period. Here are the rules I followed.
- Buy when the RSI dropped below 30 and then climbed above it (because the stock can continue dropping when the RSI is less than 30).
- Sell when the RSI climbed above 70 and then dropped below it (because the stock can continue rising when the RSI is over 70).
- Look back was 14 days for both buys and sells.
- Portfolio size started at $2,000,000. This needed to be huge to accommodate the large number of trades without running out of money.
- Each trade was for no more than $5,000, including commissions.
- All trades were in round lots (no fractional shares) of at least 100 shares each.
- Commissions were $10 per trade ($10 for a buy and $10 for a sale).
- SEC fee was applied to all sales (not buys) at the current rate (as of May 2008) of $11/$1,000,000 of value.
- No slippage was factored into the trades since they occur at the opening price.
- Concurrent (multiple) open positions in a stock were not allowed.
- I placed no limit on the number of positions held open at one time.
- All trades occurred at the opening price the next trading day after a signal.
- Stocks priced less than $5 per share were excluded. This was necessary to prevent split adjusted stocks from causing trades at pennies per share in 1990.
- Commissions and SEC fee were applied to the S&P 500 index as if it were a stock.
- Dividends were not included in the study nor interest on cash balances, taxes, ECN fees and so on.
- Margin was not allowed.
- The test did not include stocks that went bankrupt, merged, or stopped trading for whatever reason.
Wilder's RSI: Results
The following table shows the results of the test (parameters: 30/70, 14/14, later referred to as the Benchmark). For example, starting with a portfolio size of $2,000,000, in 1990 there
were no trades left open and 134 completed trades. This
means that 134 buy signals occurred in 1990 and 134 sell signals occurred sometime in the future (whether or not in 1990). These are not mark to market results, nor annualized results.
A trade begun in June 1990 and ending in February 1991 would be included in this line. The reason for this is because RSI trades can be long term ones, so it is common for the trade to span
one year. Using mark to market would give inaccurate results.
The value of the portfolio after all trades begun in 1990 and completed sometime in the future, was $2,029,730.66, a change of 1.5%. If you were to buy and sell the S&P 500 index
on the same dates as the RSI trades, the portfolio would be worth $2,019,276.77, a change of 1.0%.
During the bear market of 2000 to 2002, the RSI did quite well in all three years, whereas the general market (S&P 500) fell. Remember that a trade begun in 2000 could have
completed in 2006 when the market was higher, inflating the bear market results.
The percentage change from year to year is small but so are the amounts traded: $5,000 per trade for a $2 million portfolio. When compared to the S&P 500,
the RSI portfolio outperformed the S&P in 13 out of 19 contests with the years 1995 through 1999 being difficult for the RSI portfolio (meaning it failed to beat the S&P).
Those holding periods measure from the date the stock was purchased and to the date each was sold.
Here is more information about the trades.
- Number of winning trades: 4,120
- Value of winners: $2,801,390.73
- Average profit per win: $679.93
- Number of losing trades: 1,574
- Value of losers: -$1,190,815.64
- Average drop per loss: -$756.55
- Number of open trades: 247
- Value of open trades: -$122,855.85
- Average Profit/loss (P/L) per open trade: -$497.39
- Value of S&P for open trades: -$19,993.17
- Average P/L per open trade for S&P: -$80.94
- Trades (wins+losses+opens): 5,941
- Profit/loss (wins+losses+opens): $1,487,638.24
- Average P/L per trade (wins+losses+opens): $250.40
- Change (wins+losses+opens): 74.4%
- Completed trades (wins+losses): 5,694
- Profit/loss (wins+losses): $1,610,494.09
- Profit/loss (wins+losses) for S&P: $962,991.02
- Average completed trade duration (wins+losses): 154 days
- Average P/L per completed trade (wins+losses): $282.84
- Win/loss ratio (wins+losses): 2.6
- Change (wins+losses): 80.5%
- Change (wins+losses) for S&P: 48.1%
- Change (wins+losses) for S&P (buy and hold: 01/24/1990 to 05/16/2008): 310.3%
- Maximum loss: -98.9% (maximum drop below buy price)
- Maximum profit: 191.6% (maximum rise above buy price)
Wilder's RSI: Variations
Before I discuss variations, let me thank Tom Helget for using his software to assist in my testing. His more thorough results are available here
as an Excel spreadsheet in compressed form. The sheet (Helget.xls) is sorted by the average profit per trade. The best performing have huge hold times (years), so keep that in mind. The test
data ranges from
January 1, 1990 to May 18, 2008 and used 552 stocks, the same ones in my portfolio. At the bottom of the spreadsheet are the column header definitions, and on the far right are
the settings tested. I also include three new RSI tests provided by Helget (Helget 1 to 3, with Helget 3 being the last test run). They drill down the data (from Helget 1.xls to 2 to 3)
after sorting the sheet by the average hold time, keeping losses below 40% and so on.
To improve performance, I tested a number of variations both in sample and out of sample. About half the tests use the first 100 stocks in my database, but some use more
to boost the number of completed trades.
I varied the threshold (30/70) and look back periods (14/14). I also included volatility stops of three varieties.
- Initial Stop: An initial volatility stop was calculated at the time of each buy. If the stock dropped below the stop loss, then
the trade exited at the opening price the next day instead of immediately (which is kind of weird, but think of it as an end-of-day trader with a mental stop loss order).
- Trailing Stop: A trailing volatility stop used the highest price starting from the buy date, following the stock each day until the stock dropped below the stop. The trade
exited the next day at the open. For example, if the stock reached $50 on Wednesday, a new high, then I recalculated the stop according to the rules for a volatility stop. If price
climbed to $51 then I recalculated a new stop and used that providing it was higher than the previous (the volatility calculation uses the low price, so it could result in a lower stop price).
If the stock dropped to 48, then the stop value remain unchanged.
- Initial and Trailing Stop: I set an initial stop and then used a trailing stop once price climbed at least 15% above the buy price. One test used 20% and one test used three times
the volatility instead of two in the stop calculation.
The following results are available in an Excel spreadsheet. Most of the columns are self-explanatory. The Years Beat is a count of the number of times
the net profit percentage beat the S&P 500 using the same hold times. This is out of a maximum of 19 years (1990 to 2008), ties were not included. The higher the number, the better.
|Z out of sample||20||80||16||14||352||$1,761.95||1993||15||3.7||29.7%||11.4%|
|G w/initial stop||30||80||14||14||100||$368.96||1995||13||0.3||23.0%||12.1%|
|C Initial & Trailing stop 15% 3x||30||70||14||14||100||$77.36||2007||13||0.9||7.6%||4.7%|
|A Initial stop||30||70||14||14||100||$63.02||2008||11||0.6||6.5%||4.3%|
|B Initial & Trailing stop 20% 2x||30||70||14||14||100||$60.26||2008||12||0.6||6.5%||3.9%|
|A Initial & Trailing stop 15% 2x||30||70||14||14||100||$48.19||2008||13||0.7||5.3%||3.6%|
|A Trailing stop (Worst)||30||70||14||14||100||$25.19||2008||10||0.7||3.0%||1.8%|
I sorted the above table by the average profit per completed trade (trades not still open). I do not like the open trades from before 1995, so I exclude the first few tests.
They are too much like buy and hold forever. That leaves test V with the highest profit per trade. I expanded the test and used 352 stocks not involved in the variation testing. It
appears as "Z out of sample." The numbers hold up well. Later I will give you the details of the Z test.
This is a continuation of the prior table. The rows are in the same order. The Max Profit column is a report on the stock with the highest rise after purchase and before
sale of the stock. The Max Loss column shows the maximum drop after purchase.
|Z out of sample||337||671||$2,496.44||-$989.79||527.3%||-97.3%|
|G w/initial stop||1,247||184||$3,192.49||-$467.53||763.3%||-58.9%|
|C Initial & Trailing stop 15% 3x||1,961||60||$733.64||-$535.56||130.2%||-59.6%|
|A Initial stop||2,058||57||$960.36||-$435.51||130.2%||-58.9%|
|B Initial & Trailing stop 20% 2x||2,153||48||$814.96||-$415.06||130.2%||-56.0%|
|A Initial & Trailing stop 15% 2x||2,182||45||$727.72||-$407.60||130.2%||-53.3%|
|A Trailing stop (Worst)||2,356||28||$530.81||-$306.90||130.2%||-53.3%|
Wilder's RSI: The Best Performer
The following table and information describes the performance of Test Z that has 20/80 and 16/14 settings, and uses out of sample data, meaning the data was not included when tuning the
RSI settings. Noticed in this out-of-sample test that a position from 1993 remains open. The in-sample test showed the oldest open trade occurred in 1998. The one closed trade in 2008,
so far, I describe in the next section (Trading Example).
- Number of winning trades: 266
- Value of winners: $664,052.42
- Average profit per win: $2,496.44
- Number of losing trades: 71
- Value of losers: -$70,275.00
- Average drop per loss: -$989.79
- Number of open trades: 88
- Open trade value: $6,767.46
- Average Profit/loss (P/L) per open trade: $76.90
- Value of S&P for open trades: $32,039.11
- Average P/L per open trade for S&P: $364.08
- Trades (wins+losses+opens): 425
- Profit/loss (wins+losses+opens): $600,544.87
- Average P/L per trade (wins+losses+opens): $1,413.05
- Change (wins+losses+opens): 30.0%
- Completed trades (wins+losses): 337
- Profit/loss (wins+losses): $593,777.41
- Profit/loss (wins+losses) for S&P: $228,038.53
- Average completed trade duration (wins+losses): 671 days
- Average P/L per completed trade (wins+losses): $1,761.95
- Win/loss ratio (wins+losses): 3.7
- Change (wins+losses): 29.7%
- Change (wins+losses) for S&P: 11.4%
- Change (wins+losses) for S&P (buy and hold: 01/26/1990 to 05/23/2008): 322.4%
- Maximum loss: -97.3%
- Maximum profit: 527.3%
Wilder's RSI: Trading Example
The figure shows a bar chart of Jo-Ann Stores (JAS) on the daily scale and the RSI indicator beneath that. The red bar is the overbought area at 80 and above.
The green bar is the oversold area at 20 and below. The red RSI line is the sell signal using a 14 day look back and the
blue line, which looks black on the chart, is the RSI buy signal line using a 16 day look back.
The top chart shows where the RSI moves into the overbought or oversold
areas by using vertical bars of red or green. These are not the buy and sell signals.
A buy occurs when the buy RSI line moves below 20 and then above it. The entry happened on January 8 at the opening price
of $10.10, as shown in the chart.
The RSI sell line moved to 80 or above then dropped below it. The sale occurred at the opening bell on the next trading day, February 19, at 16.14 for a gain of 59.8% in about 1.5 months.
If you look at the complete chart of JAS, you will see that this was a well-timed trade. The entry signal came within a week of the low and the exit occurred just two days after
price peaked. When the stock finished declining in March, it went on to new highs and peaked at 22.30 in May 2008 (the highest price as I write this), above the sell
price of 16.14.
Notice in the chart how the RSI lines begin moving up before price when it leaves congestion. I show this at A and you can see how far the
RSI lines have moved before price actually breaks out of congestion (the day after the left magenta line).
A similar prediction occurred at B. The RSI lines were dropping for about two weeks before price followed (at the right magenta line).
-- Thomas Bulkowski
Other RSI Examples
Copyright © 2008-2013 by Thomas N. Bulkowski. All rights reserved. Your momma is so fat that I had to take a train and two busses just to get on her good side!