SPY daily data, 2016 to 2026: the 14, 3, 3, 80/20 rule, long and short, lost 54.2% after costs over 142 trades, winning 38.0% of them, against +277.8% for holding SPY. Long only it made 28.0%. The best of 6 runs was 14, 3, 3, 80/20 on SPY, long only: +28.0%, held-out survived. Every run, every trade and the script are on this page.
Answers here: Does the stochastic crossover strategy work? · What is its win rate? · 14,3,3 or faster? · Long only, or both ways?
SPY daily data, 4 January 2016 to 23 October 2026, long and short: 142 trades, lost 54.2% after costs, 38.0% of trades won, profit factor 0.71, worst drawdown 56.9%, 65% 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) lost 23.4% on 49 trades: it did not survive its held-out period.
Long only, the same rule made 28.0% on 41 trades (53.7% won, profit factor 1.49, held-out survived): the short side cost 82.2 points of return in a period when SPY rose 277.8%.
On 5-minute data the same rule traded 2244 times in 2.4 years on SPY and lost 96.7%: at 0.15% a round trip, costs alone came to roughly 337% of the account over the period, which is where a daily rule moved to minute charts usually dies.
Across all 6 runs on this page, 2 made money after costs, 2 survived the held-out third, and 0 beat holding the symbol.
The best run was 14, 3, 3, 80/20 on SPY, long only: +28.0% net on 41 trades, profit factor 1.49, worst drawdown 19.5%, held-out survived. The tester's verdict on it reads "made money, but could be luck".
Stochastic Strategy, from the strategy library.
Goes long when %K (14 periods, smoothed by 3) crosses above %D while both sit under 20 and goes short when %K crosses below %D while over 80; a cross back the other way above 50 (below 50 for shorts) closes the trade. A stop sits 2 ATR away. A faster 5,3,3 setting was run on SPY, and long-only versions on SPY and QQQ.
The indicator itself, with its Pine code drawn on real market data: Stochastic Oscillator.
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 |
|---|---|---|---|---|---|---|---|---|---|---|
| SPY | daily | 14, 3, 3, 80/20 | long and short | 142 | 38.0% | -54.2% | +277.8% | 0.71 | 56.9% | did not survive |
| SPY | daily | 5, 3, 3, 80/20 | long and short | 140 | 33.6% | -64.4% | +277.8% | 0.50 | 65.6% | did not survive |
| QQQ | daily | 14, 3, 3, 80/20 | long and short | 171 | 38.6% | -73.2% | +542.3% | 0.65 | 77.3% | did not survive |
| SPY | daily | 14, 3, 3, 80/20 | long only | 41 | 53.7% | +28.0% | +277.8% | 1.49 | 19.5% | survived |
| QQQ | daily | 14, 3, 3, 80/20 | long only | 48 | 58.3% | +26.1% | +542.3% | 1.35 | 31.3% | survived |
| SPY | 5-minute | 14, 3, 3, 80/20 | long and short | 2244 | 23.9% | -96.7% | +44.4% | 0.30 | 96.7% | did not survive |
14, 3, 3, 80/20 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 | 14, 3, 3, 80/20, long and short | 14, 3, 3, 80/20, long only | Holding SPY |
|---|---|---|---|
| 2016 | -11.0% | 0.0% | +11.2% |
| 2017 | -8.5% | +1.7% | +18.5% |
| 2018 | +9.5% | +9.4% | -6.9% |
| 2019 | -7.2% | +7.5% | +28.6% |
| 2020 | -12.8% | +4.4% | +15.1% |
| 2021 | -10.2% | +1.4% | +28.8% |
| 2022 | -3.8% | -8.3% | -19.9% |
| 2023 | -4.5% | +3.9% | +24.8% |
| 2024 | -0.9% | +8.5% | +24.0% |
| 2025 | -19.4% | -4.5% | +16.6% |
| 2026 | +0.1% | +2.8% | +11.2% |
The 142 trades of 14, 3, 3, 80/20 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 |
|---|---|---|---|---|---|
| short | 2016-03-01 | 2016-03-04 | 194.95 | 200.20 | -2.8% |
| short | 2016-03-08 | 2016-05-10 | 199.26 | 206.77 | -3.9% |
| short | 2016-06-02 | 2016-06-21 | 209.74 | 208.35 | +0.6% |
| short | 2016-07-08 | 2016-07-12 | 210.99 | 214.71 | -1.9% |
| short | 2016-07-18 | 2016-08-30 | 215.91 | 218.32 | -1.2% |
| short | 2016-11-15 | 2016-11-25 | 216.97 | 221.17 | -2.0% |
| short | 2016-11-29 | 2016-12-07 | 220.45 | 224.01 | -1.7% |
| short | 2016-12-13 | 2017-01-04 | 226.94 | 225.69 | +0.5% |
| short | 2017-02-21 | 2017-03-01 | 235.45 | 239.24 | -1.7% |
| long | 2017-03-27 | 2017-04-05 | 232.00 | 236.19 | +1.7% |
| short | 2017-05-01 | 2017-06-02 | 238.62 | 244.33 | -2.5% |
| short | 2017-06-07 | 2017-06-27 | 243.53 | 243.11 | +0.1% |
| short | 2017-07-19 | 2017-08-16 | 245.95 | 247.18 | -0.6% |
| short | 2017-09-18 | 2017-10-02 | 249.54 | 252.09 | -1.1% |
| short | 2017-10-06 | 2017-11-07 | 254.08 | 259.19 | -2.1% |
| short | 2017-11-10 | 2017-11-28 | 257.66 | 260.87 | -1.3% |
| short | 2017-12-01 | 2018-01-03 | 264.69 | 270.32 | -2.2% |
| short | 2018-01-10 | 2018-01-12 | 273.61 | 277.54 | -1.5% |
| short | 2018-01-17 | 2018-01-19 | 277.96 | 280.48 | -1.0% |
| short | 2018-01-25 | 2018-02-08 | 284.08 | 268.05 | +5.5% |
| short | 2018-03-01 | 2018-03-13 | 271.33 | 280.22 | -3.4% |
| long | 2018-03-28 | 2018-04-20 | 260.83 | 268.73 | +2.9% |
| short | 2018-04-20 | 2018-05-07 | 268.73 | 266.98 | +0.6% |
| short | 2018-05-16 | 2018-07-02 | 271.03 | 269.59 | +0.4% |
| long | 2018-07-02 | 2018-07-13 | 269.59 | 279.11 | +3.4% |
| short | 2018-07-13 | 2018-08-27 | 279.11 | 289.87 | -4.0% |
| short | 2018-08-31 | 2018-10-16 | 289.76 | 276.65 | +4.4% |
| long | 2018-10-16 | 2018-10-24 | 276.65 | 267.97 | -3.2% |
| long | 2018-10-30 | 2018-11-13 | 263.75 | 272.98 | +3.4% |
| long | 2018-11-27 | 2018-12-06 | 266.42 | 265.84 | -0.3% |
| long | 2018-12-27 | 2019-01-16 | 242.64 | 260.75 | +7.4% |
| short | 2019-01-16 | 2019-02-05 | 260.75 | 272.71 | -4.7% |
| short | 2019-02-08 | 2019-02-19 | 268.67 | 277.65 | -3.4% |
| short | 2019-02-22 | 2019-04-03 | 278.03 | 287.40 | -3.5% |
| short | 2019-04-10 | 2019-05-01 | 287.69 | 294.80 | -2.6% |
| short | 2019-05-02 | 2019-05-13 | 291.60 | 282.50 | +3.0% |
| long | 2019-06-05 | 2019-06-13 | 282.41 | 289.32 | +2.3% |
| short | 2019-06-13 | 2019-06-20 | 289.32 | 296.12 | -2.5% |
| short | 2019-06-24 | 2019-08-07 | 294.15 | 284.49 | +3.2% |
| long | 2019-08-07 | 2019-08-26 | 284.49 | 287.19 | +0.8% |
| short | 2019-09-11 | 2019-10-07 | 298.39 | 293.55 | +1.5% |
| short | 2019-10-21 | 2019-11-27 | 299.34 | 315.23 | -5.4% |
| short | 2019-12-26 | 2020-01-14 | 321.57 | 328.06 | -2.1% |
| short | 2020-01-15 | 2020-01-17 | 327.25 | 331.84 | -1.5% |
| short | 2020-01-23 | 2020-01-31 | 330.54 | 327.09 | +0.9% |
| short | 2020-02-12 | 2020-03-02 | 336.74 | 298.28 | +11.3% |
| long | 2020-03-02 | 2020-03-09 | 298.28 | 275.21 | -7.8% |
| long | 2020-03-16 | 2020-03-16 | 241.25 | 241.11 | -0.2% |
| long | 2020-03-20 | 2020-04-06 | 242.60 | 257.77 | +6.2% |
| short | 2020-04-16 | 2020-04-29 | 279.07 | 294.35 | -5.6% |
| short | 2020-05-01 | 2020-06-05 | 285.23 | 318.39 | -11.7% |
| short | 2020-06-08 | 2020-06-17 | 320.13 | 314.15 | +1.8% |
| short | 2020-07-10 | 2020-08-06 | 314.16 | 333.47 | -6.2% |
| short | 2020-08-12 | 2020-08-26 | 335.36 | 344.84 | -2.9% |
| short | 2020-08-28 | 2020-09-02 | 349.35 | 355.29 | -1.8% |
| long | 2020-09-15 | 2020-09-21 | 341.22 | 325.61 | -4.7% |
| long | 2020-09-28 | 2020-10-14 | 333.31 | 350.64 | +5.1% |
| short | 2020-10-14 | 2020-11-03 | 350.64 | 333.78 | +4.7% |
| long | 2020-11-03 | 2020-11-11 | 333.78 | 356.30 | +6.6% |
| short | 2020-11-11 | 2020-12-21 | 356.30 | 375.88 | -5.6% |
| short | 2021-01-13 | 2021-02-03 | 378.59 | 382.55 | -1.1% |
| short | 2021-02-11 | 2021-03-03 | 391.14 | 385.90 | +1.2% |
| short | 2021-03-19 | 2021-04-05 | 389.78 | 403.57 | -3.6% |
| short | 2021-04-14 | 2021-05-17 | 412.72 | 415.50 | -0.8% |
| short | 2021-06-04 | 2021-06-23 | 420.63 | 423.31 | -0.7% |
| short | 2021-07-01 | 2021-07-07 | 428.71 | 434.49 | -1.4% |
| short | 2021-07-08 | 2021-08-30 | 428.66 | 453.02 | -5.8% |
| short | 2021-09-03 | 2021-09-16 | 451.86 | 447.44 | +0.9% |
| short | 2021-10-25 | 2021-11-03 | 454.16 | 462.63 | -2.0% |
| short | 2021-11-04 | 2021-12-06 | 465.23 | 456.26 | +1.8% |
| long | 2021-12-06 | 2021-12-15 | 456.26 | 463.29 | +1.4% |
| short | 2021-12-31 | 2022-01-25 | 475.51 | 433.18 | +8.8% |
| long | 2022-01-25 | 2022-02-14 | 433.18 | 439.80 | +1.4% |
| long | 2022-02-25 | 2022-03-24 | 429.73 | 445.81 | +3.6% |
| short | 2022-03-24 | 2022-03-29 | 445.81 | 461.44 | -3.6% |
| short | 2022-03-31 | 2022-04-18 | 457.77 | 436.93 | +4.5% |
| long | 2022-04-18 | 2022-04-25 | 436.93 | 423.18 | -3.2% |
| long | 2022-04-29 | 2022-05-02 | 423.71 | 410.72 | -3.2% |
| long | 2022-05-13 | 2022-06-03 | 396.82 | 412.25 | +3.8% |
| short | 2022-06-03 | 2022-06-17 | 412.25 | 365.58 | +11.2% |
| long | 2022-06-17 | 2022-07-13 | 365.58 | 375.00 | +2.5% |
| short | 2022-07-26 | 2022-07-29 | 393.73 | 410.86 | -4.5% |
| short | 2022-08-03 | 2022-08-12 | 410.21 | 426.89 | -4.2% |
| short | 2022-08-18 | 2022-08-26 | 426.74 | 419.50 | +1.6% |
| long | 2022-09-02 | 2022-09-16 | 400.40 | 383.09 | -4.4% |
| long | 2022-09-20 | 2022-09-22 | 385.16 | 373.55 | -3.1% |
| long | 2022-09-27 | 2022-10-13 | 368.12 | 349.13 | -5.3% |
| short | 2022-10-28 | 2022-11-11 | 379.77 | 396.92 | -4.6% |
| short | 2022-11-17 | 2022-12-01 | 390.35 | 409.35 | -5.0% |
| long | 2022-12-22 | 2023-01-18 | 383.16 | 398.92 | +4.0% |
| short | 2023-01-18 | 2023-02-01 | 398.92 | 412.81 | -3.6% |
| short | 2023-02-07 | 2023-02-27 | 408.76 | 399.97 | +2.1% |
| long | 2023-02-27 | 2023-03-10 | 399.97 | 386.35 | -3.5% |
| short | 2023-04-05 | 2023-05-09 | 407.78 | 411.24 | -0.9% |
| short | 2023-06-08 | 2023-06-13 | 426.50 | 435.57 | -2.2% |
| short | 2023-06-16 | 2023-06-29 | 442.90 | 436.07 | +1.4% |
| short | 2023-07-07 | 2023-07-13 | 438.51 | 448.02 | -2.3% |
| short | 2023-07-21 | 2023-08-09 | 453.84 | 449.15 | +0.9% |
| long | 2023-08-15 | 2023-08-17 | 446.39 | 439.37 | -1.7% |
| long | 2023-08-22 | 2023-09-06 | 441.29 | 448.28 | +1.5% |
| short | 2023-09-06 | 2023-09-26 | 448.28 | 429.21 | +4.2% |
| long | 2023-09-26 | 2023-09-27 | 429.21 | 423.28 | -1.5% |
| long | 2023-10-31 | 2023-11-10 | 416.29 | 435.86 | +4.6% |
| short | 2023-11-10 | 2023-11-14 | 435.86 | 446.45 | -2.5% |
| short | 2023-11-17 | 2023-12-13 | 450.12 | 464.88 | -3.4% |
| short | 2023-12-15 | 2023-12-26 | 469.36 | 476.57 | -1.6% |
| short | 2024-01-02 | 2024-01-09 | 472.03 | 472.00 | -0.1% |
| short | 2024-01-25 | 2024-02-02 | 487.43 | 491.16 | -0.9% |
| short | 2024-02-13 | 2024-02-23 | 494.38 | 509.39 | -3.1% |
| short | 2024-02-28 | 2024-03-08 | 505.19 | 516.12 | -2.3% |
| short | 2024-03-12 | 2024-03-20 | 513.31 | 520.70 | -1.5% |
| short | 2024-03-26 | 2024-04-23 | 521.09 | 501.93 | +3.6% |
| long | 2024-04-23 | 2024-05-13 | 501.93 | 522.41 | +4.0% |
| short | 2024-05-13 | 2024-06-06 | 522.41 | 535.53 | -2.6% |
| short | 2024-06-17 | 2024-07-09 | 541.93 | 556.50 | -2.8% |
| short | 2024-07-11 | 2024-07-30 | 561.29 | 546.41 | +2.6% |
| long | 2024-07-30 | 2024-08-02 | 546.41 | 532.44 | -2.7% |
| long | 2024-08-08 | 2024-08-22 | 524.04 | 562.41 | +7.2% |
| short | 2024-08-22 | 2024-09-11 | 562.41 | 548.85 | +2.3% |
| short | 2024-09-19 | 2024-10-14 | 570.86 | 581.65 | -2.0% |
| short | 2024-10-16 | 2024-11-06 | 579.63 | 589.36 | -1.8% |
| short | 2024-11-13 | 2024-12-24 | 597.16 | 596.21 | +0.1% |
| short | 2025-01-27 | 2025-03-03 | 594.67 | 596.34 | -0.4% |
| long | 2025-03-03 | 2025-03-04 | 596.34 | 579.17 | -3.0% |
| long | 2025-03-10 | 2025-03-10 | 567.74 | 557.31 | -1.9% |
| long | 2025-03-17 | 2025-03-31 | 562.92 | 549.67 | -2.5% |
| short | 2025-05-01 | 2025-05-13 | 560.22 | 584.55 | -4.4% |
| short | 2025-05-21 | 2025-06-30 | 588.31 | 618.48 | -5.2% |
| short | 2025-07-02 | 2025-08-13 | 617.08 | 645.08 | -4.6% |
| short | 2025-08-18 | 2025-09-11 | 642.69 | 655.47 | -2.1% |
| short | 2025-09-18 | 2025-10-27 | 661.71 | 682.91 | -3.3% |
| short | 2025-10-31 | 2025-11-24 | 684.86 | 662.87 | +3.1% |
| long | 2025-11-24 | 2025-12-09 | 662.87 | 682.98 | +2.9% |
| short | 2025-12-09 | 2025-12-22 | 682.98 | 684.11 | -0.3% |
| short | 2025-12-30 | 2026-02-19 | 687.27 | 684.04 | +0.4% |
| long | 2026-03-18 | 2026-03-20 | 668.51 | 652.04 | -2.6% |
| long | 2026-03-24 | 2026-03-27 | 651.49 | 635.38 | -2.6% |
| long | 2026-04-01 | 2026-04-20 | 654.05 | 708.60 | +8.2% |
| short | 2026-04-20 | 2026-05-06 | 708.60 | 728.36 | -2.9% |
| short | 2026-05-15 | 2026-06-12 | 741.60 | 740.97 | 0.0% |
| short | 2026-07-15 | 2026-07-31 | 754.04 | 744.88 | +1.1% |
| short | 2026-08-07 | 2026-08-28 | 770.82 | 771.96 | -0.2% |
Pine v6, exactly as it ran for 14, 3, 3, 80/20 on SPY, long and short. The variants change only the inputs listed in the table.
//@version=6
strategy("Stochastic Strategy", overlay=false, 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)
len = input.int(14, "%K length", minval=1, group="Setup")
smK = input.int(3, "%K smoothing", minval=1, group="Setup")
smD = input.int(3, "%D smoothing", minval=1, group="Setup")
ob = input.int(80, "Overbought", minval=50, maxval=100, group="Levels")
os = input.int(20, "Oversold", minval=0, maxval=50, group="Levels")
useLong = input.bool(true, "Trade longs", group="Direction")
useShort = input.bool(true, "Trade shorts", group="Direction")
atrLen = input.int(14, "ATR length", minval=1, group="Risk")
stopMult = input.float(2, "Stop (ATR multiples, 0 = off)", minval=0, step=0.5, group="Risk")
k = ta.sma(ta.stoch(close, high, low, len), smK)
d = ta.sma(k, smD)
atr = ta.atr(atrLen)
// every cross computed every bar; the zone decides which one counts
upCross = ta.crossover(k, d)
downCross = ta.crossunder(k, d)
longSig = upCross and k < os and barstate.isconfirmed
shortSig = downCross and k > ob and barstate.isconfirmed
exitLong = downCross and k > 50 and barstate.isconfirmed
exitShort = upCross and k < 50 and barstate.isconfirmed
plot(k, "%K", color=color.new(#16A56A, 0), linewidth=2)
plot(d, "%D", color=color.new(#E5484D, 0), linewidth=1)
hOb = hline(ob, "Overbought", color=color.new(#E5484D, 50), linestyle=hline.style_dashed)
hOs = hline(os, "Oversold", color=color.new(#16A56A, 50), linestyle=hline.style_dashed)
hline(50, "Mid", color=color.new(#A3A39E, 70), linestyle=hline.style_dotted)
fill(hOb, hOs, color=color.new(#A3A39E, 94), title="Neutral zone")
if longSig and useLong
strategy.entry("Long", strategy.long)
strategy.exit("Long stop", "Long", stop=stopMult > 0 ? close - stopMult * atr : na)
if shortSig and useShort
strategy.entry("Short", strategy.short)
strategy.exit("Short stop", "Short", stop=stopMult > 0 ? close + stopMult * atr : na)
if exitLong
strategy.close("Long")
if exitShort
strategy.close("Short")
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: RSI strategy, Bollinger Bands strategy, MACD strategy.
SPY, daily data, 2016 to 2026, long and short: 14, 3, 3, 80/20 lost 54.2% after costs over 142 trades (38.0% won, profit factor 0.71) against +277.8% for holding SPY, and the held-out third did not survive. Long only it made 28.0%. Across all 6 runs on the page, 2 made money after costs, 2 survived their held-out third and 0 beat holding the stock.
From 23.9% to 58.3% across the 6 runs. The classic setting, 14, 3, 3, 80/20 on SPY long and short, won 38.0% of 142 trades. The win rate alone does not decide the result: that run's profit factor was 0.71, so its losers outweighed its winners, and the net return was -54.2%.
Of the 2 settings tested, 14, 3, 3, 80/20 on SPY (long only) did best: +28.0% net, profit factor 1.49, held-out survived. That is the best of 6 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 6 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 56.9% with 65% 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: 2 of 6 runs survived, 0 decayed, 4 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.