SPY daily data, 2016 to 2026: the ATR 10, factor 3 rule, long and short, lost 17.8% after costs over 93 trades, winning 37.6% of them, against +277.8% for holding SPY. Long only it made 100.1%. The best of 9 runs was ATR 10, factor 3 on NVDA, long only: +3902.6%, held-out survived. Every run, every trade and the script are on this page.
Answers here: Does the SuperTrend strategy work? · What are the best SuperTrend settings? · Does it beat holding the stock? · Long only, or both ways?
SPY daily data, 4 January 2016 to 23 October 2026, long and short: 93 trades, lost 17.8% after costs, 37.6% of trades won, profit factor 1.05, worst drawdown 47.3%, 99% of the time in the market. Holding SPY returned +277.8% over the same period.
Held out on its own, the last third (16 March 2023 to 23 October 2026) made 19.2% on 27 trades: the rule survived its held-out period.
Long only, the same rule made 100.1% on 47 trades (51.1% won, profit factor 2.14, held-out survived): the short side cost 117.9 points of return in a period when SPY rose 277.8%.
On 5-minute data the same rule traded 1246 times in 2.4 years on SPY and lost 84.2%: at 0.15% a round trip, costs alone came to roughly 187% of the account over the period, which is where a daily rule moved to minute charts usually dies.
Across all 9 runs on this page, 5 made money after costs, 6 survived the held-out third, and 0 beat holding the symbol.
The best run was ATR 10, factor 3 on NVDA, long only: +3902.6% net on 41 trades, profit factor 4.94, worst drawdown 41.8%, held-out survived. The tester's verdict on it reads "real edge so far · check the test period".
SuperTrend Strategy, from the strategy library.
Goes long when the SuperTrend line (ATR length 10, factor 3) flips below price and goes short when it flips above price, so the script is always in the market: each flip closes the old trade and opens the new one. There is no stop or target beyond the next flip. Three settings were run on SPY, the default on QQQ and NVDA, and long-only versions on all three.
The indicator itself, with its Pine code drawn on real market data: SuperTrend.
Net and holding the symbol are after costs over the same period. Held-out is the verdict on the last third of the history judged alone: survived, decayed, did not survive, or too few trades to judge.
| Symbol | Timeframe | Settings | Direction | Trades | Win rate | Net | Holding | Profit factor | Max drawdown | Held-out |
|---|---|---|---|---|---|---|---|---|---|---|
| NVDA | daily | ATR 10, factor 3 | long and short | 82 | 34.2% | +66.6% | +25955.3% | 1.75 | 76.9% | decayed |
| SPY | daily | ATR 10, factor 3 | long and short | 93 | 37.6% | -17.8% | +277.8% | 1.05 | 47.3% | survived |
| SPY | daily | ATR 7, factor 2 | long and short | 152 | 39.5% | +3.3% | +277.8% | 1.14 | 41.3% | did not survive |
| SPY | daily | ATR 14, factor 4 | long and short | 61 | 34.4% | -29.6% | +277.8% | 0.96 | 50.2% | survived |
| QQQ | daily | ATR 10, factor 3 | long and short | 88 | 37.5% | -8.0% | +542.3% | 1.16 | 35.8% | survived |
| SPY | daily | ATR 10, factor 3 | long only | 47 | 51.1% | +100.1% | +277.8% | 2.14 | 18.1% | survived |
| QQQ | daily | ATR 10, factor 3 | long only | 44 | 52.3% | +194.0% | +542.3% | 2.61 | 20.2% | survived |
| NVDA | daily | ATR 10, factor 3 | long only | 41 | 51.2% | +3902.6% | +25955.3% | 4.94 | 41.8% | survived |
| SPY | 5-minute | ATR 10, factor 3 | long and short | 1246 | 26.6% | -84.2% | +44.4% | 0.53 | 84.3% | did not survive |
ATR 10, factor 3 on SPY, long and short, the same rule long only, and SPY itself, each calendar year after costs. A partial first or last year counts the sessions it has.
| Year | ATR 10, factor 3, long and short | ATR 10, factor 3, long only | Holding SPY |
|---|---|---|---|
| 2016 | +2.2% | +8.7% | +11.2% |
| 2017 | +4.5% | +11.3% | +18.5% |
| 2018 | -8.3% | -6.6% | -6.9% |
| 2019 | +8.7% | +18.8% | +28.6% |
| 2020 | -5.1% | +9.0% | +15.1% |
| 2021 | -23.2% | -0.1% | +28.8% |
| 2022 | -7.4% | -12.2% | -19.9% |
| 2023 | -0.5% | +11.9% | +24.8% |
| 2024 | +14.8% | +19.7% | +24.0% |
| 2025 | +0.0% | +9.4% | +16.6% |
| 2026 | -1.6% | +5.1% | +11.2% |
The 93 trades of ATR 10, factor 3 on SPY, long and short, oldest first: side, entry and exit days, fill prices after slippage, and the return after both commissions. The other runs' trades open below.
| Side | In | Out | Entry | Exit | Return |
|---|---|---|---|---|---|
| long | 2016-02-23 | 2016-05-20 | 194.05 | 204.86 | +5.5% |
| short | 2016-05-20 | 2016-05-31 | 204.86 | 210.61 | -2.9% |
| long | 2016-05-31 | 2016-06-20 | 210.61 | 208.76 | -1.0% |
| short | 2016-06-20 | 2016-07-01 | 208.76 | 209.42 | -0.4% |
| long | 2016-07-01 | 2016-09-12 | 209.42 | 212.33 | +1.3% |
| short | 2016-09-12 | 2016-11-10 | 212.33 | 217.38 | -2.5% |
| long | 2016-11-10 | 2017-03-22 | 217.38 | 233.70 | +7.4% |
| short | 2017-03-22 | 2017-04-26 | 233.70 | 238.60 | -2.2% |
| long | 2017-04-26 | 2017-05-18 | 238.60 | 235.63 | -1.3% |
| short | 2017-05-18 | 2017-05-26 | 235.63 | 241.62 | -2.6% |
| long | 2017-05-26 | 2017-08-11 | 241.62 | 243.95 | +0.9% |
| short | 2017-08-11 | 2017-09-05 | 243.95 | 247.31 | -1.5% |
| long | 2017-09-05 | 2018-02-05 | 247.31 | 273.39 | +10.4% |
| short | 2018-02-05 | 2018-02-27 | 273.39 | 278.19 | -1.9% |
| long | 2018-02-27 | 2018-03-23 | 278.19 | 264.08 | -5.2% |
| short | 2018-03-23 | 2018-05-14 | 264.08 | 273.42 | -3.6% |
| long | 2018-05-14 | 2018-06-26 | 273.42 | 271.56 | -0.8% |
| short | 2018-06-26 | 2018-07-11 | 271.56 | 277.22 | -2.2% |
| long | 2018-07-11 | 2018-10-10 | 277.22 | 286.75 | +3.3% |
| short | 2018-10-10 | 2018-12-04 | 286.75 | 278.45 | +2.8% |
| long | 2018-12-04 | 2018-12-10 | 278.45 | 263.29 | -5.5% |
| short | 2018-12-10 | 2019-01-09 | 263.29 | 257.62 | +2.1% |
| long | 2019-01-09 | 2019-05-08 | 257.62 | 287.46 | +11.5% |
| short | 2019-05-08 | 2019-06-10 | 287.46 | 289.44 | -0.8% |
| long | 2019-06-10 | 2019-08-02 | 289.44 | 293.77 | +1.4% |
| short | 2019-08-02 | 2019-09-06 | 293.77 | 298.25 | -1.6% |
| long | 2019-09-06 | 2019-10-02 | 298.25 | 291.43 | -2.4% |
| short | 2019-10-02 | 2019-10-18 | 291.43 | 298.76 | -2.6% |
| long | 2019-10-18 | 2020-01-28 | 298.76 | 324.97 | +8.7% |
| short | 2020-01-28 | 2020-02-06 | 324.97 | 334.01 | -2.9% |
| long | 2020-02-06 | 2020-02-25 | 334.01 | 323.84 | -3.1% |
| short | 2020-02-25 | 2020-03-05 | 323.84 | 305.07 | +5.7% |
| long | 2020-03-05 | 2020-03-10 | 305.07 | 284.54 | -6.8% |
| short | 2020-03-10 | 2020-04-09 | 284.54 | 277.66 | +2.3% |
| long | 2020-04-09 | 2020-06-12 | 277.66 | 308.15 | +10.9% |
| short | 2020-06-12 | 2020-07-16 | 308.15 | 319.88 | -3.9% |
| long | 2020-07-16 | 2020-09-04 | 319.88 | 346.03 | +8.1% |
| short | 2020-09-04 | 2020-10-09 | 346.03 | 345.67 | +0.0% |
| long | 2020-10-09 | 2020-10-29 | 345.67 | 326.82 | -5.6% |
| short | 2020-10-29 | 2020-11-06 | 326.82 | 350.03 | -7.2% |
| long | 2020-11-06 | 2021-02-01 | 350.03 | 373.62 | +6.6% |
| short | 2021-02-01 | 2021-02-09 | 373.62 | 389.72 | -4.4% |
| long | 2021-02-09 | 2021-03-05 | 389.72 | 380.31 | -2.5% |
| short | 2021-03-05 | 2021-04-05 | 380.31 | 403.57 | -6.2% |
| long | 2021-04-05 | 2021-05-13 | 403.57 | 406.96 | +0.7% |
| short | 2021-05-13 | 2021-06-11 | 406.96 | 424.31 | -4.4% |
| long | 2021-06-11 | 2021-06-21 | 424.31 | 416.69 | -1.9% |
| short | 2021-06-21 | 2021-06-29 | 416.69 | 428.01 | -2.8% |
| long | 2021-06-29 | 2021-07-20 | 428.01 | 425.56 | -0.7% |
| short | 2021-07-20 | 2021-07-26 | 425.56 | 439.43 | -3.4% |
| long | 2021-07-26 | 2021-09-15 | 439.43 | 444.50 | +1.1% |
| short | 2021-09-15 | 2021-10-20 | 444.50 | 451.25 | -1.6% |
| long | 2021-10-20 | 2021-11-29 | 451.25 | 463.94 | +2.7% |
| short | 2021-11-29 | 2021-12-28 | 463.94 | 477.85 | -3.1% |
| long | 2021-12-28 | 2022-01-19 | 477.85 | 458.05 | -4.2% |
| short | 2022-01-19 | 2022-02-03 | 458.05 | 451.07 | +1.4% |
| long | 2022-02-03 | 2022-02-23 | 451.07 | 432.57 | -4.2% |
| short | 2022-02-23 | 2022-03-23 | 432.57 | 447.03 | -3.4% |
| long | 2022-03-23 | 2022-04-25 | 447.03 | 423.54 | -5.4% |
| short | 2022-04-25 | 2022-07-22 | 423.54 | 399.03 | +5.7% |
| long | 2022-07-22 | 2022-08-29 | 399.03 | 402.09 | +0.7% |
| short | 2022-08-29 | 2022-10-26 | 402.09 | 381.72 | +5.0% |
| long | 2022-10-26 | 2022-12-19 | 381.72 | 383.36 | +0.3% |
| short | 2022-12-19 | 2023-01-24 | 383.36 | 398.99 | -4.2% |
| long | 2023-01-24 | 2023-03-02 | 398.99 | 392.58 | -1.7% |
| short | 2023-03-02 | 2023-04-03 | 392.58 | 408.97 | -4.3% |
| long | 2023-04-03 | 2023-08-14 | 408.97 | 444.58 | +8.6% |
| short | 2023-08-14 | 2023-08-31 | 444.58 | 451.77 | -1.7% |
| long | 2023-08-31 | 2023-09-22 | 451.77 | 432.34 | -4.4% |
| short | 2023-09-22 | 2023-11-03 | 432.34 | 433.23 | -0.3% |
| long | 2023-11-03 | 2024-04-15 | 433.23 | 514.99 | +18.8% |
| short | 2024-04-15 | 2024-05-07 | 514.99 | 517.69 | -0.6% |
| long | 2024-05-07 | 2024-07-22 | 517.69 | 552.85 | +6.7% |
| short | 2024-07-22 | 2024-08-16 | 552.85 | 551.57 | +0.1% |
| long | 2024-08-16 | 2024-11-01 | 551.57 | 571.17 | +3.5% |
| short | 2024-11-01 | 2024-11-07 | 571.17 | 593.24 | -4.0% |
| long | 2024-11-07 | 2024-12-19 | 593.24 | 591.20 | -0.4% |
| short | 2024-12-19 | 2025-01-22 | 591.20 | 606.08 | -2.6% |
| long | 2025-01-22 | 2025-02-26 | 606.08 | 595.75 | -1.8% |
| short | 2025-02-26 | 2025-04-30 | 595.75 | 547.74 | +8.0% |
| long | 2025-04-30 | 2025-08-04 | 547.74 | 625.50 | +14.1% |
| short | 2025-08-04 | 2025-08-13 | 625.50 | 645.08 | -3.2% |
| long | 2025-08-13 | 2025-10-13 | 645.08 | 660.47 | +2.3% |
| short | 2025-10-13 | 2025-10-28 | 660.47 | 687.25 | -4.2% |
| long | 2025-10-28 | 2025-11-19 | 687.25 | 660.60 | -4.0% |
| short | 2025-11-19 | 2025-12-11 | 660.60 | 685.29 | -3.8% |
| long | 2025-12-11 | 2026-01-21 | 685.29 | 679.47 | -0.9% |
| short | 2026-01-21 | 2026-04-09 | 679.47 | 675.02 | +0.6% |
| long | 2026-04-09 | 2026-06-08 | 675.02 | 743.16 | +10.0% |
| short | 2026-06-08 | 2026-08-05 | 743.16 | 776.04 | -4.5% |
| long | 2026-08-05 | 2026-09-17 | 776.04 | 762.95 | -1.8% |
| short | 2026-09-17 | 2026-10-07 | 762.95 | 775.97 | -1.8% |
| long | 2026-10-07 | 2026-10-23 | 775.97 | 759.72 | -2.2% |
Pine v6, exactly as it ran for ATR 10, factor 3 on SPY, long and short. The variants change only the inputs listed in the table.
//@version=6
strategy("SuperTrend Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, initial_capital=100000, commission_type=strategy.commission.percent, commission_value=0.05, slippage=1, margin_long=0, margin_short=0)
factor = input.float(3, "ATR multiplier", minval=0.5, step=0.1, group="Setup")
atrLen = input.int(10, "ATR length", minval=1, group="Setup")
useLong = input.bool(true, "Trade longs", group="Direction")
useShort = input.bool(true, "Trade shorts", group="Direction")
tpMult = input.float(0, "Target (ATR multiples, 0 = off)", minval=0, step=0.5, group="Risk")
[st, dir] = ta.supertrend(factor, atrLen)
atr = ta.atr(atrLen)
up = dir < 0
longSig = up and not up[1] and barstate.isconfirmed
shortSig = not up and up[1] and barstate.isconfirmed
plot(up ? st : na, "Up trend", color=color.new(#16A56A, 0), linewidth=2, style=plot.style_linebr)
plot(up ? na : st, "Down trend", color=color.new(#E5484D, 0), linewidth=2, style=plot.style_linebr)
if longSig
strategy.close("Short")
if useLong
strategy.entry("Long", strategy.long)
strategy.exit("Long target", "Long", limit=tpMult > 0 ? close + tpMult * atr : na)
if shortSig
strategy.close("Long")
if useShort
strategy.entry("Short", strategy.short)
strategy.exit("Short target", "Short", limit=tpMult > 0 ? close - tpMult * atr : na)
Alpaca daily data since 2016, and 5-minute data from the last 600 sessions, 0.05% commission and 0.025% slippage on every fill, the last third of the history held out, textbook settings and nothing tuned. The engine, fills and what it does not model are written out once, in data and methodology.
Describe the rule in your own words or paste the script. The Free plan writes the Pine v6 script with the AI, runs it on any US stock or ETF with the same costs and the same held-out check, and shows every trade on the chart. No card.
Seventeen popular rules through the same engine, the same costs and the same held-out check, with every trade listed. Next: Trailing stop strategy, Parabolic SAR strategy, Keltner Channel strategy.
SPY, daily data, 2016 to 2026, long and short: ATR 10, factor 3 lost 17.8% after costs over 93 trades (37.6% won, profit factor 1.05) against +277.8% for holding SPY, and the held-out third survived. Long only it made 100.1%. Across all 9 runs on the page, 5 made money after costs, 6 survived their held-out third and 0 beat holding the stock.
From 26.6% to 52.3% across the 9 runs. The classic setting, ATR 10, factor 3 on SPY long and short, won 37.6% of 93 trades. The win rate alone does not decide the result: that run's profit factor was 1.05, so its winners outweighed its losers, and the net return was -17.8%.
Of the 3 settings tested, ATR 10, factor 3 on NVDA (long only) did best: +3902.6% net, profit factor 4.94, held-out survived. That is the best of 9 tries on 10.8 years of daily data of one symbol, which is already a fitted number. A setting that works on one symbol or one period only is a coincidence, not a setting; run it on your own symbol and timeframe before trusting it.
0 of the 9 runs did. SPY itself returned +277.8% between 4 January 2016 and 23 October 2026, so a rule that is out of the market part of the time has a lot to make up; what a timing rule usually gets you is a smaller drawdown, not a bigger return. The classic run's worst drawdown was 47.3% with 99% of the time in the market.
The last third of every run's history (16 March 2023 to 23 October 2026 for the lead run) was judged on its own, with no fitting on it: 6 of 9 runs survived, 1 decayed, 2 did not survive and 0 had too few trades there to judge. Survived means a positive Sharpe ratio on the held-out part at least half the fitted period's; it is a check on one later stretch, not a forecast.
With the free Alpha Charts tester's own engine: the Pine v6 scripts on this page, run on Alpaca daily data since 2016, and 5-minute data from the last 600 sessions, split-adjusted and not dividend-adjusted, one position at a time with the whole account, fills at the next candle's open, a commission of 0.05% and slippage of 0.025% on every fill, the last third of the history held out. The settings are the textbook ones and every variant is stated; nothing was tuned to make the page look better.
Every number on this page is the output of the Alpha Charts backtest engine on 25 October 2026, on Alpaca market data; the scripts are the strategy library's templates, shown as they ran. Symbols are US-listed ETFs and stocks; results are price returns after the costs stated. Past results are not a forecast and nothing here is investment advice. TradingView and Pine Script belong to TradingView, Inc.; Alpha Charts is not affiliated with it.