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.

Powered By

Development Platform

Forex VPS

FXVM Forex VPS

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

Make your money work for you!

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

Comments

0 Comments

Submit a Comment

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

Trading Strategies

What’s the Best Time to Trade Forex?

What’s the Best Time to Trade Forex?

The forex markets are open 24/5, but not all hours are created equal. Here I dissect my broker data to determine the best time to trade forex.

Forex Weekend Gaps: Can You Exploit Them?

Forex Weekend Gaps: Can You Exploit Them?

Have you noticed that forex weekend gaps usually reverse within 3 days? Here I’ll program a mean reversion strategy to exploit gaps over the last 18 years!

Money Flow Index: An Improved RSI?

Money Flow Index: An Improved RSI?

The Money Flow Index is sometimes called the volume-weighted RSI. Can it outperform the RSI in this trend following strategy?

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.

Can a Trading Pause Improve Your Trend Following Results?

Can a Trading Pause Improve Your Trend Following Results?

A temporary trading pause can improve your win rate if you’re trend following a volatile market. Here I’ll program a trading pause into a simple breakout strategy, and test its effectiveness on the Widow Maker – the GBPJPY.

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!

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.

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.

Strategy Development

Do You Know Your System Quality Number?

Do You Know Your System Quality Number?

The System Quality Number measures the profitability & consistency of your trading system. Here’s how to calculate your SQN and use it to improve your trading!

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.

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.

Which MT4 Backtest Report Metrics Should You Use?

Which MT4 Backtest Report Metrics Should You Use?

Understanding your backtest report is an essential part of being a successful strategy developer. Here I explain what the numbers mean, and how you can make use of each metric during strategy development.

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.

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.

Build a Diversified Portfolio With QuantAnalyzer

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.

Strategy Optimization Using MT4

Strategy Optimization Using MT4

How do you improve your trading strategy in MT4? This post will show you how to optimize the entry and exit parameters for a moving average crossover strategy. Finally, an intraday time filter will be added to help avoid false breakouts.

Debugging & Backtesting Using MT4

Debugging & Backtesting Using MT4

With a fresh algorithm at your fingertips, how do you verify that it has been programmed correctly? This guide will show you how to use Metatrader 4’s visual backtester to debug and backtest your strategy.

Create Your Trading Algorithm in 15 Minutes (FREE)

Create Your Trading Algorithm in 15 Minutes (FREE)

Converting your trading idea into an algorithm is the first step towards reaping the benefits of automated trading. This guide will cover the creation of a simple moving average crossover algorithm, without any actual programming.

What Is Drawdown in Trading?

What Is Drawdown in Trading?

Are you getting a comprehensive assessment of your strategy’s downside? This post will discuss several methods to measure drawdowns, helping you build and select strategies that better suit your risk appetite.

Live Trading

What’s the Best Time to Trade Forex?

What’s the Best Time to Trade Forex?

The forex markets are open 24/5, but not all hours are created equal. Here I dissect my broker data to determine the best time to trade forex.

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.

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.

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.

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