Select Page

# How to Use the Supertrend Indicator

Apr 21, 2021

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.

With trend following growing in popularity, there is an abundance of trend indicators to choose from.

When I heard about the catchy Supertrend indicator, I knew I had to check it out.

# What is the Supertrend Indicator?

The Supertrend is not available in MT4 by default, but you can download it here (together with the complete trend strategy illustrated in this post).

The Supertrend indicator essentially determines trend direction, and consists of a single line plotted over prices.

The market is bullish when the Supertrend is plotted below prices, and bearish when it is above prices.

The indicator flips above/below prices whenever a change in trend is detected.

# Supertrend Indicator Calculations

The Supertrend measures market volatility using the average true range.

• Step 1: Calculate the average true range (ATR)

A bar’s true range is the largest of the following:

1. Current high – current low
2. Current high – previous close
3. Current low – previous close

The ATR is then obtained by applying a 10-period rolling average to the true range in the following manner:

• Step 2: Calculate the initial upper and lower bands

These bands are offset from the average price by a multiple of the ATR. By default, a multiple of 3 is used.

• Step 3: Calculate the final upper and lower bands

Notice in the chart above that the bands always move in the same direction?

For example, when the band is below prices, the band only moves upwards or sideways, but never downwards.

The final lower band value is the larger of the current and the previous initial lower band values, calculated in step 2. If the previous initial value is larger, the band moves sideways.

Likewise, the final upper band value is the smaller of the current and previous initial upper band values. If the previous initial value is smaller, the band moves sideways.

• Step 4: Plot the final Supertrend indicator band

We have calculated the upper and lower bands, but only one band is shown on the chart each time.

If prices have closed above the final upper band, an uptrend is signalled. The final lower band should be plotted in this case.

If prices have closed below the final lower band, a downtrend is signalled. The final upper band should be plotted in this case.

I know this can be confusing, so here’s an illustration.

This is how the Supertrend flips above/below prices whenever the trend changes direction.

It reminds me of Wilder’s Parabolic SAR indicator, except that the bands do not accelerate towards prices.

# How to Use the Supertrend Indicator

The easiest way to use the Supertrend is:

• Buy when prices are above the band
• Sell when prices are below the band

In a neatly trending market, such a strategy would yield great returns. The problem is that markets don’t trend that often. Most of the time, you will suffer whipsaws like those below.

The Supertrend tends to produce fewer whipsaw trades than say, a moving average crossover strategy. Nonetheless, we need a way to improve the strategy’s win rate.

A major drawback of the Supertrend indicator is that a single long candle is likely to flip the trend direction.

You may encounter an unfavourable news release, or an extended pullback in a long-term trend. These may not necessarily indicate a trend reversal; such premature market entries are best avoided.

To filter out some of these false entries, we only want to trade in the direction of the long-term trend. As the famous quote goes,

Disregarding the big swing and trying to jump in and out was fatal to me. Nobody can catch all the fluctuations. In a bull market, your game is to buy and hold until you believe that the bull market is near its end.

-Jessie Livermore

I’ll use a 100-period exponential moving average (EMA) to determine trend direction. This time-based average lags the market significantly, but is unlikely to be drastically affected by short-term fluctuations.

# Programming the Supertrend Indicator Strategy

The Supertrend will be used together with a 100-period EMA in the manner below. The strategy will trade symmetrically on the long and short sides; only the long side is shown for brevity.

• Entry Conditions

Price closes above the Supertrend and 100-period EMA.

Place a buy stop at the previous high. Order valid for 3 bars.

150-pip stop loss and trailing stop.

This was programmed in AlgoWizard:

Variables have been assigned to all parameters to allow future optimization.

# Supertrend Indicator Backtest Results

I backtested the Supertrend strategy on the H1 GBPJPY, over the past 10 years.

Not too bad for a basic strategy. Out of curiosity, I removed the EMA trend filter and redid the test.

We have about 8% more trades but the performance, especially drawdown, is worse in all aspects.

# Wrapping Up

The Supertrend is another trend indicator that deserves a place in your toolbox. It only contains two optimizable parameters:

• ATR lookback period
• ATR multiplier

Both parameters control the offset between the Supertrend and prices. I recommend optimizing only one of them.

To avoid false entries, I suggest complementing the Supertrend with time-based trend detection such as moving averages.

Alternatively, you can add momentum indicators like the CCI and QQE to enter the market on pullbacks.

Or if you want to use the Supertrend for trade exits, I believe it would serve well as a trailing stop, much like Wilder’s Parabolic SAR.

The complete strategy described above can be downloaded in the Free Strategies section.

