Sei sulla pagina 1di 30

The Internal Bar Strength Indicator

June 3, 2016JonathanETFs, Index Trading, Mean Reversion Strategies, Monte Carlo, S&P500 Index, Swing
Trading, Technical Analysis3 comments

Internal Bar Strength (IBS) is an idea that has been around for some time. IBS is based on the position of
the days close in relation to the days range: it takes a value of 0 if the closing price is the lowest price of
the day, and 1 if the closing price is the highest price of the day.

More formally:

IBS = (Close Low) / (High Low)

The IBS effect may be related to intraday over-reaction to news or market movements, which are then
corrected the next day. It serves as a measure of the tendency of a price series to mean-revert over daily
horizons. I use the term daily advisedly: so far as I am aware, there has been no research (including my
own) demonstrating the existence of an IBS effect at time horizons shorter, or longer, than one day. Indeed,
there has been very little in the way of academic research into the concept of any kind, which is strange
considering how compelling are the results it is capable of producing. Practitioners have been happy enough
with that state of affairs, content to deploy this neglected indicator in their trading strategies, where it has
often proved to be extremely useful (we use IBS in one of our volatility strategies). Since 2013, however, the
cat has been let out of the bag, thanks to an excellent research paper by Alexander Pagonidis, who writes an
interesting quantitative finance blog.

The essence of the idea is that stocks that close in the lowest part of the daily range, with an IBS of below,
say, 0.2, will tend to rally the next day, while stocks that close in the highest quintile will often decline in
value in the following session. In his paper The IBS Effect: Mean Reversion in Equity ETFs (2013),
Pagonidis researches the IBS effect in equity index ETFs in the US and several international markets. He
confirms that low IBS values in these assets are associated with high returns in the following day session,
while high IBS values are associated with low returns. Average returns when IBS is below 0.20 are .35%
,while average returns when IBS is above 0.80 are -0.13%. According to his research, this effect has been
present in equity ETFs since the early 90s and has been highly consistent through time.

IBS Strategy Performance

To give the reader some idea of the potential of the IBS effect, I have reproduced below equity curves for the
IBS strategy for the SPDR S&P 500 ETF Trust (SPY) and iShares MSCI Singapore ETF (EWS) index ETFs
over the period from 1999 to 2016. The strategy buys at the close when IBS is below 0.2, and sells at the
close when IBS exceeds 0.8, liquidating the position at the following market close. Strategy CAGR over the
period has been of the order of 13% for SPY and as high as 40% for EWS, ignoring transaction costs.
Note that in both cases strategy returns for SPY and EWS have diminished in recent years, turning negative
in 2015 and 2016 YTD and this is true for ETFs in general. It remains to be seen whether this deterioration
in strategy performance is temporary or permanent. There are some indications that the latter holds true, but
the evidence is not quite definitive. For example, the chart below shows daily equity curve for the SPY IBS
strategy, with 95% confidence intervals for the latest 100 trades (up to the end of May 2016), constructed
using Monte-Carlo bootstrap. The equity curve appears to have penetrated the lower bound, indicating a
statistically significant deterioration in the performance of the IBS strategy for SPY over the last year or so
(EWS is similar). That said, the equity curve does fall inside the boundaries of the 99% confidence interval,
so those looking for greater certainty about the possible breakdown of the effect will need to wait a little
longer for confirmation.

Whatever the outcome may be for SPY and other ETFs going forward, it is certainly true that IBS effects
persist strongly for some individual equities, Exxon-Mobil Corp. (XOM) being a case in point (see below).
Its worth taking note of the exceptional performance of the XOM IBS strategy during the latter quarter of
2008. I will have much more to say on the application of the IBS indicator for individual equities in a future
blog post.
The Role of Range, Volume, Bull/Bear Markets, Volatility and Seasonality

Pagonidis goes on to detail several further important findings in relation to IBS. It is clear from his research
that high volatility is related to increased predictability of returns and a more powerful IBS effect, in
particular the high IBS-negative return aspect. As might be expected, the effect is also larger after days with
high range, both for high and low IBS extremes.

