Skip to main content
US market 11 min read

Supertrend indicator backtest: QQQ and stock rules fail

Supertrend indicator backtest on QQQ and US stocks: nine ATR-band settings, costs and split-period checks. None passes all tests.

These rules did not pass validation

Compare returns and drawdowns.

Compare results
Rules failed robustness

Supertrend strategy equity curves: timing, inverse timing, individual stocks and total-return benchmark

None of the three Supertrend holding designs passes all robustness checks in this experiment. From 2017-01-03 to 2026-11-09, the central QQQ timing rule returned 11.3% a year with daily Sharpe 0.88, versus 20.1% and 0.92 for QQQ total return. This is a study of a failed trading hypothesis, rather than a validated strategy to deploy.

The stock version returned -6.4% a year and won 0 of nine parameter comparisons. Applying the indicator to individual companies did not reproduce a robust advantage over QQQ. The figure compares all three central rules with the benchmark from the same starting value; click it for the full-size chart.

These trading rules are research results. To rerun the experiment, set up FinLab and download the research program (.py). Other files are in the research downloads.

Supertrend indicator: the band must remember its past

Supertrend starts with the midpoint between the current high and low. It adds or subtracts a multiple of average true range, or ATR, to obtain two basic bands. ATR measures movement size, including gaps relative to the previous close. It does not by itself say whether the next move will be up or down.

The final bands are recursive. An upper band can retain its earlier level until price or the new basic band permits a change. The lower band follows the corresponding rule. A directional state determines which band is active, and a closing-price crossing switches that state. Drawing fresh midpoint-plus-ATR lines on every bar, without the carried-forward bands, would create a different indicator.

Part Fixed implementation Consequence
Midpoint Current high plus low, divided by two The envelope follows the bar's center
True range Largest of the bar range and the two previous-close gaps Overnight movement affects distance
ATR smoothing Wilder recursion, seeded by an arithmetic average A simple rolling average is not substituted
Final bands Carried forward under the recursive conditions The indicator has memory
Trend switch Close crosses the active final band Signal is available after the close

At initialization, the rule waits for an ATR estimate and begins in the down state. The warm-up history precedes the performance window. Once initialized, an up state persists until close falls below the final lower band; a down state persists until close exceeds the final upper band. No separate profit target or maximum holding period is added.

Supertrend versus an ATR trailing stop

A one-sided ATR trailing stop starts with an existing long position and manages its exit boundary. It does not necessarily tell the account when to open the next long position. Supertrend has both upper and lower bands plus a rule for switching between them. It provides an entry state as well as an exit state.

That difference prevents a misleading comparison. If one test stays invested after an unrelated entry signal while another waits for a Supertrend flip, their returns differ because of both entries and exits. Changing only the label to ATR stop would conceal that change. The leveraged ETF timing study compares other trend filters and fund execution; this experiment keeps Supertrend's own switching mechanism.

A large band multiplier gives price more room before a reversal, which can reduce whipsaw but increase the distance traveled before exit. A small multiplier can shorten a losing trade while increasing the number of short-lived signals. The ATR length changes how quickly the band width reacts to a volatility shock. These two controls interact, so the experiment runs every pair rather than changing one while quietly holding the other at a favorable value.

Why the line can look helpful while the portfolio disappoints

A volatility-scaled boundary often looks natural on a chart. It widens after large bars and tightens when recent ranges shrink. That visual adaptation does not prove that its crossing dates separate good future returns from bad ones. The stock experiment asks whether applying the state to many liquid companies creates a better portfolio; the QQQ experiment asks whether the same state adds timing value to one fixed fund.

The inverse-timing test is especially useful when the positive state spends long periods out of the market. If most gains simply occur outside the indicator's preferred sessions, holding those other sessions should reveal it. But the inverse direction must face the same cost, half-period and neighboring-parameter checks. It is not accepted merely because the first direction failed.

Prices can also jump through a band overnight. The backtest uses next-close execution after the full daily bar becomes available. It never assumes an order filled at the band merely because that level appears between two chart points. A separate intraday stop implementation would need its own data and execution assumptions, including gaps and liquidity.

TradingView's indicator documentation credits Supertrend to Olivier Seban and specifies the recursive upper/lower-band calculation used in this experiment. Original source.

Results: all three holding designs

Central design Annualized return (CAGR) Daily Sharpe Max drawdown First / second half Sharpe Settings beating QQQ Time invested
QQQ timing 11.3% 0.88 -19.5% 1.03 / 0.74 3 / 9 62.1%
QQQ inverse timing 7.8% 0.50 -32.1% 0.75 / 0.26 0 / 9 37.9%
Individual stocks -6.4% -0.18 -76.2% 0.10 / -0.46 0 / 9 100.0%
QQQ total return 20.1% 0.92 -35.1% 1.22 / 0.63 — 100%