Have you found success with the Supertrend indicator? Let me know in the comments!

## Popular Posts

### What is Considered Good Trading Performance?

Are you taking too much risk for too little return? Perhaps the professional hedge funds can help define good trading performance.

### Automated MACD Divergence Forex Trading Strategy

The MACD is a simple and effective momentum indicator. Here’s how you can save screen time by programming a MACD divergence strategy for the GBPJPY!

### 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!

### 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.

### 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.

### 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.

### 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?

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?

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!

#### Make your money work for you!

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

## 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?

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!

## Dynamic Position Sizing: Is It Time to Go Big?

Should you increase your lot sizes for higher probability trades? Let’s code a dynamic position sizing scheme to capture more outsized wins!

## Pivot Points: A Reliable Support & Resistance Indicator

Pivot points are the perfect tool if you trade using support & resistance. Here’s how to develop an automated pivot points forex strategy!

## 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

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!

## Automated Schaff Trend Cycle Forex Strategy

The Schaff Trend Cycle is a unique combination of the MACD and Stochastic indicators. Here’s how you can use it to improve your trend following results!

## 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.

## Forex Intermarket Correlations: How Do You Exploit Them?

Knowledge of intermarket correlations can improve your forex trading win rate. Here I explain three important types of correlations, and how you can use them to benefit your trading.

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.

## Can Partial Profit Taking Benefit Trend Followers?

Partial profit taking is a dilemma often faced by long-term trend followers. Could this benefit your overall strategy performance?

Let’s test!

## Ride Breakouts With This Support & Resistance Indicator!

StrategyQuant offers a support & resistance ranking indicator to help detect upcoming breakouts. Use it to program an automated USDJPY strategy!

## Automated MACD Divergence Forex Trading Strategy

The MACD is a simple and effective momentum indicator. Here’s how you can save screen time by programming a MACD divergence strategy for the GBPJPY!

## Catch Breakouts With an Inside Bar Trend Strategy!

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!

## 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!

## Bollinger Bands Free Bar Trading Strategy

Bollinger Bands are great at predicting upcoming price reversals. Here’s how you can use its ‘free bars’ to build a reliable Asian scalper!

## 5 Easy Trailing Stops to Boost Your Trend Following Results

Trailing stops are a popular feature in trend following strategies. They provide downside protection and allow you to ride the big trends. Try out these simple yet effective trailing stops for your next trend 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.

## Book Review: Building Winning Algorithmic Trading Systems

Serious traders invest in quality education. Should you read “Building Winning Algorithmic Trading Systems” by Kevin Davey?

## Trade Slippage: How Can You Simulate and Minimize It?

Are you a victim of excessive trade slippage? Here’s how you can minimize slippage, and more realistically simulate it in your backtests!

## Edge Ratio: A Unique Way to Quantify Entry Profitability

Selecting a profitable entry is a critical step in strategy development. Here I’ll demonstrate how to use the Edge Ratio to maximize your profit potential.

## Using Maximum Adverse Excursion for Stop Loss Placement

A catastrophic stop loss is a vital risk management tool for many traders. Here I’ll show you how to optimize your stop loss distance using maximum adverse excursion.

## Multiple Timeframe Backtesting – A Quick Robustness Test

Multiple timeframe backtesting can be a valuable addition to your strategy development workflow. Here I explain why you should do it, and how to conveniently do it in MT4 and StrategyQuant.

## 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.

Risk of ruin is a useful metric to help develop trading strategies that suit your risk appetite. This post explains how to calculate your risk of ruin, and how to use it to improve your trading!

## 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?

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

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.

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.

## Which Forex Markets Are the Best for Trend Following?

They say the trend is your friend, but how do you find your friends in the forex jungle? This post shows you how to use the ADX indicator to identify forex markets and timeframes that trend well.

## 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

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

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.

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?

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.

## Who Are the Major Players in the Forex Market?

With its daily turnover of over \$6 trillion, who are the major players in the forex market? Let’s see how retail traders stack up!

## US Nonfarm Payrolls: What’s Considered a Big Miss?

A big miss in the US nonfarm payrolls can wreak havoc in the markets. What’s considered a big miss? I analyze historical values to find out!

## 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.

## What is Considered Good Trading Performance?

Are you taking too much risk for too little return? Perhaps the professional hedge funds can help define good trading performance.

## 5 Forex Day Trading Challenges & How to Overcome Them

Forex day trading seems to have a particular appeal to new traders. Here I highlight five hidden challenges of day trading, and offer some suggestions on how to overcome them.

## 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

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

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.