Volume turns out to be especially important for U.S. index ETFs: in fact, the IBS effect only appears to
work on high-volume days.

Pagonidis also separates the data into bull and bear market environments, based on whether 200-day returns
are positive or not. The size of the effect is roughly similar in each environment (slightly larger in bear
markets), but it is greater in the direction of the overall trend: high IBS readings are followed by larger
negative returns during bear markets, and vice versa.

Day of Week Effect

The IBS effect is also strongly seasonal, having the greatest impact on returns from Mondays close to
Tuesdays close, as illustrated for the SPY ETF in the chart below. This accounts for the phenomenon
known popularly as Turnaround Tuesday, i.e. the tendency for the market to recover strongly from losses
on a Monday. The day-of-week effect is weakest for Fridays.

The mean of the returns distribution is not the only aspect that IBS can predict. Skewness also varies
significantly between IBS buckets, with low IBS readings being followed by highly skewed returns, and
vice versa. Close-to-close returns after a bottom-bucket IBS day have average skewness of 0.65 across
Equity Index ETF products, while top-bucket IBS days are followed by returns with skewness of 0.03. This
finding has very useful risk management applications for investors concerned with tail risk.

IBS as a Filter for a Swing Trading Strategy in QQQ

The returns to an IBS-only strategy are both statistically and economically significant. However,
commissions will greatly decrease the returns and increase the maximum drawdowns, however, making such
an approach challenging in the real world. One alternative is to combine the IBS effect with mean reversion
on longer timescales and only take trades when they align.

Pagonidis offers a simple demonstration using the Cutlers RSI indicator that shows how the IBS effect can
be used to boost returns of a swing trading strategy while significantly decreasing the number of trades
needed.

Cutlers RSI at time t is calculated as follows:

Pagonidis tests a simple, long-only strategy that trades the PowerShares QQQ Trust, Series 1 (QQQ) ETF
using the Cutlers RSI(3) indicator:

Go long at the close if RSI(3) < 10

Maintain the position while RSI(3) 40

filter these returns by adding an additional rule based on the value of IBS:

Enter or maintain long position only if IBS 0.5

Pangonis claims that the strategy produces rather promising results that easily beats commissions;
however, my own rendition of the strategy, assuming commissions of $0.005 per share and slippage of a
further $0.02 per share produces results that are distinctly less encouraging:
Strategy Code

For those interested, the code is as follows:

Inputs:
RSILen(3),
RSI_Entry(10),
RSI_Exit(40),
IBS_Threshold(0.5),
Initial_Capital(100000);
Vars:
nShares(100),
RSIval(0),
IBS(0);
RSIval=RSI(C,RSILen);
IBS = (C-L)/(H-L);

nShares = Round(Initial_Capital / Close,0);

If Marketposition = 0 and RSIval > RSI_Entry and IBS < IBS_Threshold then begin
Buy nShares contracts next bar at market;
end;
If Marketposition > 0 and ((RSIval > RSI_Exit) or (IBS_Threshold > IBS_Threshold)) then begin
Sell next bar at market;
end;

Strategy Optimization and Robustness Testing

One can further improve performance by optimizing the trading system parameters, using Tradestations
excellent Walk Forward Optimization (WFO) module. This allows us to examine the effect of re-calibrating
the strategy parameters are regular intervals, testing the optimized model on out-of-sample data sets of
various sizes. WFO can be used, not only optimize a strategy, but also to examine the sensitivity of its
performance to changes in the levels of key parameters. For example, in the case of the QQQ swing trading
strategy, we find that profitability increases monotonically with the length of the RSI indicator, and this
effect is especially marked when an IBS threshold level of 0.2 is used:

Likewise we can test the consistency of the day-of-the-week effect over several OS data sets of varying size
and these tests are consistent with the pattern seen earlier for the IBS indicator, confirming its role as a filter
rule in enhancing system profitability:

