Trading with RSI(2)

09Dec08

The indicator RSI(2) has been garnering a lot of attention from the blogosphere. A number of fellow bloggers (Woodshedder, IBDIndex, Bill Rempel and Dogwood come to mind) have been doing all sorts of nifty stuff with it and I recommend that TA-oriented folks get plugged into that discussion.

In this report I’m going to test the indicator in its simplest form and look at how its performance has evolved over time (and why trading it as a static strategy might be a dangerous approach).

Unfamiliar with RSI(2)? Read this StockCharts.com primer. The short RSI used here (2-day instead of the customary 14-day) is measuring how overbought/oversold the market is in very recent history. See sample chart below (RSI in top pane).

2008120901

I’ve read a lot of different interpretations of RSI(2), but in its simplest form, traders go long when the RSI is very low (i.e. oversold) and short when it’s very high (i.e. overbought). In the graph below I’ve assumed a trader went long the S&P 500 at today’s close whenever the RSI closed below 10 and short whenever it closed above 90, from 2000 (frictionless with no return on cash).

2008120902
[logarithmically-scaled]

And for the number-lovers:

2008120903

Clearly since the beginning of this decade the strategy has been very predictive of next day returns. I especially like these results because (a) for an “extreme” contrarian indicator, it triggers fairly frequently (about 24% of all days), and (b) despite the fact that most short-term contrarian indicators failed miserably in October/November 2008, this approach weathered the storm well.

But there are also things that I don’t like. First, the graph above makes it hard to see, but the strategy went through a long dry spell around 2004 and 2005 where it was very much not predictive of returns. Compounding that is the fact that prior to about 1997, RSI(2) didn’t work at all as a contrarian indicator.

See graph below. Same trading rules as above from 1970.

2008120904
[logarithmically-scaled]

Prior to about 1980 (i.e. left of first dotted blue line), the indicator worked exactly opposite as it does today (i.e. right of second dotted blue line). Results in between those periods were mixed. This is very reminiscent of the evolution of daily follow-through that I’ve discussed a number of times on this blog.

I do think RSI(2) has wings in today’s market. I’ve been meaning to add an “extreme” short-term OB/OS indicator to the State of the Market report, and for now, RSI(2) will be it (expect to see it in the next report). The entire SOTM report is adaptive meaning it should detect if this indicator stops working in the future.

But I would be hesitant to trade the RSI(2) in the simple form I’ve described here as a static strategy. I think performance prior to the late 90’s and even at points in this decade indicate that this strategy could at some point revert to its old ways.

[Edit: click for a summary of posts related to RSI(2)] 

Happy Trading,
ms

To stay up to date with what’s happening at the MarketSci Blog, we recommend subscribing to our RSS Feed or Email Feed.



