Friday, May 4, 2012

"Quality" inside bar backtest - extended

I've spent the last fortnight backtesting inside bars both on the daily and 4HR timeframes. My backtest on the 4HR TF is still incomplete, but I've done further work on the daily TF since my last post and am somewhat satisfied with my results.

Without further ado, here are the final results of my "quality" inside bar backtest on the daily TF.


- An inside bar must form within the top or bottom half of the previous "mother" candle.
- Place pending entry at both ends of the inside bar EXACTLY
- Place stop loss at EXACT opposite end of the inside bar
- If one entry is triggered, cancel the remaining pending entry
- Place TP using a 2.5:1 reward : risk ratio (the backtest indicates this is optimal, although lower R:R to 1:1 is also profitable. Please see summary).
- Don't trade bars that form during weekends or global holidays (Easter, Xmas, NY). Nation-specific holidays like US Memorial Day seem okay, though.

What is the rationale behind this trading system?

When an inside bar forms in the top or bottom half of the "mother" candle, it tends to be the result of market indecisiveness where once-strong buying pressure is now giving way to sellers, or vice versa. We trade the break of either end of the inside bar because we believe the inside bar is either:

a) a minor retracement or "rest period" before a breakout (or continuation of breakout)
b) a tipping point for a reversal

What a "quality" inside bar should look like...

Here are a few visual examples of tradable inside bars. Note how they fit in the top or bottom 50% of the "mother" candle.

Backtest results

Eleven currency pairs were backtested from 2004 to 2011 / early 2012. Below is a summary of return on risk for all pairs tested, where:

Return on risk = (average win * win rate (%) - average loss * lose rate (%)) - spread
                                                        size of average stop loss


The sample size is "only" 322, but spans most of the major pairs (EURUSD, USDJPY, USDCHF, AUDUSD, XAUUSD) as well as some minor ones over a space of seven years. More samples will likely change the average return on risk, but shouldn't destroy profitability.

A R:R of 2.5 seems to be best. However, lower R:R are also profitable, so a scaling-out exit strategy is possible.

$10,000 Scenario

The scenario begins with a $10,000 starting account. Three risk levels were analysed, a moderate risk level (2% risk), aggressive (3%) and ultra-aggressive (5%). The scenario utilised all trades recorded in the backtest. A R:R of 2.5 would be used for all trades.

By the end of 2011, a non-taxed $10,000 account would yield the following:

The average annual growth rate is as follows:

The following is a graph of the running balance for each risk level. 

Possible ways to improve this strategy

- Use support / resistance lines to determine entries and/or exits (very subjective and difficult to backtest)
- Use a moving average and trade with trend, or to stay out of flat markets
- Trade the break of both ends of the inside bar (difficult to backtest due to inaccuracy, makes system susceptible to whip-sawing action)
- Loosen position criteria of inside bar (instead of top or bottom 50% of "mother" candle, extend to top or bottom 61.8% etc)

Weaknesses to this strategy

- Susceptible to ranging markets
- Relatively small sample size (but takes up a large swathe of the 2004-2012 daily TF data)
- "Dumb" strategy, pays little respect to market context (but also makes it impervious to emotional weakness if traded to the letter)
- Variance in annual growth
- Negative growth in first year, indicates annual negative growth is possible


  1. Hi Kevin

    I have tested inside bars (IB) as well on world wide futures. It is certainly a good technique.

    At the time I was using half my position with a 1:1 profit target (based on the stop-loss). Then my other half of the position is "risk-free" and I would trend-following it. Most of the time stopped out at a loss, but sometimes making a killing.

    Anyway, I like your idea of a quality IB and have to try when the IB forms on the top or bottom of the "mother bar".

    Keep up the good work,

    1. Thanks Thomas. I've been doing some further work on low-volatility bars. I'll post some more details in the next week, hopefully.

      I like your way of closing half of your position, and letting the other half run risk-free. It's a style of trading that I would really like to study in future, but I have so many ideas to test and not enough time!


Note: Only a member of this blog may post a comment.