Daily Sharpe here means average daily return divided by its standard deviation, multiplied by the square root of 252, without subtracting a risk-free rate. CAGR uses elapsed calendar years. Maximum drawdown is the deepest fall from a previous equity peak. These are different questions, so a higher Sharpe does not imply a higher annual return. Sharpe (1994) defines the ratio using differential returns; the zero-rate convention here is explicit.

The embedded FinLab report is the central QQQ timing rule, not the best-performing grid cell. The second downloadable report is the central stock portfolio. The headline table keeps the full common window, including cash before the first trade; a report can begin at its first executed trade. Its built-in Sharpe also has its own risk-free-rate convention, while this study's comparisons consistently use zero.

Neighboring parameters and the two halves

Wilder ATR length 7, 10 or 14 sessions; band multiplier 2, 3 or 4. The center is ATR(10) with a three-times band. Every combination was registered before reviewing results. At least seven of the nine settings must beat QQQ's same-window daily Sharpe. The central setting must also beat it in each half of the trading-day calendar. These are robustness screens on historical data, not untouched out-of-sample forecasts.

Supertrend nine neighboring settings: daily Sharpe difference from the benchmark

Supertrend first-half and second-half daily Sharpe for each central rule and benchmark

Blue positive cells beat the benchmark; negative cells do not. The three panels belong to timing, inverse timing and stock holding. The split-period chart compares those same central allocations with QQQ rather than changing parameters between periods. A full-window lead cannot compensate for a failed half or an unstable neighborhood.

Costs, cash and the best year

The US market default in sim() is zero commission and zero transaction tax. Each central rule is also rerun with 0.1% per side, a separate allowance for trading friction. No additional market-impact model, tax-on-capital-gains calculation or capacity estimate is supplied.

The equity curves, parameter grid, split-period chart and embedded report use zero commission. The table separates the 0.1% per-side cost results from the zero-commission BIL comparison.

Central rule CAGR at 0.1% per side Daily Sharpe at 0.1% Zero-fee Sharpe after BIL Best calendar year removed Sharpe without that year / QQQ
QQQ timing 10.4% 0.82 0.70 2020 0.81 / 0.87
QQQ inverse timing 7.0% 0.46 0.37 2023 0.39 / 0.78
Individual stocks -9.6% -0.33 -0.28 2026 -0.31 / 0.94

Subtracting BIL's daily total return gives QQQ an excess-return Sharpe of 0.81. Idle cash earns zero in the strategy; the experiment does not quietly pay Treasury returns to cash holdings. The fixed-exposure control holds the same average fraction of QQQ every day and keeps the remainder at zero-return cash. Its Sharpe for the timing allocation is 0.92, compared with 0.88 for the rule. The control excludes rebalancing costs.

Removing the central rule's best calendar year is an additional historical stress test. That year is selected from the rule's own annual returns, and the same dates are removed from the benchmark. The remaining daily returns are compounded without inserting a return across the removed interval. Passing this check cannot repair an earlier failure.

Supertrend drawdowns calculated from actual portfolio equity

Universe, execution and limits of the evidence

Signals are formed after the close and executed at the following trading session’s market close in every grid and central rule.

The data end on 2026-11-09 and this run was completed on 2026-11-11, using finlab 2.3.8. US adjusted OHLC comes from us_price for stocks and us_fund_price for QQQ. QQQ's adjusted close is the total-return benchmark, computed directly from prices without transaction costs. Every comparison uses its available trading calendar.

The stock universe uses FinLab's common-stock classification, adjusted price above 5,a60−sessionaverageadjusted−price−times−volumeamountabove5, a 60-session average adjusted-price-times-volume amount above 5 million, and the 100 largest such amounts each day. The amount requires at least 20 observations. A stock is excluded after a 50% absolute daily move, using a rolling 252-session record shifted by one session. This screens earlier extreme moves; it cannot prevent the first extreme event. The common-stock classification is a present security-type filter, so historical classification changes remain a limitation.

Eligible stocks with positive indicator states receive equal target weights, recalculated daily. The market, liquidity ranking and indicator use information available at that close. No present-day S&P 500 membership list, analyst snapshot, financial-statement factor or investor's private strategy is used. Available delisted price columns are retained when they pass classification, but completeness of delisting returns is not separately audited. Financial and other sectors are not individually excluded, and there is no market-cap forecast or sector-neutral constraint.

Each stock receives 1 divided by the number of current holdings; no additional per-stock cap is imposed, so a single remaining stock can receive 100%. The fund rules allocate either 100% to QQQ or 100% to cash. Target-weight turnover for each central allocation is:

Central allocation Recorded trades Average monthly target turnover Highest month
QQQ timing 40 33.2% 100.0%
QQQ inverse timing 40 33.2% 100.0%
Individual stocks 3632 140.1% 483.0%

The central stock version averages 39.6 positions. Target-weight turnover is half the absolute daily target-weight changes, summed by month. This is not executed notional turnover: price drift and execution details can change the actual amount. A change in universe membership can require trading even without a fresh indicator reversal.

All tests are historical and in sample. Registering parameters before this run reduces within-batch cherry-picking, but the idea and market were selected with knowledge of financial history. The half-period split, grid and best-year check do not provide a statistical probability of future profit. Bailey and colleagues (2017) examine backtest overfitting; this study does not estimate their probability-of-overfitting statistic. Moskowitz, Ooi and Pedersen (2012) study futures trend following, which does not validate this indicator.

Reproduce the rule with an AI agent

Complete the FinLab setup flow with Claude Code, Codex or Gemini CLI. The agent guide explains how the skill gives your agent access to FinLab's data and backtests. The direct skill install command is:

Show Code
npx skills add koreal6803/finlab-ai --skill finlab -g -y

The browser version, FinLab Studio, also supports AI research. Ask the agent to reproduce the fixed experiment before proposing changes: “Use the downloaded Supertrend research program, keep its registered dates and nine settings, and compare the three holding rules with QQQ including the cost test.” The point is to retain the definitions in the results table. A newly generated trading rule, even if it uses the same indicator name, does not reproduce this experiment.

Download the research program as research.py in the working directory. This excerpt runs the central individual-stock rule; the program's command-line options also run the complete grid. Its dependency command includes finlab, numba and TA-Lib. Login is handled by FinLab.

Show Code
import finlab
from research import load, signal, backtest
 
finlab.login()
prices, eligible = load("us")
state = signal(prices, "supertrend", 10, 3)
position = (state & eligible).loc["2017-01-03":"2026-11-09"]
report = backtest(position)
report.to_html("supertrend_stocks_report.html")

Questions about this Supertrend test

What is the best setting? The middle values were fixed in advance. The heatmap supplies every neighboring outcome; no winning cell is substituted for the original rule.

Does a smaller drawdown prove the signal works? Cash can reduce both drawdown and return. The fixed-exposure and BIL comparisons ask whether the timing adds more than that reduction in participation.

Does the inverse rule mean short selling? No. It holds QQQ in the original rule's cash sessions and holds cash otherwise. Borrow fees and short-position losses are outside this experiment.

Can these results be transferred to an individual stock? The separate stock portfolio already tests a liquid universe, and its failure does not support selecting a few attractive charts afterward. Company-specific concentration adds another risk.

Does the report's Sharpe equal the table's? Not necessarily. This table consistently uses daily returns with a zero risk-free rate and a common full window. Report conventions and a first-trade start can differ.

Can I change the timeframe to intraday? That requires another dataset and new execution assumptions. Daily highs and lows cannot identify the order of intraday fills or guarantee fills at indicator boundaries.

For broader context, the US strategy studies distinguish validated rules from negative experiments. Backtesting methods explain execution and bias; the quant glossary defines the result metrics. The Bollinger Bands study tests a different volatility envelope, and Turtle trading tests channel breakouts. FinLab's research workflow and team information provide product and author context.

Research downloads

File Contents
Download research program (Python) Give this to your AI agent after setting up FinLab
Download daily balances (CSV) Daily balances for the rules and benchmark; opens in a spreadsheet
Download complete test results (JSON) Full test results for AI or coding tools
Open timing report (web) Interactive webpage; no setup or installation needed
Open stock report (web) Interactive webpage; no setup or installation needed

Past performance does not guarantee future results. This material is for research and education and is not investment advice. It does not recommend any individual stock, guarantee a stop price or promise that a historical advantage will persist.

Last updated: 2026-11 | Backtest window: 2017-01-03 to 2026-11-09 | Author: FinLab Quant Research. The team maintains reproducible Taiwan and US market studies using FinLab data.

FinLab AI

Want to build your own strategy?

Describe your stock-picking ideas in natural language. AI automatically validates, backtests, and gives you answers

Start Free

More Technical Indicators research

View all