32 Responses to “Trading with RSI(2)”

  1. Count me among the fans of RSI (2). I think you might get more interesting results — though with much more time out of the market — using 95/5 and 98/2 as break points.

    Also, if everyone is jumping on the RSI (2) bandwagon, perhaps it is time to spend more time evaluating RSI (3) or RSI (4) strategies. Just a thought.

    Nice work, as always, but why do I always feel like I am assigning homework when I comment here…?

    -Bill

    • 2 delbertino

      Because you “are” assigning homework here; much thanx; totally lost, but enjoying the great minds that grind; much respect; keep it coming, Herr Doktor;

  2. 3 dskills

    Hmmm….smells like “adaptive” strategy…..

  3. 4 marketsci

    RE to Bill: good point – one thing I didn’t mention but I’m sure you’ve seen as well is that the “deeper” the market goes into low/high RSI(2) territory, the more bullish/bearish it becomes, so “below 5″ is more bullish than “below 10″, “below 3″ more bullish than “below 5″…etc…

    No problem on the homework…that’s what I do…I’m a homework machine =)

    michael

  4. 5 rcm

    One thing that is important to point out is that before about 1990, the S&P 500 was not a mean-reverting animal. At almost all time horizons up to 10 days, the index was quite persistent (high N-day returns followed high N-day returns and low N-day returns followed low N-day returns). After 1990, the index steadily became more and more mean-reverting to the point that it’s extremely mean-reverting today (based on indicators that measure the amount of persistence/mean-reversion). Also, the index can behave in a way whereby it is persistent on a two or three day basis but mean-reverting on a five-day or longer horizon (in which case going long or short in a contrarian way only for a day when the index may persistent in the same direction could be costly). Thus, using the RSI(2) indicator might be improved by having holding periods longer than one day (e.g., go long when the indicator is below 5 or 10 or whatever and hold for a minimum of N days or until it crosses above some RSI(2) threshold, whichever happens last–similarly when short). Factoring in whether or not the index is mean-reverting or persistent allows one to adaptively decide whether or not it’s advantageous to apply a mean-reverting (or momentum) strategy. Moreover, the RSI(2) index corresponds roughly with a 3-day SMA of the price changes in the “up” and “down” averages in the RSI calculation. The SPX, however, has a zero-crossing frequency of 5-day returns that is on the order of 5 days, which suggests using a RSI(3) indicator (which corresponds to a 5-day SMA of the average “up” and “down” changes) would be more effective.

  5. 6 marketsci

    RE to rcm: I appreciate the very smart comments. The only thing I would add is that most contrarian indicators “began working” in more recent history, but the date of those can vary widely depending on the approach to the market. For example, the two proprietary indicators on the State of the Market report are using 1-3 weeks of data to gauge OB/OS and those indicators clearly began working in about 1970. The shorter-term “daily follow-through” that we’ve talked about on this blog as well as RSI(2) “began working” sometime in the late 90’s/early 00’s. Agree with everything you said, except that I think it’s impossible to say that at some certain date the S&P 500 became a “mean-reverting animal”…just my $0.02.

    michael

  6. 7 rcm

    Absolutely, it’s not possible to pinpoint a specific date when the S&P 500 Index started behaving in a mean-reverting way. But in it’s long history, one can identify periods where it was a) strongly persistent, b) mostly a random walk, c) strongly mean-reverting. In fact, it happened primarily in that order. Up until about the late 70’s/early 80’s, the index had been strongly persistent. Short-term momentum strategies were killer. Then (over short horizons) it began to act more like a random walk from the early 80’s to early 90’s. And since that time it has progressively gotten more strongly mean-reverting. Again, as you suggested, there wasn’t any one date in history where a switch was flipped–the transition from strong persistence to strong mean-reversion happened gradually but inexorably. The interesting question is whether in the future it will remain as strongly mean-reverting as it currently is. Another question is what gave rise to the mean-reversion to begin with? Was it the proliferation of market participants and their intense focus on the S&P 500? Is it behavioral? Cultural (e.g., there is research that suggests Asia indices are momentum-driven because of their collectivist culture)? I have no idea. In any event, it’ll be interesting to watch it all unfold.

  7. 8 George Herzog

    For whatevery it may be worth, your long dry spell in 2004-5 correlates with a relatively calm $VIX while the recent Oct/Nov 2008 period is anything but calm.

    It seems that would be a potential indicator of utility.

  8. 9 marketsci

    RE to Herzog: very smart comment George. OB/OS in low volatility environment can jsut be random drift. OB/OS in high volatility tends to indicate sharp peaks and troughs. Will have to ponder how to capture that mathematically. michael

  9. Great write up MS.

    I don’t recall the specific report, but they did a study very similar to yours that I believe tested going long the market after an up day, or short after a down day. This in effect is similar to the RSI(2) strategy, and they tested it going back with a lot of data and they arrived at an identical chart, that there was no edge until the 1980s when the curves crossed. What I think you’ll find interesting, is that they attributed this to the introduction of futures trading in the early 80s which apparently sucked the extra profit out of the up day begetting more up days trade and began a mean reversion environment.

  10. try using the hurst re-scaled range statistic as well as nonlinear GARCH volatility modelling using both historical and implied volatility (VIX)…….combining these with RSI2,3,4, and a couple moving averages etc within an adaptive neural network gives you results that can adjust out of sample to the various environments including the 70’s

  11. 12 marketsci

    RE to David: to be honest, I’m still not sure whether your comment was meant to be taken as humour or if that was a serious response. I’m not trying to be snarky, but seriously, the model you described above has absolutely zero to do with RSI(2) just because it’s using the RSI(2) as an input. michael

  12. my comment was meant to suggest that RSI performance is moderated by certain key factors(see below), and can be predicted in advance. This further extends separately to the performance of long or short RSI trades.This permits more intelligent adaptations RSI based strategies.

    1)the hurst stat is a good indication of either a random market that is range bound vs trending. rsi2 and for that matter any countertrend strategies will tend to perform most accurately when the market is in a mean reverting state.
    2)volatility–rsi2 performs better and more consistently when the market is more volatile or better yet is projected to be more volatile in the short term. This is obviously common sense…….but the relationships between volatility both implied and historical as you elaborate on a bit elsewhere can be modelled mathematically etc
    3)market state-Performance skew of ANY RSI strategy will be dictated by the intermediate/long term trend, and major drawdowns will occur for the wrong bias so going long in a bear market is riskier than in a bull market, and vice versa since the market can run away in either direction beyond normalcy—–this is borne out by the equity curve for short rsi2 which is much better in bear markets, and vice versa.

    4) you can use a neural network to predict the success of a given strategy, in this case using the above variables you predict how the RSI2 strategy will perform. Therefore, you should not care whether RSI started “working” in 1997 etc……the market dynamics modelled by the above factors will dictate what will “work” in the future in real time presuming the net is adaptive

    for that matter as a side bar, trend strategies (breakouts, crossovers, daily return persistence etc) which worked spectacularly in the 70s-early 90s for most assets, reversed course recently……favoring such things as RSI2 etc—-but work that i have commissioned shows that a smart adaptive net can figure out what will work very quickly with little lag.

  13. 14 marketsci

    RE to Danny: I absolutely agree. I did a post on the issue here:

    http://marketsci.wordpress.com/2008/07/17/evolving-markets-dynamic-systems-daily-follow-through/

    With a proposed solution here:

    http://marketsci.wordpress.com/2008/11/19/the-simple-made-powerful-with-adaptation/

    P.S. apologies for the late response – looks like all of IBC’s blogger comments have been going into the spam bin recently.

  14. David, fantastic comments!

  15. 16 brook

    Is please anyone know how to calculate RSI(2)?
    I got all different fomulas but nothing is giving me same result with yahoo chart.
    For example,
    AAPL
    Dec.01.08 Dec.02.08 Dec.03.08
    Close $88.93 $92.47 $95.50
    EMA(2) $90.26 $91.73 $94.51

    And I have a trouble to get these number.
    RSI(2) 25.05 62.53 80.97

    Please HELP!!!

  16. 17 marketsci

    RE to brook: try this Excel spreadsheet from StockCharts.com: http://stockcharts.com/education/indicatoranalysis/RSI.xls

  17. 18 brook

    Thank you, marketsci.
    The spreadsheet is about RSI(14). And I put AAPL closing price for 19days on the spreadsheet, but it is still not same result with RSI(14) on yahoo chart.
    However, I really appreciate your response.

  18. 19 marketsci

    RE to brook: I have a feeling you’re doing something wrong with the spreadsheet. When I manually do it, I get the same result as Yahoo. Keep trying! michael

  19. 20 j haynes

    first visit, thanks for being a ‘homework’ guy.

    to david, so , do you have a neural network that makes the rsi failproof so long as it is consistent with the long term, intermediate term, that gets identified by someone?

  20. 21 Mike

    Ok the way I understand it is that RS = Smoothing Average gain / Smoothing Average Loss
    Then RSI = 100 -(100/(1+RS)) when I do this I get the complete opposite of Stock Charts Or Yahoo … If I just do 100/(1+RS) it works perfectly. Why would that be? I am using KEF as an example starting back from 01-01-2008 RSI 2

    Date Price Change SAGain SAverageLoss
    KEF 1/30 $5.09 0 0.0627 0.0433
    KEF 2/2 $5.05 0.04 0.0513 0.0216
    KEF 2/3 $5.20 -0.15 0.0256 0.0858

    Conversely if I do ALoss/AGain then 100- it also works.

  21. 22 marketsci

    RE to Mike: take at this link from StockCharts.com:

    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:relative_strength_index_rsi

    There’s a link there to an Excel workbook that should get you on the right track.

    michael

  22. 23 Mike

    Never mind… the error was that I inverted what change was, so advances were declines and so on.

  23. 24 manatrader

    Here’s a link to a RSI spreadsheet which allows the period to be changed: http://www.gstock.com/help/index.php/Help/TheRelativeStrengthIndexIndicator
    :)

  24. 25 congamike

    Quoting David (above): “the market can run away in either direction beyond normalcy”

    Is there a protective stop strategy to be used when trading the RSI 2?

  25. 26 OptionsGuy

    There’s a spreadsheet at http://investexcel.net/3077/relative-strength-index-spreadsheet/ that plots RSI based on a stock ticker symbol. It needs a ticker symbol, two dates and the averaging period, and it automatically retrieves stock quotes from Yahoo Finance


  1. 1 Links of interest today… « Skill Analytics
  2. 2 Tuesday links: bubbles, bulls and bears « Abnormal Returns
  3. 3 Quantitative thoughts » Mean reverting strategies and volatility
  4. 4 The Weekly Update « The Average Investor's Blog
  5. 5 RSI(2) and the pre 80s Market « The Average Investor's Blog
  6. 6 Trading at the Close – the Mechanics

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s