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.

Trades 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

No Results Found

The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.

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.

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

Laguerre RSI Trend Following Strategy

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
Do You Know Your Strategy’s Optimization Profile?

Do You Know Your Strategy’s Optimization Profile?

Your strategy’s optimization profile often reveals its robustness, helping you select strategies that will remain profitable in live trading. Here I explain why an optimization profile is important, and how you can easily obtain one using StrategyQuant’s optimizer.

read more
How to Use the Supertrend Indicator

How to Use the Supertrend Indicator

Despite its cool name, the Supertrend indicator often seems to slip under the radar. Here I explain how it’s calculated, and combine it with moving averages to produce a simple trend following strategy.

read more
How to Select the Best Forex VPS

How to Select the Best Forex VPS

A virtual private server (VPS) is a virtual computer that you can rent and access remotely. It provides a reliable platform on which to execute your forex strategies. This post will help you decide whether you need a VPS, and show you how to select an optimal VPS.

read more
Out-of-sample Testing Using Monte Carlo Simulations

Out-of-sample Testing Using Monte Carlo Simulations

Traders often use Monte Carlo simulations to estimate worst-case drawdowns, but did you know they can be used for out-of-sample testing too? This post demonstrates the use of StrategyQuant’s Monte Carlo simulator to randomize historical prices and strategy parameters, helping you select robust strategies for live trading.

read more
Ichimoku Trend Following Strategy

Ichimoku Trend Following Strategy

Like candlesticks, the Ichimoku indicator is a fine Japanese creation. Here I’ll explain how the Ichimoku is plotted, and use it to build a trend following strategy for the USDJPY.

read more
Forex Trading With Volume – Does It Work?

Forex Trading With Volume – Does It Work?

Volume is seldom discussed in forex trading. But as a stock trader would tell you, volume provides insights into the underlying market sentiment. Here I’ll demonstrate the use of two simple volume filters to improve entry reliability.

read more
What Is the Kaufman Adaptive Moving Average?

What Is the Kaufman Adaptive Moving Average?

The Kaufman Adaptive Moving Average is a unique indicator that automatically adapts to the market’s noise. Here I explain its inner workings and show you how to build a trend following strategy around it.

read more
Awesome Oscillator Forex Trend Strategy

Awesome Oscillator Forex Trend Strategy

The Awesome Oscillator is one of Bill Williams’ fine creations. It is a simple yet effective momentum indicator that can be a valuable addition to your strategy. Here we’ll use it together with a moving average to fine-tune our trend following entries.

read more
Dual CCI Indicator Forex Trend Strategy

Dual CCI Indicator Forex Trend Strategy

The Commodity Channel Index (CCI) is an underrated momentum indicator that is often overshadowed by the RSI and MACD. I’ll show you how to build a simple trend following strategy using a pair of CCI indicators!

read more
How Many Trades Should Your Backtest Have?

How Many Trades Should Your Backtest Have?

We all want a large sample of trades in our backtests, but practical limitations such as data availability often get in the way. Here I’ll explain why 30 trades is insufficient, and how you can use standard error to quantify the uncertainty arising from a small sample size.

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!

Pin It on Pinterest

Share This