A model that is regularly re-calibrated using WFO is subjected to a series of tests designed to ensure its
robustness and consistency in live trading. The tests include the following:
In order to achieve an overall pass rating, the system is required to pass all five tests of its out-of-sample
performance, from which Tradestation deems it likely that the system will continue to perform well in live
trading. The results from this procedure appear much more promising than the strategy in its original form,
as can be seen from the performance table and equity curve chart shown below.

However, these results include both in-sample and out-of-sample periods. An examination of the results
from the WFO indicate that the overall efficiency of the strategy is around 55%, meaning that the P&L
produced by the system in out-of-sample periods amounts to a little over one half of the rate of profit
produced during in-sample periods. Going forward, therefore, we might expect the performance of the
system in live trading to be only around half as good as shown here. While this is still superior to the
original system, it may not be considered good enough. Nonetheless, for the purpose of illustrating the
benefits of the IBS indicator as a trade filter, it makes the point.

Another interesting example of an IBS-based trading strategy in the QQQ and SPY ETFs can be found in the
following blog post.

Conclusion

Internal Bar Strength is a powerful mean-reversion indicator for equity products traded at daily frequencies,
with a consistent effect that has continued from the 1990s through to the current decade. IBS can be used on
its own in mean-reversion strategies that have worked well for both US equities and US and International
equity index ETFs, or used as a trade filter when combined with other alpha signals.

While there is evidence of a weakening of the IBS effect since around 2013 this is not yet confirmed
statistically (at the 99% confidence level) and may simply be the result of normal statistical variation in
its efficacy.

The Internal Bar Strength Indicator


Llewelyn James7 Comments

January 28, 2016

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.

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

Annualised return = 11.32%

Maximum drawdown = -16.14%

CAR/MDD = 0.70

Exposure = 28.47%

The monthly breakdown of returns is as follows

One common trait among many of these type 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 its 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

Annualised return = 12.46%

Maximum drawdown = -14.83%

CAR/MDD = 0.84

Exposure = 22.3%

The Equity curve and monthly breakdown of returns are as follows

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

Annualised return = 7.37%

Maximum drawdown = -14.17%

CAR/MDD = 0.52

Exposure = 76.25%

The Equity Curve and monthly breakdown of returns are as follows


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

Annualised return = 9.01%

Maximum drawdown = -11.45%

CAR/MDD = 0.86

Exposure = 60.23%

60%TF / 40%IBS. Results

Annualised return = 9.53%

Maximum drawdown = -11.09%

CAR/MDD = 0.86

Exposure = 54.76%

50%TF / 50%IBS. Results

Annualised return = 10.04%

Maximum drawdown = -10.98%

CAR/MDD = 0.91

Exposure = 49.35%

40%TF / 60%IBS. Results

Annualised return = 10.55%

Maximum drawdown = -10.93%

CAR/MDD = 0.97

Exposure = 43.95%

30%TF / 70%IBS. Results

Annualised return = 11.05%

Maximum drawdown = -10.87%

CAR/MDD = 1.02

Exposure = 38.51%
The above results illustrate that combing 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
*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

Annualised return = 8.69%

Maximum drawdown = -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

Annualised return = 9.15%

Maximum drawdown = -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

Annualised return = 7.24%

Maximum drawdown = -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

Annualised return = 9.90%

Maximum drawdown = -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
Closing Price in Relation to the Days Range, and
Equity Index Mean Reversion
November 6, 2012 by admin in QUSMA

UPDATE: read The IBS Eect: 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 days range is a surprisingly powerful predictor of next-day
returns for equity indices. The closing price in relation to the days range (or CRTDR [UPDATE: as reader
Jan mentioned in the comments, there is already a name for this: Internal Bar Strength or IBS] if youre a
fan of unpronounceable acronyms) is simply calculated as such:

It takes values between 0 and 1 and simply indicates at which point along the days 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 youll be pleasantly surprised.

The basics: QQQ and SPY

