BACKTEST RESULTS

Stochastic strategy backtest results

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.

SPY · daily data · 14, 3, 3, 80/20 · long and short
Net after costs
-54.2%
Holding SPY
+277.8%
Trades
142
Win rate
38.0%
Profit factor
0.71
Max drawdown
56.9%
Held out, last third: did not survive
Long only: +28.0% on 41 trades, held-out survived
4 January 2016 to 23 October 2026
  • Checked 25 October 2026
  • Alpaca daily data since 2016, and 5-minute data from the last 600 sessions
  • 0.05% commission + 0.025% slippage per fill
  • last third of the history held out
  • 6 runs, 2786 trades
  • Updated 1 November 2026

The short answer

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

One symbol's past after modelled costs is not a forecast. Prices are split-adjusted and not dividend-adjusted, so every return here is a price return; the period includes a long rise with two sharp falls, and a rule that is often long did well for that reason as much as any other. These are research results, not investment advice.

What the script does

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.

The numbers, run by run

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.

SymbolTimeframeSettingsDirectionTradesWin rateNetHoldingProfit factorMax drawdownHeld-out
SPYdaily14, 3, 3, 80/20long and short14238.0%-54.2%+277.8%0.7156.9%did not survive
SPYdaily5, 3, 3, 80/20long and short14033.6%-64.4%+277.8%0.5065.6%did not survive
QQQdaily14, 3, 3, 80/20long and short17138.6%-73.2%+542.3%0.6577.3%did not survive
SPYdaily14, 3, 3, 80/20long only4153.7%+28.0%+277.8%1.4919.5%survived
QQQdaily14, 3, 3, 80/20long only4858.3%+26.1%+542.3%1.3531.3%survived
SPY5-minute14, 3, 3, 80/20long and short224423.9%-96.7%+44.4%0.3096.7%did not survive

Year by year

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.

Year14, 3, 3, 80/20, long and short14, 3, 3, 80/20, long onlyHolding 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%

Every trade

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.

