Catch Breakouts With an Inside Bar Trend Strategy!

May 5, 2021

Inside bars can be a valuable predictor of trend continuation. Here’s how you can program an inside bar, and use it to improve your trend following strategy!

You can download the strategy below from the Free Strategies section.

Trend following is a reliable income generator for many retail traders.

Jumping aboard a trend after a pullback or consolidation is a great way to improve your win rate and entry price.

Here I’ll illustrate how you can use inside bars to predict trend continuation for the M30 GBPJPY.

What is an Inside Bar?

An inside bar is one whose price range (candle wicks included) is completely within the price range of its preceding candle.

Algorithmically speaking, the inside bar’s high must be lower than the previous high, and the inside bar’s low must be higher than the previous low.

Market volatility is often cyclical in nature. Periods of intense activity are usually followed by periods of relative calm.

These inside bars indicate a brief period of calmness.

Market participants could be taking profits after riding the initial wave of a trend, or they could be awaiting a major news release.

During such periods of consolidation, any fundamental impetus (such as a positive economic report) can create a strong breakout.

Traders who were previously waiting on the sidelines quickly jump into the market, amplifying and sustaining the emerging trend. The longer the prior consolidation, the stronger the breakout tends to be.

Using Inside Bars for Trend Following

Inside bars can be used to predict trend reversals and continuations.

I’ll focus on trend continuations in this case.

This is the scenario I’ll try to capture when programming the inside bar strategy:

  1. A brief trend is followed by consolidation
  2. An inside bar occurs, indicating low volatility
  3. The market breaks out of the consolidation range, continuing the trend

Pattern recognition is often a weak point of algorithmic trading. Even patterns that are obvious to the human eye are difficult to convert into a set of black-and-white programming rules.

Let’s give it a shot.

Programming Inside Bars

To avoid going insane, I’m going to start with a very loose set of trading rules. Here’s the rules for detecting an uptrend continuation:

  1. An upwards bar occurs, meaning prices close higher.
  2. This is followed by an inside bar.
  3. Another upwards bar occurs.

Here’s how it looks like on a chart:

And now some quick programming with AlgoWizard:

The number in square brackets indicates the bar shift. [1] means the most recently completed bar, while [2] refers to the bar before that, and so on.

The rules for detecting downtrends are the opposite:

  1. A downwards bar occurs, meaning prices close lower.
  2. This is followed by an inside bar.
  3. Another downwards bar occurs.

And in AlgoWizard:

Simple programming rules like these help minimize the risk of curve fitting.

Programming Entry Filters

While simple entry conditions are generally good, I need to minimize the chance of catching false breakouts.

I’ll add two entry filters to help with this – A long-term trend filter, and a stop order filter.

1. Trend Filter

With this filter, I will only trade in the direction of the long-term trend.

Long trades will only be taken when prices close above the 100-period exponential moving average (EMA).

Conversely, shorts will require the close to be below the 100-period EMA.

2. Stop Order Filter

When the above entry conditions are met, a buy stop will be placed at the previous high. This means I’ll only enter the market after seeing some evidence of trend continuation.

For shorts, the sell stop will be placed at the previous low.

Finally, for risk management, I’ll throw in a 120-pip trailing stop and exit all trades on Friday.

With all the entry conditions above, a long entry now looks like this:

And a short entry:

Backtesting the Inside Bar Trend Strategy

As usual, I run a 10-year backtest to verify that the strategy has some long-term edge.

The GBPJPY is known to trend pretty well. Are the results above purely due to the choice of market?

To find out, I removed the inside bar conditions. The strategy now places buy/sell stops when prices close above/below the 100-period EMA, respectively.

I wouldn’t touch that with a ten-foot pole.

I’ve found that adding some sort of pullback/consolidation filter, like the inside bar conditions in this case, usually improve your trend following strategy.

Wrapping Up

Inside bars represent volatility contraction and commonly appear when a trend is consolidating.

A breakout of the consolidation range gives you an opportunity to jump onboard the trend.

The entry conditions above should be used as a starting point. You can improve your win rate by being more selective with your inside bars.

Ideally, you want to see the classic ‘Harami Cross’ pattern:

  • A very small range relative to the previous bar
  • A thin real body, indicating indecision in the market

Another way to get better bang for your buck is to enter on a pullback. I’ve previously written about using the CCI and QQE indicators to detect short-term pullbacks.

If you want the backtest the inside bar strategy above, you can download it from the Free Strategies section.

Want to develop a portfolio of automated trading strategies?

Supercharge your strategy development with StrategyQuant

Access 14-day FREE trial here!

Get up to USD 300 discount!

Strategies need improvement?

Use QuantAnalyzer’s powerful analysis tools

Try the FREE version here!

Get 20% Discount here!

FXVM Forex VPS
Follow Us

Popular Posts

Laguerre RSI Trend Following Strategy

The Laguerre RSI attempts to improve the responsiveness of the regular RSI, whilst keeping whipsaw trades to a minimum. Let’s see how well it detects short-term pullbacks for a trend following strategy!

read more

What is Fixed Ratio Money Management?

Have you heard of fixed ratio money management? How does it compare to the popular fixed fractional approach? Here I’ll explain how fixed ratio works, and see how it stacks up against fixed fractional money management.

read more

Build a Diversified Portfolio With QuantAnalyzer

The ability to efficiently trade a diversified portfolio of strategies is one of the biggest advantages of algorithmic trading. Here we will use QuantAnalyzer’s Portfolio Master to build a portfolio consisting of high performing, uncorrelated strategies.

read more

What Is the QQE Indicator?

The QQE is a mysterious indicator that sometimes pops up in trading forums. Does it deserve a place alongside the more traditional momentum indicators like the RSI and CCI? Let’s add it to a trend following strategy to find out!

read more

Hey there, Wayne here! I’m on a mission to develop robust algorithmic trading strategies for the forex markets. Trading Tact is where I share my trading methods and insights.

Follow Us
Have a Question?

Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Want to develop a portfolio of automated trading strategies?

Supercharge your strategy development with StrategyQuant

Access 14-day FREE trial here!

Get up to USD 300 discount!

Strategies need improvement?

Use QuantAnalyzer’s powerful analysis tools

Try the FREE version here!

Get 20% Discount here!

FXVM Forex VPS

Recent Posts

Should You Use the Kelly Criterion for Forex Trading?

Should You Use the Kelly Criterion for Forex Trading?

The Kelly criterion is a famous mathematical formula that attempts to maximize your long-term capital growth. In this post, I’ll apply it to a EURUSD breakout strategy and explain some of its potential shortcomings when applied to forex trading.

read more

Hey there, Wayne here! I’m on a mission to develop robust algorithmic trading strategies for the forex markets. Trading Tact is where I share my trading methods and insights.

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Pin It on Pinterest

Share This