Ride Breakouts With This Support & Resistance Indicator!

May 19, 2021

StrategyQuant offers a support & resistance ranking indicator to help predict and detect breakouts. Let’s use it to program an automated 15-minute USDJPY strategy!

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

If you’re a trend follower like me, the word ‘breakout’ is music to your ears.

An explosive breakout could signal the start of a major price trend.

If you trade manually, chart patterns like flags and triangles are often good predictors of upcoming breakouts.

Discerning chart patterns using a trading algorithm is rather challenging. Fortunately, we can circumvent this by using StrategyQuant’s support & resistance ranking (SR%) indicator.

What’s the Support & Resistance Ranking Indicator?

The SR% indicator is not available in MT4 by default; you can download it here.

The SR% calculates the percentage of time the current close falls within the high-low range of each candle in the lookback period.

Here’s a couple of examples to illustrate how it’s calculated. Let’s use a 5-bar lookback period for clarity.

The large bullish candle shows a breakout from a period of consolidation. This candle has a SR% of 0%, because its close lies outside the high-low range of all 5 candles in the lookback period.

At the other end of the spectrum, here we have a small candle that’s caught within a range. Its closing price is within the high-low range of all 5 candles before it, so its SR% is 100%.

Using the Support & Resistance Indicator With Breakouts

You want to look for a series of low SR% values.

If the SR% falls sharply, it likely indicates a breakout has occurred. Here’s an example with a 50-period SR%.

If the SR% falls gradually, prices have been closing near the boundaries of the current trading range. This increase in buying/selling pressure means a breakout could be imminent.

Ideally, you want to see these low SR% values after a long period of consolidation. These are often followed by explosive breakouts.

Programming a Breakout Strategy

Now that we know what to look out for, it’s time to convert our idea into an algorithm.

To exploit the increased buying/selling pressure, I will enter the market when the SR% 3% for the three most recent closes.

This can be programmed very easily in AlgoWizard:

  1. Basic Mode: The SR% will use the bar highs and lows to determine the trading range, as illustrated above. The alternative, ATR Mode, adds an ATR buffer to the trading range. The (high + ATR) and (low – ATR) for each bar are used for the upper and lower boundaries, respectively. This ATR mode gives a delayed but more reliable breakout signal.
  2. LookbackPeriod: The number of bars used to construct the trading range. I’ll use 80.
  3. ATRPeriod: ATR lookback period if you use the ATR mode. Not relevant in this case.
  4. Bar shift [1]: A shift of 1 refers to the most recently completed bar. [2] refers to the bar before that, and so on. All three conditions are identical except for the bar shift.
  5. Threshold: Percentage of time the current close falls within the trading range. I’ll use 3% here. For an 80-bar lookback, this means a maximum of 2 closes within the range.

Note that entry conditions are identical on the long and short sides.

This strategy actually reminds me of the classic Donchian channel breakout, where you go long when price closes above the highest high over the lookback period.

The Turtles used Donchian breakouts to great success in the 1980s.

A key difference is that the Donchian breakout condition only involves the most recent bar, whereas I’m looking at the three most recent bars here.

This should help focus on breakouts that are sustainable, instead of ‘fakeouts’ that quickly revert to the consolidation range.

The Support & Resistance + CCI Combo

I often use two or more conceptually distinct indicators when programming entry signals.

Awaiting confluence from two or more indicator types generally improves signal reliability.

Since the SR% indicator uses price action, I’ll pair it with a seriously underrated momentum indicator: the Commodity Channel Index (CCI).

The CCI measures the current price relative to an average price over a given lookback period. I’ll use a lookback period of 80, similar to that of the SR%.

I consider the market bullish when the CCI exceeds 100, and bearish when the CCI falls below -100. 

Long entries will have an additional CCI > 100 condition, while short entries will need CCI < -100. 

Time-Based Entry Filters and Exits

The periodic fluctuations in trading volume tend to have a large impact on short-term strategies. 

Since this breakout strategy trades on the 15-minute timeframe, I’ll only enter the market when trading volumes are high. 

The London open – New York midday window is usually when volumes are highest. A time filter was configured in AlgoWizard to only allow entries within this window. Don’t forget to use your broker’s time zone!

Lastly, since short-term strategies are most vulnerable to weekend gaps, I’ll prevent entries on Friday, and close all existing trades at Friday 3pm New York time.

Using Stop Entries for Confirmation

I like to use stop entries for breakout strategies, where some price confirmation is needed before I enter the market. 

The entry price is marginally worse, but the improvement in reliability is usually worth it.

For this strategy, buy stops will be placed at 1 ATR above the previous high. Sell stops will be placed 1 ATR below the previous low. Each stop entry will be valid for 3 bars.

With all the rules in place, here’s an example of a long entry.

Backtesting the Support & Resistance Strategy

At last, here’s the 10-year backtest on the USDJPY.

There are long periods of stagnation within the first 5 years. Can the strategy be improved?

I had a detailed look at the equity curve and toggled the overlays for maximum favourable excursion (MFE) and maximum adverse excursion (MAE).

The MFE is the trade’s maximum open profit over the duration of the trade, while the MAE is the maximum open loss.

Looking at the MFE plot above, there were numerous occasions where the strategy lost a large chunk of open profits. Perhaps there was a sharp trend reversal after an undesirable economic report.

Adding a profit target is a good way to minimize open profit giveback. Since this is a trend following strategy, I know I’ll need the occasional outsized win to make up for the relatively low win rate (<50%).

So I’ll add in a 300-pip profit target.

Here’s the new backtest.

Stagnation, return/drawdown and profit factor have all improved.

The 300-pip profit target may seem excessive, especially for a 15-minute strategy. It was only triggered 10 times over the 10-year backtest, but these outsized gains were enough to significantly improve overall results.

Were the Time Filter & CCI Entry Condition Effective?

I first removed the intraday time filter. This means the strategy can now enter the market any time of the day. 

The win rate only drops from 46% to 44%, but overall risk-adjusted performance is far worse. I’m keeping this filter for sure!

If I also remove the CCI entry condition, the strategy becomes untradable.

I think seeking confluence from different indicators, while keeping each indicator’s conditions ‘loose’, is the best way to go.

Wrapping Up

The support & resistance ranking indicator provides a simple way to detect increases in buying/selling pressure.

This can help you jump onboard the next breakout at the earliest opportunity.

Since the SR% indicator uses price action only, it’s best to complement it with momentum or trend detection indicators.

StrategyQuant’s analysis features are great for progressively improving your strategy. In this case, the MFE feature revealed that the strategy would benefit from a profit target. I recommend making 1-2 changes at most. Excessive tweaking will lead to overfitting.

Feel free to download the SR% 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

2 Comments

  1. clonex

    Hey here is Clonex from SQX. Thanks for the mention of SR Percent Rank;)

    Reply
    • Wayne

      No problem! Thanks for being such a great contributor to the SQX community!

      Reply

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?

Automated Bollinger Bands Squeeze Forex Strategy

Automated Bollinger Bands Squeeze Forex Strategy

StrategyQuant’s BBWR indicator is the perfect tool to detect a Bollinger Bands squeeze. Here I explain how it’s calculated, and use it to program a breakout strategy for the AUDJPY!

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