Internal Bar Strength In Consumer Staples

Internal bar strength is defined as follows: (close-low)/(high-low).

Here is the strategy tested on XLP:

  • Yesterday IBS must be lower than 0.15
  • Today IBS must be lower than 0.4
  • RSI(5) today must be lower than 50
  • Entry on close
  • Exit when today’s close is higher than yesterday’s high

Here is the equity curve:

2008 was actually by far the best year:

And here are all the trade details:

When testing for optimization there is a clear pattern that it’s best with a low IBS yesterday and a bit higher today. Here is the code for Amibroker:

SetOption(“initialequity”,50000);
//SetPositionSize(700,spsShares);
SetOption(“commissionMode”,3);
SetOption(“commissionAmount”,0.02);

ibs=(C-L)/(H-L);
oddis=Optimize(“ibs1”,0.15,0.1,0.5,0.05);
oddis1=Optimize(“ibs2”,0.4,0.1,0.5,0.05);
Buy= ibs<oddis AND Ref(ibs,-1)<oddis1
AND
RSI(5)<50;
BuyPrice=Close;
Sell=C>Ref(High,-1);
SellPrice=Close;

Here you can find the holdings in XLP.

Of course, annual return is pretty low, but that is because the strategy spends most of the time on the sidelines. The strategy spends about 505 days in the market over this period, only around 16% of the trading days.