SideInOutEntryExitReturn
short2016-03-012016-03-04194.95200.20-2.8%
short2016-03-082016-05-10199.26206.77-3.9%
short2016-06-022016-06-21209.74208.35+0.6%
short2016-07-082016-07-12210.99214.71-1.9%
short2016-07-182016-08-30215.91218.32-1.2%
short2016-11-152016-11-25216.97221.17-2.0%
short2016-11-292016-12-07220.45224.01-1.7%
short2016-12-132017-01-04226.94225.69+0.5%
short2017-02-212017-03-01235.45239.24-1.7%
long2017-03-272017-04-05232.00236.19+1.7%
short2017-05-012017-06-02238.62244.33-2.5%
short2017-06-072017-06-27243.53243.11+0.1%
short2017-07-192017-08-16245.95247.18-0.6%
short2017-09-182017-10-02249.54252.09-1.1%
short2017-10-062017-11-07254.08259.19-2.1%
short2017-11-102017-11-28257.66260.87-1.3%
short2017-12-012018-01-03264.69270.32-2.2%
short2018-01-102018-01-12273.61277.54-1.5%
short2018-01-172018-01-19277.96280.48-1.0%
short2018-01-252018-02-08284.08268.05+5.5%
short2018-03-012018-03-13271.33280.22-3.4%
long2018-03-282018-04-20260.83268.73+2.9%
short2018-04-202018-05-07268.73266.98+0.6%
short2018-05-162018-07-02271.03269.59+0.4%
long2018-07-022018-07-13269.59279.11+3.4%
short2018-07-132018-08-27279.11289.87-4.0%
short2018-08-312018-10-16289.76276.65+4.4%
long2018-10-162018-10-24276.65267.97-3.2%
long2018-10-302018-11-13263.75272.98+3.4%
long2018-11-272018-12-06266.42265.84-0.3%
long2018-12-272019-01-16242.64260.75+7.4%
short2019-01-162019-02-05260.75272.71-4.7%
short2019-02-082019-02-19268.67277.65-3.4%
short2019-02-222019-04-03278.03287.40-3.5%
short2019-04-102019-05-01287.69294.80-2.6%
short2019-05-022019-05-13291.60282.50+3.0%
long2019-06-052019-06-13282.41289.32+2.3%
short2019-06-132019-06-20289.32296.12-2.5%
short2019-06-242019-08-07294.15284.49+3.2%
long2019-08-072019-08-26284.49287.19+0.8%
short2019-09-112019-10-07298.39293.55+1.5%
short2019-10-212019-11-27299.34315.23-5.4%
short2019-12-262020-01-14321.57328.06-2.1%
short2020-01-152020-01-17327.25331.84-1.5%
short2020-01-232020-01-31330.54327.09+0.9%
short2020-02-122020-03-02336.74298.28+11.3%
long2020-03-022020-03-09298.28275.21-7.8%
long2020-03-162020-03-16241.25241.11-0.2%
long2020-03-202020-04-06242.60257.77+6.2%
short2020-04-162020-04-29279.07294.35-5.6%
short2020-05-012020-06-05285.23318.39-11.7%
short2020-06-082020-06-17320.13314.15+1.8%
short2020-07-102020-08-06314.16333.47-6.2%
short2020-08-122020-08-26335.36344.84-2.9%
short2020-08-282020-09-02349.35355.29-1.8%
long2020-09-152020-09-21341.22325.61-4.7%
long2020-09-282020-10-14333.31350.64+5.1%
short2020-10-142020-11-03350.64333.78+4.7%
long2020-11-032020-11-11333.78356.30+6.6%
short2020-11-112020-12-21356.30375.88-5.6%
short2021-01-132021-02-03378.59382.55-1.1%
short2021-02-112021-03-03391.14385.90+1.2%
short2021-03-192021-04-05389.78403.57-3.6%
short2021-04-142021-05-17412.72415.50-0.8%
short2021-06-042021-06-23420.63423.31-0.7%
short2021-07-012021-07-07428.71434.49-1.4%
short2021-07-082021-08-30428.66453.02-5.8%
short2021-09-032021-09-16451.86447.44+0.9%
short2021-10-252021-11-03454.16462.63-2.0%
short2021-11-042021-12-06465.23456.26+1.8%
long2021-12-062021-12-15456.26463.29+1.4%
short2021-12-312022-01-25475.51433.18+8.8%
long2022-01-252022-02-14433.18439.80+1.4%
long2022-02-252022-03-24429.73445.81+3.6%
short2022-03-242022-03-29445.81461.44-3.6%
short2022-03-312022-04-18457.77436.93+4.5%
long2022-04-182022-04-25436.93423.18-3.2%
long2022-04-292022-05-02423.71410.72-3.2%
long2022-05-132022-06-03396.82412.25+3.8%
short2022-06-032022-06-17412.25365.58+11.2%
long2022-06-172022-07-13365.58375.00+2.5%
short2022-07-262022-07-29393.73410.86-4.5%
short2022-08-032022-08-12410.21426.89-4.2%
short2022-08-182022-08-26426.74419.50+1.6%
long2022-09-022022-09-16400.40383.09-4.4%
long2022-09-202022-09-22385.16373.55-3.1%
long2022-09-272022-10-13368.12349.13-5.3%
short2022-10-282022-11-11379.77396.92-4.6%
short2022-11-172022-12-01390.35409.35-5.0%
long2022-12-222023-01-18383.16398.92+4.0%
short2023-01-182023-02-01398.92412.81-3.6%
short2023-02-072023-02-27408.76399.97+2.1%
long2023-02-272023-03-10399.97386.35-3.5%
short2023-04-052023-05-09407.78411.24-0.9%
short2023-06-082023-06-13426.50435.57-2.2%
short2023-06-162023-06-29442.90436.07+1.4%
short2023-07-072023-07-13438.51448.02-2.3%
short2023-07-212023-08-09453.84449.15+0.9%
long2023-08-152023-08-17446.39439.37-1.7%
long2023-08-222023-09-06441.29448.28+1.5%
short2023-09-062023-09-26448.28429.21+4.2%
long2023-09-262023-09-27429.21423.28-1.5%
long2023-10-312023-11-10416.29435.86+4.6%
short2023-11-102023-11-14435.86446.45-2.5%
short2023-11-172023-12-13450.12464.88-3.4%
short2023-12-152023-12-26469.36476.57-1.6%
short2024-01-022024-01-09472.03472.00-0.1%
short2024-01-252024-02-02487.43491.16-0.9%
short2024-02-132024-02-23494.38509.39-3.1%
short2024-02-282024-03-08505.19516.12-2.3%
short2024-03-122024-03-20513.31520.70-1.5%
short2024-03-262024-04-23521.09501.93+3.6%
long2024-04-232024-05-13501.93522.41+4.0%
short2024-05-132024-06-06522.41535.53-2.6%
short2024-06-172024-07-09541.93556.50-2.8%
short2024-07-112024-07-30561.29546.41+2.6%
long2024-07-302024-08-02546.41532.44-2.7%
long2024-08-082024-08-22524.04562.41+7.2%
short2024-08-222024-09-11562.41548.85+2.3%
short2024-09-192024-10-14570.86581.65-2.0%
short2024-10-162024-11-06579.63589.36-1.8%
short2024-11-132024-12-24597.16596.21+0.1%
short2025-01-272025-03-03594.67596.34-0.4%
long2025-03-032025-03-04596.34579.17-3.0%
long2025-03-102025-03-10567.74557.31-1.9%
long2025-03-172025-03-31562.92549.67-2.5%
short2025-05-012025-05-13560.22584.55-4.4%
short2025-05-212025-06-30588.31618.48-5.2%
short2025-07-022025-08-13617.08645.08-4.6%
short2025-08-182025-09-11642.69655.47-2.1%
short2025-09-182025-10-27661.71682.91-3.3%
short2025-10-312025-11-24684.86662.87+3.1%
long2025-11-242025-12-09662.87682.98+2.9%
short2025-12-092025-12-22682.98684.11-0.3%
short2025-12-302026-02-19687.27684.04+0.4%
long2026-03-182026-03-20668.51652.04-2.6%
long2026-03-242026-03-27651.49635.38-2.6%
long2026-04-012026-04-20654.05708.60+8.2%
short2026-04-202026-05-06708.60728.36-2.9%
short2026-05-152026-06-12741.60740.970.0%
short2026-07-152026-07-31754.04744.88+1.1%
short2026-08-072026-08-28770.82771.96-0.2%

The script

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")

How it was tested

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.

Run the Stochastic strategy on your own symbol, free

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.

Every strategy tested

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.

Questions

Does the Stochastic strategy work?

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.

What is the win rate of the Stochastic strategy?

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

What are the best Stochastic settings?

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.

Does the Stochastic strategy beat holding the stock?

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.

Did the Stochastic strategy hold up out of sample?

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.

How was this tested?

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.