Closing Price in Relation to the Day’s Range, and Equity Index Mean Reversion

UPDATE: read The IBS Effect: Mean Reversion in Equity ETFs instead of this post, it features more recent data and deeper analysis.

The location of the closing price within the day’s range is a surprisingly powerful predictor of next-day returns for equity indices. The closing price in relation to the day’s range (or CRTDR [UPDATE: as reader Jan mentioned in the comments, there is already a name for this: Internal Bar Strength or IBS] if you’re a fan of unpronounceable acronyms) is simply calculated as such:

CRTDR formula

It takes values between 0 and 1 and simply indicates at which point along the day’s range the closing price is located. In this post I will take a look not only at returns forecasting, but also how to use this value in conjunction with other indicators. You may be skeptical about the value of something so extremely simplistic, but I think you’ll be pleasantly surprised.

The basics: QQQ and SPY

First, a quick look at QQQ and SPY next-day returns depending on today’s CRTDR:

SPY CRTDR

QQQ CRTDR

A very promising start. Now the equity curves for each quartile:

spy quartile ECs

QQQ quartile ECs

That’s quite good; consistency through time and across assets is important and we’ve got both in this case. The magnitude of the out-performance of the bottom quartile is very large; I think we can do something useful with it.

There are several potential improvements to this basic approach: using the range of several days instead of only the last one, adjusting for the day’s close-to-close return, and averaging over several days are a few of the more obvious routes to explore. However, for the purposes of this post I will simply continue to use the simplest version.

CRTDR Internationally

A quick look across a larger array of assets, which is always an important test (here I also incorporate a bit of shorting):

All ETF results

Long when CRTDR < 45%, short when CRTDR > 95%. $10k per trade. Including commissions of $0.005 per share, excluding dividends.

One question that comes up when looking at ETFs of foreign indices is about the effect of non-overlapping trading hours. Would we be better off using the ETF trading hours or the local trading hours to determine the range and out predictions? Let’s take a look at the EWU ETF (iShares MSCI United Kingdom Index Fund) vs the FTSE 100 index, with the following strategy:

  • Go long on close if CRTDR < 45%
  • Go short on close if CRTDR > 95%
FTSE vs EWU

FTSE vs EWU CRTDR strategy, 1996-2012. $1m per trade (the number was a technical necessity due to the price of the FTSE 100 index).

Fascinating! This result left me completely stumped. I would love to hear your ideas about this…I have a feeling that there must be some sort of explanation, but I’m afraid I can’t come up with anything realistic.

Trading Signal or Filter?

It should be noted that I don’t actually use the CRTRD as a signal to take trades at all. Given the above results you may find this surprising, but all the positive returns are already captured by other, similar (and better), indicators (especially short-term price-based indicators such as RSI(3)). Instead I use it in reverse: as a filter to exclude potential trades. To demonstrate, let’s have a look at a very simplistic mean reversion system:

  • Buy QQQ at close when RSI(3) < 10
  • Sell QQQ at close when RSI(3) > 50

On average, this will result in a daily return of 0.212%. So we have two approaches in our hands that both have positive expectancy, what happens if we combine them?

  • Go long either on the RSI(3) criteria above OR CRTDR < 50%
QQQ RSI and RSI with CRTDR

RSI(3) and RSI(3) w/ CRTDR strategy applied to QQQ. Commissions not included.

This is a bit surprising: putting together two systems, both of which have positive expectancy, results in significantly lower returns. At this point some may say “there’s no value to be gained here”. But fear not, there are significant returns to be wrung out of the CRTDR! Instead of using it as a signal, what if we use it in reverse as a filter? Let’s investigate further: what happens if we split these days up by CRTDR?

RSI signal returns by CRTDR

Now that’s quite interesting. Combining them has very bad results, but instead we have an excellent method to filter out bad RSI(3) trades. Let’s have a closer look at the interplay between RSI(3) signals and CRTDR:

