Internal Bar Strength for Mean Reversion

I’ve been writing this blog for nine years now. Sometimes I am amazed about topics I have not covered and this is one of them. When developing a new strategy, these are the indicators I likely test: RSI, Historical Volatility and Internal Bar Strength (IBS). I had a reader send me an email pointing me to research done on IBS. I thought let me send him my blog post on this. After searching my records and site, I could not find one. That made it easy to decide what my next post would be about.

When I used IBS twenty years ago, I called it Closing Range. It is what we used when I worked for Larry Connors and that is still the name I use now. But for this post, I will go with the more common name of Internal Bar Strength (IBS).

Calculation

The general concept of this indicator is simple. It is comparing the close of the day to the range between the high and low. When the close is at the low, the value is zero. When the close is at the high the value is 1.

IBS = (close – low)/(high-low)

My slight modification to this formula is I will multiply the IBS value by 100. This gives a range between 0 and 100.

The concept being this is a mean reversion indicator. When the IBS is low then one would expect the next day to close higher.

This indicator can be applied to other timeframes such as weekly or monthly or even over N-bars

Evaluation Method

When evaluating an indicator, one test I do is creating a very simple strategy. Then add the indicator and see how it changes the results. I test a range of the indicator values and see if they behave as I would expect.

I do not test this as a portfolio but as an “all-trades” test. I take all signals. I want to know how this improves the base strategy.

I will be testing IBS on a mean reversion strategy.

Buy Rules

  • Stock is a member of the S&P500 Index
  • 2-period RSI crosses below 2.5
  • Close is greater than 200-day MA
  • The 126-day return of the $SPX is greater than 0
  • Buy 1 share on the next open

Sell Rules

  • 2-period RSI closes above 50
  • Exit on next open

Ten Buckets

The first step is to divide the IBS into 10 buckets and see how each perform. The added rule is

  • IBS >= IBS_BOT and IBS < IBS_TOP

The bottom row results from not using any IBS filter. This gives us a base case that we are trying to improve on. The first thing to notice is that IBS under 10 gives a 58% increase. This also represents 34% of the trades. When the RSI gets this low, IBS is often low.  There is a trend with higher IBS value to have fewer trades.

What about the avg %p/l trend? I like to see it trending down and it does.

The linear regression line does have a nice downslope.

The % winners also have the trend of going from 71% to 57% as IBS goes from 0 to 100. Another good sign for the indicator.

Four Buckets

One issue with the 10 buckets, is the dramatic decrease in trades with IBS less than 10. Breaking IBS into 4 buckets gives the following.

With IBS less than 25, we keep 63% of the trades with a 21% increase in avg %p/l.

Final Thoughts

Using a low IBS value as an additional filter is helping identify those mean reversion trades that are likely to make money. Another insight is that high IBS trades are not good ones to take. I like indicators that work on both ends as this does.

The next question is can one create a mean reversion strategy using only IBS. I have not had success with this because IBS is only looking at a one-day mean reversion. You could calculate IBS over the last n-bars, to create a multi-day IBS. Maybe for another post.

If you are not using IBS on your mean reversion strategies, I recommend you give it a try.

Backtesting platform used: AmiBroker. Data provider: Norgate Data (referral link)

Good quant trading,

Visited 314 times, 1 visit(s) today

Click Here to Leave a Comment Below

Alex - February 17, 2022 Reply

Another good and useful post Cesar. I would very interested in reading your future post on multibar IBS’s and mean reversion

Mark Pescatrice - February 22, 2022 Reply

Great post Cesar. I stumbled across the IBS on another site a couple weeks ago (they called it Internal Bar Range, IBR, but same calculation) and by coincidence stumbled across this will reading your article on momentum versus trend.

I tested IBS as an additional filter on a forex mean-reversion system I developed a couple weeks ago, but it did add anything to the system, i.e. IBS signal was always the same as our signal. I also tested IBS by itself and, as you suggested, it did not work well as a stand-alone mean reversion signal (with a trend filter, of course). I may take your idea of trying a multi-day IBS and seeing what I can do with it. As always, thanks for sharing your knowledge with us.

Eric F. - February 26, 2022 Reply

Thanks for sharing Cesar, a very interesting read. One question on your base line strategy:

Rank from highest to lowest by 100-day Historical Volatility

Do you pick stocks based on volatility or what’s the purpose of the volatility/ranking here? Thanks!

    Cesar Alvarez - February 28, 2022 Reply

    That should not have been there. There is no need to rank since we are buying all signals. I removed the line. Thanks for pointing this out.

Larry P. - March 6, 2022 Reply

Nice work Cesar. If you are thinking of a multi-bar IBS it seems to be that the IBS is a 1 bar Stochastic, ie the raw Stochastic “K”, without any smoothing. AmiBroker equivalent of StochK(1,1)

    Cesar Alvarez - March 7, 2022 Reply

    I did not know that. I will have to check it out. Thanks for sharing.

Patrick - April 9, 2022 Reply

Interesting post but isn’t it just saying that the better trades haven’t already started to revert to the mean? I guess that leads to creating a strategy where you have a limit order in below the market to buy when the stock is fully stretched?

Genieknows Trading - September 16, 2022 Reply

I am trying to figure out what trading setup is best for me. I am interested in active and algorithmic trading, but I don’t know which one is best for me. I have a few different options that I am considering, but I don’t know which one is best. I am considering active trading, algorithmic trading, or a combination of both.

    Cesar Alvarez - September 16, 2022 Reply

    There is no one ‘best’ way to trade the market. One needs to first find a method that fits one’s personality. Then from there one can start looking for a strategy.

govind - December 28, 2022 Reply

Why is it like that the bucketed plots are zigzaging, thinking out aloud here, that is a pattern I see in most of the plots you share, pretty strong -ve autocorrelation between buckets.

    Cesar Alvarez - December 29, 2022 Reply

    I do not expect to see a perfectly downtrending/uptrending line. I am looking for the general trend and usually only care about the end of the lines. I probably could massage the data to get the ‘perfect’ line but then it would not be very useful.

Leave a Reply: