SuperTrend Strategy: Buy Low, Sell High to Profit from Market Swings

Highlight

  • Introduce the SuperTrend Indicator and the Average Directional Index ( ADX ).
  • Explain the SuperTrend Strategy and how to optimize it using the ADX indicator.
  • Backtest the SuperTrend Strategy and observe its effectiveness in capturing market swings.

Preface

The SuperTrend Indicator is a technical analysis tool for identifying trends in stock markets, aiding investors in determining market swings, and enhancing buy-sell timing. The SuperTrend Indicator is especially suitable for investors who need help discerning market directions or frequently exit trades too early, missing out on potential gains. However, one drawback of the SuperTrend Indicator is its tendency to be less effective during consolidation phases. Hence, by combining it with the Average Directional Index (ADX), which measures trend strength, we can refine this strategy to filter out noisy signals better and improve entry and exit decisions.

Understanding the SuperTrend Indicator & ADX Indicator

SuperTrend Indicator

This indicator tracks trends by plotting upper and lower bands around price movements. When the price crosses above the upper band, it signals a potential upward trend; crossing below signals a downward trend.

To calculate the upper and lower bands of the SuperTrend Indicator, we need to follow three steps:

Step1: Calculate ATR

The ATR ( Average True Range ) is based on the TR ( True Range ), representing the maximum price movement within a specific period. The TR is usually determined by the greatest absolute value among the following three differences:

  • The difference between t day high and low prices.
  • The difference between t-1 day closing price and the t day high price.
  • The difference between t-1 day closing price and t day low price.

The ATR is obtained by applying a moving average to the TR over a specified period, typically 14 days.
p.s. For more applications of ATR, you can refer to: TQuant Lab Loss Aversion Strategy — Average True Range.

Step2: Calculate Basic Upper and Lower Bands

The formulas for the basic upper and lower bands are as follows:

  • Basic upper band = ( High + Low ) / 2 + Multiplier × ATR
  • Basic lower band = ( High + Low ) / 2 – Multiplier × ATR

The Multiplier is a factor used to adjust the distance of the bands.

Step3: Calculate Final Upper and Lower Bands

  • Final upper band: If the new basic upper band is lower than t-1 day final upper band, or if t-1 day’ closing price is higher than t-1 day final upper band, the new basic upper band is used. Otherwise, the previous final upper band is retained.
  • Final lower band: If the new basic lower band is higher than t-1 day final lower band, or if t-1 day closing price is lower than t-1 day final lower band, the new basic lower band is used. Otherwise, the t-1 day final lower band is retained.
SuperTrend Strategy
Chart:SuperTrend Indicator Diagram from TradingView

The diagram above illustrates the SuperTrend Indicator applied to a price chart. We can observe that the SuperTrend Indicator effectively identifies upward trending phases; however, it produces noise during consolidation phases, leading to less reliable signals. To mitigate this, we pair the SuperTrend Indicator with the ADX, which helps us determine the trend’s strength. This combination allows us to construct a more robust SuperTrend strategy. Below, we will explain the formulas behind the SuperTrend and ADX indicators to provide insight into their inner workings.

ADX Indicator

The ADX indicator, developed by J. Welles Wilder in 1978, measures the strength of a trend and ranges from 0 to 100, with higher values indicating more robust trends. By combining the SuperTrend Indicator with the ADX, we can more effectively differentiate between trending and consolidating phases.

The ADX indicator ranges from 0 to 100, with the following interpretations:

  1. ADX < 25: Weak market trend, indicating a consolidation phase.
  2. 25 < ADX < 50: The market is forming a moderate trend.
  3. ADX > 50: The market has established a strong trend.

The ADX calculation involves four steps:

Step1: Calculate ATR

The ATR is calculated in the same manner as in the SuperTrend Indicator.

Step2: Calculate +DM, -DM ( Directional Movement )

  • +DM: If ( t day High – t-1 day High ) >(t-1 day Low –t day Low ),
    then +DM = max ( t day High –t-1 day High, 0 ). Otherwise, +DM = 0.
  • -DM:If (t-1 day Low –t day Low ) > (t day High –t-1 day High ),
    then -DM = max (t-1 day Low –t day Low, 0 ). Otherwise, -DM = 0.

Step3: Calculate +DI, -DI ( Directional Indicator )

  • +DI: 100 × ( Moving Average of +DM / ATR )
  • -DI: 100 × ( Moving Average of -DM / ATR )

Step4: Calculate ADX

DX = 100 × ( |+DI – (-DI)| / |+DI + (-DI)| )

The ADX is obtained by applying a moving average to the DX over a specified period.

The following demonstrates how we will generate the trading signals required for the SuperTrend strategy using TQuant Lab.

SuperTrend Strategy with ADX Optimization