First, a quick look at QQQ and SPY next-day returns depending on todays CRTDR:
A very promising start. Now the equity curves for each quartile:

Thats quite good; consistency through time and across assets is important and weve 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 days 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):
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? Lets 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 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 thisI have a
feeling that there must be some sort of explanation, but Im afraid I cant come up with anything realistic.

Trading Signal or Filter?

It should be noted that I dont 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, lets 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%


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 theres 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? Lets investigate further: what happens if we split these days up by CRTDR?

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

Next-day QQQ returns.

And now the equity curves with and without the CRTDR < 50% filter:
RSI(3) and RSI(3) w/ CRTDR < 50% filter applied to QQQ. Commissions not included.

Thats 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 Cutlers 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.

IBS and Relative Value Mean Reversion


December 19, 2012 by admin in QUSMA

Im writing a paper on the IBS effect, but its taking a bit longer than expected so I thought Id share some of
the results in a blog post. The starting point is a paper by Levy & Lieberman: Overreaction of Country ETFs
to US Market Returns, in which the authors find that country ETFs over-react to US returns during non-
overlapping trading hours, which gives rise to abnormal returns as the country ETFs revert back the next
day. In terms of the IBS effect, this suggests that a high SPY IBS would lead to over-reaction in the country
ETFs and thus lower returns the next day, and vice versa.

To quickly recap, Internal Bar Strength (or IBS) is an indicator with impressive (mean reversion) predictive
ability for equity indices. It is calculated as follows:

Using a selection of 32 equity index ETFs, lets take a look at next-day returns after IBS extremes (top and
bottom 20%), split up by SPYs IBS (top and bottom half):
The results were the exact opposite of what I was expecting. Instead of over-reacting to a high SPY IBS, the
ETFs instead under-react to it. A high SPY IBS is followed by higher returns for the ETFs, while a low SPY
IBS is followed by lower returns. These results suggest a pair approach using SPY as the first leg of the pair,
and ETFs at IBS extremes as the other. For a dollar-neutral strategy, the rules are the following:

If SPY IBS <= 50% and ETF IBS > 80%, go long SPY and short the other ETF, in equal dollar
amounts.

If SPY IBS > 50% and ETF IBS < 20%, go short SPY and long the other ETF, in equal dollar
amounts.

The results1:
The numbers are excellent: high returns and relatively few trades with a high win rate. Lets take a look at
the alphas and betas from a regression of the excess returns to the pair strategy, using the Carhart 4 factor
model:
Values in bold are statistically significantly different from zero at the 1% level.

On average, this strategy generates a daily alpha of 0.037%, or 9.28% annually, with essentially zero
exposure to any of the factors. Transaction costs would certainly eat into this, but given the reasonable
amount of trades (about 23 trades per year per pair on average) there should be a lot left over. The fact that
over 90% of days consist of zero excess returns obscures the features of the actual returns to the strategy.
Repeating the regression using only the days in which the strategy is in the market yields the following
results:
Values in bold are statistically significantly different from zero at the 1% level.

Unfortunately, these results are pretty much a historical curiosity at this point. Most of the opportunity has
been arbitraged away: during the last 4 years the average return per trade has fallen to 0.150%, less than half
the average over the entire sample. The parameters havent been optimized, so there may be more profitable
opportunities still left by filtering only for more extreme values, but its clear that there is relatively little
juice left in the approach.

In fact if we take a closer look at the differences between the returns before and after 2008, the over-reaction
hypothesis seems to be borne out by the data (another factor that may be at play here are the heightened
correlations weve seen in the last years): low SPY IBS leads to higher next-day returns for the ETFs, and
vice versa.
The lesson to take away from these numbers is that cross-market effects can be very significant, especially
when global markets are in a state of high correlation. Accounting for the state of US markets in your
models can add significant information (and returns) to your IBS approach.

1. As with any dollar-neutral approach, calculating returns is a tricky matter; in this case I have
calculated the returns as a % of the capital allocated to one of the legs

Potrebbero piacerti anche