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

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.

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

How to Find a Real Trading Guru

How to Find a Real Trading Guru

Every day I come across a trading guru offering educational content on the internet. Many of them speak of huge returns with minimal effort. Should these be trusted? Here’s some tips on how to separate the wheat from the chaff.

read more
How to Enjoy Stress-Free Trading

How to Enjoy Stress-Free Trading

Trading is a great way to make some additional income, but not if you’re constantly pulling your hair out. Here I offer 7 tips to help make your trading profitable and stress-free.

read more
How to Get a Realistic Backtest Spread

How to Get a Realistic Backtest Spread

Your choice of backtest spread can certainly make or break a strategy. This post will show you how to study the intraday spread variations of your market, and suggest several ways to avoid paying ridiculous spreads.

read more
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

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!

Pin It on Pinterest

Share This