The following demonstrates how we will generate the trading signals required for the SuperTrend strategy.

Backtesting with TEJ Market Data

We set the followin data and rule to backtest.

  • Stock Pool:Top 10 market value of listed electronics companies in Taiwan stock market at the end of 2018
  • Backtest period:from Jan 1, 2019, to Jul 1, 2024
  • Trading set:liquidity slippage and transaction fees
  • Initial capital of 1,000,000 NTD
  • Benchmark:TAIEX-Total Return Index ( IR0001 )
  • ATR calculation period for the SuperTrend Indicator:50 days
  • Multiplier:4
  • ADX calculation period:14 days

Start Building Portfolios That Outperform the Market!

Construct the SuperTrend Strategy

To create a balanced SuperTrend strategy, we use the ADX to confirm trend strength and adjust the entry/exit rules :

  • Long Entry: Buy when the closing price crosses above the SuperTrend’s upper band, indicating a potential uptrend.
  • Short Entry: Sell when the price crosses below the lower band and ADX exceeds 50, signaling a strong downtrend.

This combined approach mitigates SuperTrend’s sensitivity in flat markets, improving profitability in trend-driven segments.

Key Observations in Backtesting

SuperTrend Strategy
Chart:Backtesting Performance Compared to Benchmark

As shown in the table above, the SuperTrend strategy achieved an annualized return of 25.88%, with a relatively low annualized volatility of around 13%. When further examining the performance metrics, the Sharpe ratio is 1.84, and the Sortino ratio is 2.82, indicating that the SuperTrend strategy effectively avoids downside risks while earning excess returns with relatively lower risk.

Observing the performance curve, although the SuperTrend strategy did not significantly outperform the market, we can see that after reaching a peak at the beginning of 2021, the returns leveled off until mid-2022, successfully avoiding the significant downturn of the 2022 bear market. Moreover, there was a good recovery trend after 2023, demonstrating the SuperTrend strategy’s ability to lock in profits during uptrends and preemptively avoid downside risks.

SuperTrend Strategy
Chart:SuperTrend Strategy underwater plot

The underwater plot chart shows that the two most significant drawdowns occurred during the pandemic in early 2020 and the bear market in 2022. However, compared to the 30% drawdown experienced by the broader market during these periods, the SuperTrend strategy’s 16% and 14% drawdowns were relatively minor.

TSMC (2330.TW) Stock Performance under the SuperTrend Strategy

Take the famous company in Taiwan – TSMC as a sample to understand the performance of individual stocks under the Super Trend strategy. In the chart, red dots represent entry points, and green dots represent exit points. We can see that the SuperTrend strategy successfully profited during the uptrend from 2019 to 2020. However, during the consolidation phase in 2021 and the downtrend in 2022, there were some cases where it bought at relatively high points, indicating a failure. Fortunately, the sell points optimized by the ADX indicator limited some of the losses, and the buy point in 2023 successfully captured the profits up to July 2024.

SuperTrend Strategy
Chart:TSMC SuperTrend Strategy Performance Chart

Conclusion

This strategy was inspired by the Super Trend indicator. Given the indicator’s failure during consolidation phases, we used the ADX indicator to optimize the strategy and reduce short-term trading noise. This strategy effectively captured uptrend gains and minimized losses, particularly valuable given the recent bullish trends in Taiwan’s tech-heavy stock index. TEJ’s comprehensive financial data on Taiwanese equities allowed for accurate trend following and risk management.

Please note that the strategy and target discussed in this article are for reference only and do not constitute any recommendation for specific commodities or investments.

Why TEJ Data Supports Taiwan Market Investments

TEJ provides extensive, high-quality financial data covering the Taiwan stock market, tailored for market trend analysis. As the Taiwan Stock Exchange recently peaked due to rising semiconductor stocks, TEJ’s data allows investors to monitor trends closely and craft strategies tailored to Taiwan’s unique market dynamics.

Taiwan Economic Journal (TEJ), a financial database established in Taiwan for over 30 years, serves local financial institutions and academic institutions, and has long-term cooperation with internationally renowned data providers, providing high-quality financial data for five financial markets in Asia. 

  • Complete Coverage: Includes all listed companies on stock markets in Taiwan, China, Hong Kong, Japan, Korea, etc. 
  • Comprehensive Analysis of Enterprises: Operational aspects, financial aspects, securities market performance, ESG sustainability, etc. 
  • High-Quality Database: TEJ data is cleaned, checked, enhanced, and integrated to ensure it meets the information needs of financial and market analysis. 

With TEJ’s assistance, you can access relevant information about major stock markets in Asia, such as securities market, financials data, enterprise operations, board of directors, sustainability data, etc., providing investors with timely and high-quality content!

Extended Reading

Back
Procesing