Automated Bollinger Bands Squeeze Forex Strategy

Sep 13, 2021

The Bollinger Bands squeeze is a common signal of an upcoming breakout.

In this post, I’ll introduce the Bollinger Bands Width Ratio indicator, and use it to program a breakout strategy for the AUDJPY.

You can download the complete strategy in the Free Strategies section.

Bollinger Bands are the ever-popular indicator for trend following and mean reversion traders alike.

StrategyQuant provides a Bollinger Bands Width Ratio (BBWR) indicator, which measures the width between the upper and lower bands.

With this indicator, you can detect a Bollinger Bands squeeze and prepare for a potential breakout.

But first, here’s a quick primer on Bollinger Bands and what they signify.

Bollinger Bands and Volatility Cycles

Bollinger Bands consist of a 20-period simple moving average surrounded by a pair of upper and lower bands. These bands are placed at 2 standard deviations above/below the moving average.

In the chart below, you can see how the bands elegantly convey market volatility and trend direction.

The rising moving average indicates an uptrend, while the band width measures market volatility.

Market volatility is often cyclical in nature. Volatility is high when the market trends, and subsequently falls when prices consolidate. The Bollinger Bands therefore alternate between periods of expansion and contraction.

Bollinger Bands Width Ratio Indicator

The BBWR indicator is not available in MT4 by default, but you can download it here.

It quantifies the expansion and contraction of the Bollinger Bands. It uses the following simple calculation:

Here’s the BBWR plotted below prices in MT4:

Small BBWR values indicate a Bollinger Bands squeeze. Reduced volatility often happens before major economic announcements, where the vast majority of market participants wait on the sidelines, ready to jump onboard a trend should a breakout occur.

Large BBWR values indicate strong market trends. Sudden spikes in BBWR indicate a parabolic market move, which often spells the impending end of a trend.

Exploiting the Bollinger Bands Squeeze

Let’s program a Bollinger Bands squeeze breakout strategy for the 1-hour AUDJPY.

The idea is to use a 30-period BBWR to detect a squeeze, which could signal an upcoming breakout.

Quantifying a visual pattern is always a challenge in algorithmic trading.

In this case, I’ll define a squeeze as the BBWR reaching its lowest level in 60 periods.

To improve the win rate, I’ll only take breakouts in the direction of the longer-term trend.

I’ll use a simple momentum filter to determine trend direction. An uptrend is present if the current close is above the close 50 periods ago.

If this squeeze occurs during an uptrend, I’ll place a buy stop at the prior day’s high.

Here’s how a long entry looks:

I’ll use a 70-pip initial stop loss and trailing stop. I find this simple combination works surprisingly well for trend following strategies.

AlgoWizard Programming

Here are the simple entry conditions in AlgoWizard:

Note that there are two different lookback periods in use for the BBWR condition.

‘BB_Period’ is the lookback period for the BBWR itself, which is set to 30.

‘BBWR_Lookback’ is the period used to determine the minimum BBWR value, which is 60.

Stop entries and trade management are programmed as follows:

‘HighD[1]’ refers to the previous day’s high.

Backtesting the Bollinger Bands Squeeze Strategy

It’s easy to cherry pick a handful of spectacular trades from any strategy.

To combat this, I always backtest my strategies over the long-term.

Here’s a 10-year backtest of the BBWR breakout strategy on the 1-hour AUDJPY.

I redid the backtest using MT4’s backtest engine and the statistics are similar:

Getting similar results using different backtest engines and data sources (Dukascopy vs. Alpari) gives me confidence that the strategy has an edge.

Wrapping Up

The BBWR indicator is a great way to quantify the expansion and contraction of the Bollinger Bands.

Small BBWR values indicate a band squeeze, which usually occurs before a breakout.

Abnormally large values reflect a parabolic market move, which can spell the end of a trend.

If you prefer using the Bollinger Bands for mean reversion instead, here’s how you can combine them with candlestick patterns.

You can download the complete strategy in 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