System Trader Success
Share It!

The Internal Bar Strength Indicator

The internal bar strength or (IBS) is an oscillating indicator which measures the relative position of the close price with respect to the low to high range for the same period.

The calculation for Internal Bar Strength is as follows…

IBS =  (Close – Low) / (High – Low) * 100;

For example, on 13/01/2016 the QQQ etf had a high price of $106.23, a low price of $101.74 and a close price of $101.90.

The value of IBS would be calculated as …

(101.90 – 101.74) / (106.23 – 101.74) * 100 = 3.56

Low IBS readings show that a market has closed near the lows of the day, high IBS readings show that a market has closed near the highs of the day.

The following image shows the IBS indicator plotted beneath the price series.

IBS-1-630x315

Testing the Internal Bar Strength Indicator

The test period is between 01/01/2005 and today. $100,000 hypothetical starting balance, with 100% of available equity invested per position. Commissions are $0.01 per share and there is a minimum cost per trade of $1.00.

Tests are carried out using Amibroker and the data is provided by Norgate Premium.

These are the Strategy rules:

  • If IBS < 10
  • Buy the close
  • Exit at close if price > previous day high.

QQQ Results

  • No. of trades = 199
  • % of Winners = 72.36%
  • Average P/L% per trade = 0.62%
  • Average hold time = 4 days
  • Annualized return = 11.32%
  • Maximum draw-down = -16.14%
  • CAR/MDD = 0.70
  • Exposure = 28.47%

The monthly breakdown of returns is as follows…

Internal-Bar-Strength-QQQ-Performance-1

One common trait among many of these types of mean-reversion systems is that they seem to perform best during volatile markets.

To illustrate the point, I added a filter to the above strategy which only allows us to buy QQQ if the VIX has closed above the value of it’s previous 10-day MA.

Adding the VIX filter improved the win-rate %, average profit % per trade, and annual % return of the strategy.

Here are the results…

  • No. of trades = 158
  • % of Winners  = 75.32%
  • Average P/L% per trade = 0.85%
  • Average hold time = 4 days
  • Annualized return = 12.46%
  • Maximum draw-down = -14.83%
  • CAR/MDD = 0.84
  • Exposure = 22.3%

The Equity curve and monthly breakdown of returns are as follows…

Internal-Bar-Strength-and-VIX

Combining the Internal Bar Strength Strategy with a Trend-Following Strategy

Finally, I wanted to see whether combining a trend-following strategy with the Internal Bar Strategy could improve the risk-adjusted returns of either stand-alone strategy.

The trend following strategy is as follows…

  • Buy the SPY when the Close > upper Bollinger Band (C,200,1);
  • Sell the SPY when the Close < lower Bollinger Band (C,200,1);

Since 2005, this strategy has the following performance metrics:

  • No. of trades = 5
  • % of Winners  = 80%
  • Average P/L% per trade = 19.17%
  • Average hold time = 425 days
  • Annualized return = 7.37%
  • Maximum draw-down = -14.17%
  • CAR/MDD = 0.52
  • Exposure = 76.25%

The Equity Curve and monthly breakdown of returns are as follows…

SPY-trend-Following

For the Final test, QQQ is traded using the Internal Bar Strength (IBS) strategy and SPY is traded using the above trend-following (TF) strategy.

The first test will allocate 70% of available equity to the SPY strategy and 30% of available equity to the QQQ strategy. Further tests will use different capital allocations.

Because the SPY can sometimes be held for a long period, it is necessary to periodically rebalance the size of open SPY positions. For the following tests the rebalance frequency will be monthly and the rebalance threshold will be 2%.

70%TF / 30%IBS. Results

  • No. of trades = 163
  • % of Winners  = 75.46%
  • Average P/L% per trade = 1.39%
  • Average hold time = 18 days
  • Annualized return = 9.01%
  • Maximum draw-down = -11.45%
  • CAR/MDD = 0.86
  • Exposure = 60.23%

60%TF / 40%IBS. Results

  • Annualized return = 9.53%
  • Maximum draw-down = -11.09%
  • CAR/MDD = 0.86
  • Exposure = 54.76%

50%TF / 50%IBS. Results

  • Annualized return = 10.04%
  • Maximum draw-down = -10.98%
  • CAR/MDD = 0.91
  • Exposure = 49.35%

40%TF / 60%IBS. Results

  • Annualized return = 10.55%
  • Maximum draw-down = -10.93%
  • CAR/MDD = 0.97
  • Exposure = 43.95%

30%TF / 70%IBS. Results

  • Annualized return = 11.05%
  • Maximum draw-down = -10.87%
  • CAR/MDD = 1.02
  • Exposure = 38.51%

The above results illustrate that combining both a trend-following strategy and a mean-reversion strategy within your portfolio has been a useful method for improving risk-adjusted returns.

For context, the IBS strategy when traded alone produced a maximum draw-down of 14.83% and a CAR/MDD of 0.86.

The Trend-following strategy produced a maximum draw-down of 14.17% and a CAR/MDD of 0.52.

The combined strategy portfolio with a 30% TF and 70% IBS allocation produced a maximum draw-down of 10.87% and a CAR/MDD of 1.02.  This is superior to either strategy if traded alone.

The equity curve and monthly breakdown of returns for the 30% TF / 70% IBS portfolio are as follows…

Combining-trend-folloiwng-with-Mean-Reversion-2

*Update: As some readers have correctly pointed out, trading on the close when an indicator requires the closing price to be calculated is not necessarily straight forward. With that said, I have included further tests below whereby the trades are executed on the open of the day which follows the signal.

The IBS strategy does not perform as well, but the main point of the article (that combining mean-reversion with trend-following can be beneficial) is still valid.

QQQ Results (Enter on open of day which follows signal)

  • No. of trades = 197
  • % of Winners  = 70.05%
  • Average P/L% per trade = 0.49%
  • Average hold time = 4 days
  • Annualized return = 8.69%
  • Maximum draw-down = -15.99%
  • CAR/MDD = 0.54
  • Exposure = 22.04%

QQQ Results with VIX Filter (Enter on open of day which follows signal)

  • No. of trades = 157
  • % of Winners  = 73.89%
  • Average P/L% per trade = 0.64%
  • Average hold time = 4 days
  • Annualized return = 9.15%
  • Maximum draw-down = -16.10%
  • CAR/MDD = 0.57
  • Exposure = 17.26%

SPY Trend-Following Results  (Enter on open of day which follows signal)

  • No. of trades = 5
  • % of Winners  = 80%
  • Average P/L% per trade = 18.87%
  • Average hold time = 425 days
  • Annualized return = 7.24%
  • Maximum draw-down = -14.15%
  • CAR/MDD = 0.51
  • Exposure = 76.06%

Combined Portfolio (70%IBS / 30%TF)  (Enter on open of day which follows signal)

  • No. of trades = 162
  • % of Winners  = 74.07%
  • Average P/L% per trade = 1.19%
  • Average hold time = 17 days
  • Annualized return = 9.90%
  • Maximum draw-down = -11.47%
  • CAR/MDD = 0.86
  • Exposure = 35.47%

The equity curve and monthly breakdown of returns for the 70% IBS / 30% TF portfolio are as follows…

Combining-trend-folloiwng-with-Mean-Reversion-3

— By Llewelyn of Backtest Wizard

About the Author Llewelyn James

Llewelyn is the best-selling author of “The Honest Guide To Stock Trading” and “The Honest Guide To Candlestick Patterns”. His web site, www.backtestwizard.com, provides trading articles and programming lessons for Amibroker users.

Leave a Comment:

19 comments
Add Your Reply