RSI CRTDR square

Next-day QQQ returns.

And now the equity curves with and without the CRTDR < 50% filter:

QQQ RSI and RSI with CRTDR filter

RSI(3) and RSI(3) w/ CRTDR < 50% filter applied to QQQ. Commissions not included.

That’s pretty good. Consistent performance and out-performance relative to the vanilla RSI(3) strategy. Not only that, but we have filtered out over 35% of trades which not only means far less money spent on commissions, but also frees up capital for other trades.

UPDATE: I neglected to mention that I use Cutler’s RSI and not the “normal” one, the difference being the use of simple moving averages instead of exponential moving averages. I have also uploaded an excel sheet and Multicharts .net signal code that replicate most of the results in the post.

Comments (34)

  • quantivity says:

    Excellent start to your new blog–welcome to the quant blogosphere!

    To your question, “I would love to hear your ideas about this”, I encourage you to consider posting code (ideally R, given freely available and excellent quantfin packages)–as I anticipate those seeking to meaningfully contribute to your conversation will need to first replicate your results. Having code available to readers makes replication super easy, and thus is strong encouragement to participate in the dialog (rather than having to spend a bunch of time reverse engineering post into code).

    • qusma says:

      I’m glad you like it!

      Thanks for the advice, it makes a lot of sense. Unfortunately I mostly use Multicharts .net for my backtesting these days, and it’s not exactly the most popular platform in the world. I have updated the post, adding an excel sheet (and MC .net code) that should make it easier for people to follow along and fiddle with the indicators if they want to.

      • sweenrose says:

        I’m trying to figure out what the CAGR of the RSI (3) plus CRTDR filter system would be. It looks to me like it’s in the range of 18-20%. Am I close.

        Also, in order to make sure I’m getting this straight, the results of the QQQ excel sheet are for long only, correct?

        Thanks, for a highly educational blog.

        • qusma says:

          20.4%, and they are long only, yes. The parameters were set with the benefit of hindsight however, so it would be over-optimistic to expect the same level of performance out of sample. Also returns were much higher during the dot-com bubble and 2008, you’d have to wait for another bear market to see that sort of thing.

          Since Nov 6 (the post date) it has returned 5.2%, which is approximately 10.6% annualized, which is actually in line with the in-sample post-crisis performance. This compares unfavorably to a 6.7% return since Nov 6 of the unfiltered RSI strategy.

          • MASSIMO SANTICCHIA says:

            I applied this indicator to both ETFs and individual stocks for a 30 and 20 year backtest periods. I get strong results like you. However, if I lag just by one day the IBS, the out-performance disappears. This suggests that these results are not achievable in actual trading.

  • Jan says:

    Excellent post. You can change the acronym to IBS if you want, for it is
    already known as the ‘Internal Bar Strength’ indicator. Averaged over
    2..5 days I find it as good as the RSI (or better) as a stand-alone
    indicator. But using it as a filter as you have shown, opens up a whole
    new world of possibilities – think about a long/short bias for intraday
    trading the next day.

    Here are 2 links about the IBS:
    http://www.forexcent.com/eng/help/ind_internal_bar_strength_ibs.html
    or:
    http://codebase.mql4.com/4525

    • qusma says:

      Thanks Jan.

      It would make sense that someone has already named it, I’ll update the post. And of course the n-day version is essentially the Williams %R.

  • kleros says:

    Is the backtest for long and short trades? The way you describe the filter makes it seem like it is only for long trades. Are the trades made at the open price?

    • qusma says:

      The backtest in the “CRTDR Internationally” section contain both long and short trades. The others do not, as outlined in the entry/exit criteria. Trading is always at the close.

      • Edu says:

        I am getting it right? Indicators are based on the closing of the day, and the trade is enter at the closing of that day, not next morinng opening?
        Does it require to guess the closing some seconds before the close and execute then?
        thx

        • qusma says:

          Yes, it essentially requires “guessing” the closing price. Alternatively it is possible to use Limit On Close orders; they can be problematic if the day’s high/low change in the last 15 minutes, but this is not a frequent event and can be managed in any case.

          In my experience the fills you’ll get 5-10 seconds before the close are quite similar to the closing price itself and not biased in any particular direction (so in the long run the differences will average out).

      • Edu says:

        sorry, I tried to ask a question before, but not sure if it worked,
        apologies if it appears twice
        great blog, thank you
        Regarding the closing prices. It appears the indicators looked at closing price of day t, and trade it put on at that price, closing of day t, and not opening of t+1
        How do you implement this in practice?
        thx

  • Woodshedder says:

    Great post. Glad to have found your blog.

  • sweenrose says:

    Feel fortunate to have found your blog. Thanks for the great information.

    I tried to open the Multicharts code you linked to above and failed miserably. Is there any other way to access it (or could you simply add it to your blog)?

  • DV2 Further Research | Adaptive Trader says:

    […] found this indicator with some background information at this QUSMA post. It seemed to be useful as an indicator on its own, and as a filter for other indicators. Just like […]

  • IBS and Relative Value Mean Reversion : QUSMA says:

    […] writing a paper on the IBS effect, but it’s taking a bit longer than expected so I thought I’d share some of the results […]

  • severus says:

    Got introduced to your blog from MarketSci and I am already a fan. The posts are straight, easily understandable and brings in very new and fresh ideas. Thanks so much.

  • JAson says:

    I’m a little late to the party on this one but I’m curious why you use an RSI3 opposed to an RSI2?

    • qusma says:

      Hi JAson,

      I prefer the 3-period RSI because it’s a bit more conservative without sacrificing much in returns…fewer extreme values means fewer, but better, trades: it lets me spend less time in the market, freeing up capital for other trades.

  • LRP says:

    Great ideas here!
    Please can some one provide the IBS code for the regular Multicharts?
    THX a lot in advance
    RoboTrade

  • Gary Antonacci says:

    I get the following error message when I try to verify the strategy in MC.net The type or namespace name ‘Average’ could not be found (are you missing a using directive or an assembly reference?) “_CRTDR” [Strategy] Ln 18

  • Finding Reversal Zone in Intraday FX prices « The R Trader says:

    […] and low. I named this indicator LRTDR (Last Relative To Daily Range) and it’s inspired from the QUSMA blog. The exact calculation […]

  • EpicResearch says:

    Anyone that I know who has zero gold holdings and is solely invested in the general equities market is very happy.

  • 2013: Lessons Learned and Revisiting Some Studies says:

    […] The original IBS post. Read the paper instead. […]

  • sajadi says:

    Is excellent. Special thanks. راهبند اتوماتیک

  • rasool says:

    Hi qusma , I’ve developed your system. i useed simple moving average for Filter trend. you can see results system.(initial deposit $100 ,symbol S&P500, yearly avg % return 55 and yearly avg profit $2100)

  • Ayushi says:

    How are you calculating the quantity to trade each time?

  • Mon AMMI | Sanz Prophet says:

    […] Indicators from the blog-o-sphere:RSI(2),RSI(3),RSI(4)DV2 here and hereBSI here or hereBoilingerBandsCRSI hereTD9 […]

  • McJosh says:

    This is exactly the kind of analysis action I’m looking for on indicators. Thank you very much for taking the time to create nice colorful tables and graphs! If I may suggest an more revealing enhancement for your first two graphs: telling me QQQ’s next-day returns averaged out to be 0.252% (of the ETF’s price) is good, but I’m thinking that a percentage relative to ATR (recalculated for each measurement) would better illustrate the effect and its magnitude? And even better, when comparing the results of SPY and QQQ, it would become very apples-to-apples.


Leave a Reply

Your email address will not be published. Required fields are marked *