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


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.

Make your money work for you!

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



  1. clonex

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

    • Wayne

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


Submit a Comment

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

Trading Strategies

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.

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.

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.

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!

What is Fixed Ratio Money Management?

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.

What Is the Kaufman Efficiency Ratio?

What Is the Kaufman Efficiency Ratio?

Avoiding false breakouts is a common goal among trend traders. The Kaufman Efficiency Ratio provides a simple method of quantifying a market’s noise, helping traders focus on the smoothest trends. Let’s add the efficiency ratio to a simple trend following strategy and see whether its performance improves.

What Is the QQE Indicator?

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!

Do Bollinger Bands + Candlestick Patterns Work?

Do Bollinger Bands + Candlestick Patterns Work?

Bollinger Bands are great at detecting overbought and oversold conditions. Let’s use them to develop a countertrend strategy, and then refine our entries using limit entries and candlestick patterns.

How Good Are The Bollinger Bands’ Trailing Stops?

How Good Are The Bollinger Bands’ Trailing Stops?

Trailing stop losses are a popular feature in many trend following systems. Bollinger Bands, the ever-popular technical indicator among retail traders, actually contain two inbuilt trailing stops. Are these any good? Let’s find out!

Bollinger Bands vs. Keltner Channels

Bollinger Bands vs. Keltner Channels

Bollinger Bands are ubiquitous in the trading world, but there’s less discussion about their lesser-known cousin, the Keltner Channels. Do these perform as well as the Bollinger Bands? Let’s compare them over a broad range of input parameters.

Strategy Development

How to Select the Best Trading Strategy Entry

How to Select the Best Trading Strategy Entry

With an abundance of technical indicators available, selecting your strategy’s entry conditions can be overwhelming. This post will illustrate a method to graphically compare the profitability of different entries.

Live Trading

No Results Found

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

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