ATMResearch
Join Overfit - free
Overfit cover card on dark navy, kicker 'AI strategy validation': the headline 'AI wrote 5 strategies. 1 survived.' over the line 'Out-of-sample on SPY: 4 of 5 made money — 1 of 5 passed the full screen.', with a corner badge reading 'SPY · 1993–2026'.
  1. Overfit/
  2. Research/
  3. Can AI Build a Profitable Trading Strategy? I Backtested 5 LLM-Generated Rules on SPY to Find Out

August 22, 2026

Can AI Build a Profitable Trading Strategy? I Backtested 5 LLM-Generated Rules on SPY to Find Out

Share

9 min read

Written by Ali Casey, founder of StatOasis and AlgoChef, creator of the Algo Trading Masterclass (ATM), with over 10 years of experience building systematic trading tools - building algorithmic strategies, testing ideas with data, and teaching traders how to build structured, portfolio-based trading workflows.

Published August 22, 2026 · Method

← Back to Research
Table of contents▾
  • TL;DR — the answer box
  • How I tested this
  • Finding 1: Does the optimizer's single best in-sample pick survive out-of-sample?
  • Finding 2: What happens to the top 25 "AI-selected" strategies when tested on new data?
  • Finding 3: Across all 2,068 eligible strategies, does any optimized variant beat buy-and-hold out-of-sample?
  • The benchmark nobody optimized: a 20-year-old public rule
  • Finding 4: Do the 5 AI-generated rules produce profitable results when tested on new data?
  • Finding 5: How do I know if an AI rule has a real edge — or just got lucky?
  • The verdict — and the honest limits
  • What does this mean for you?
  • Methodology
  • FAQs

The short version

I ran two experiments on SPY — a 2,304-variant optimizer sweep, standing in for what an AI does when it hunts for the best strategy, and 5 AI-generated rules implemented exactly as written. The optimizer's top 25 picks lost 85% of their risk-adjusted score the moment they touched data they had never seen, and only 1 of the 5 AI rules cleared the Monte Carlo bar. The number that settles it: 0 of 2,068 eligible strategies beat simply buying and holding SPY.

Methodology & risk note: Backtested event study on SPY daily OHLCV data, 1993-02-02 to 2026-06-12, totalling 8,398 bars. Layer A: 2,304 strategy variants (RSI, Stochastic, Williams %R sweep); 2,068 eligible (at least 30 IS trades). Layer B: 5 LLM-generated rule-sets implemented verbatim. In-sample: 1993-02-02 to 2016-06-03 (5,878 bars). Out-of-sample: 2016-06-06 to 2026-06-12 (2,520 bars). $35,000 starting capital. Flat-only sequential backtest (no compounding). Frictionless (no commissions or slippage). Next-open entry fills. All results are historical and for educational purposes only. Past performance does not guarantee future results. Not investment advice.

TL;DR — the answer box

  • I ran two experiments on SPY. First: a 2,304-variant optimizer sweep to simulate what AI does when it searches for "the best strategy." Second: 5 rules generated verbatim from an AI prompt, tested blind.
  • The optimizer found 25 top in-sample picks with a median risk-adjusted score (CAR/MaxDD) of 0.80. Out-of-sample, that score collapsed 85% to 0.12. All 25 stayed profitable — but 0 of 2,068 eligible strategies beat simply buying and holding SPY, which returned +$87,835 out-of-sample.
  • Of 5 AI-generated rules: 1 was a clear loser (lost money both periods, 0th Monte Carlo percentile), 1 was statistically indistinguishable from random (14th percentile), 2 were noisy, and 1 was a genuine survivor (+$35,346 out-of-sample, 99th percentile).
  • Even the survivor lost to buy-and-hold by more than $52,000.
  • The verdict: AI produces impressive backtests, not guaranteed edges. Out-of-sample testing and Monte Carlo validation separate a curve-fit from a real edge — this study shows exactly why that distinction matters.

How I tested this

If you have ever typed "build me a profitable trading strategy for SPY" into an AI and stared at the output wondering whether it actually works — this study is for you.

I ran two separate experiments, each designed to answer a different version of the same question.

Experiment A — the optimizer sweep:

I ran a systematic sweep across 2,304 SPY daily strategy variants. Think of this as what any AI strategy builder does under the hood: try a massive number of combinations, pick the best-looking one in the backtest window, and hand it to you as the answer. I used three momentum oscillators — RSI, Stochastic %K, and Williams %R — swept across multiple lookback lengths, entry conditions, trade directions (long and short), entry styles (mean-reversion and breakout), and time exits.

The data: SPY daily price history from 1993-02-02 to 2026-06-12, totalling 8,398 trading bars. I split this 70/30. In-sample (IS), used for building and selecting strategies: 1993-02-02 to 2016-06-03, covering 5,878 bars. Out-of-sample (OOS), the blind test window the strategies have never seen: 2016-06-06 to 2026-06-12, covering 2,520 bars. The OOS window was locked from the start and never touched during the sweep.

All results are frictionless — no commissions, no slippage, next-open fills, $35,000 starting capital, flat-only (no compounding). Of 2,304 total variants, 2,068 (89.8%) qualified with at least 30 in-sample trades. Anything below 30 trades is too thin to interpret; those 236 variants are excluded from the eligible population. The eligible pool splits across the three indicator families as 532 RSI variants (25.7%), 768 Stochastic (37.1%), and 768 Williams %R (37.1%) — so no single oscillator dominates the population, and the findings below are not an artifact of one indicator family.

Experiment B — 5 AI-generated rules, verbatim:

I gave an AI a single prompt and asked it to generate 5 fully mechanical daily trading strategies for SPY using a fixed indicator set. I then implemented each rule exactly as written — no tweaking, no parameter adjustment — and ran it through the same engine and the same IS/OOS split.

Here is the exact prompt I used:

"You are a systematic trading strategy developer. Build me 5 profitable daily trading strategies for SPY (the S&P 500 ETF). Each strategy must use ONLY these indicators: RSI(14), Stochastic %K(14, smooth=3), Williams %R(14), SMA(100), ATR(20), 1-day prior close-to-close return, or 5-day prior return. For each strategy provide: (1) the exact entry condition with the indicator name and the precise numeric threshold, (2) the entry style — mean-reversion or momentum/breakout, (3) the direction — long or short, (4) a time-based exit in trading days — choose from 5, 10, or 15 bars. Every strategy must be fully mechanical with zero discretion so it can be coded and backtested immediately."

The validation layer — Monte Carlo:

For the 5 AI rules, I also ran a Monte Carlo test. Monte Carlo percentile answers one specific question: if a strategy entered trades on random bars with the same frequency as this rule, what share of those random simulations would do worse? A 99th percentile means only 1 in 100 random-entry runs would beat it — that is a real signal in the data. A 14th percentile means you could have picked trade entries out of a hat and done at least as well 86% of the time. That is noise.

Finding 1: Does the optimizer's single best in-sample pick survive out-of-sample?

The optimizer's top pick, the one any AI strategy builder would hand you as its best result, was a Williams %R(2) long mean-reversion strategy with a 10-bar time exit. In-sample, the numbers looked exceptional.

MetricIn-SampleOut-of-Sample
Net Profit$98,354.68$23,365.85
CAR/MaxDD1.46100.0980
Win Rate73.58%70.62%
Trades405160

CAR/MaxDD stands for Compound Annual Return divided by Maximum Drawdown — it measures how much return you earned per dollar of worst-case loss. A score of 1.0 means you gained roughly one dollar of annualized return for every dollar of your worst drawdown. The in-sample score of 1.46 is genuinely strong. The out-of-sample score of 0.10 is a fraction of that.

The win rate held (73.6% IS, 70.6% OOS). The strategy stayed profitable. But the risk-adjusted quality dropped sharply from 1.46 to 0.10 — and the strategy made $23,365 over the OOS window while simply buying and holding SPY made $87,835 over the exact same period. The optimizer's top pick trailed buy-and-hold by more than $64,000.

The win rate barely moved — 73.58% in-sample, 70.62% out-of-sample — while the risk-adjusted score fell from 1.4610 to 0.0980. Win rate is the number that survives; it is not the number that matters.

Finding 2: What happens to the top 25 "AI-selected" strategies when tested on new data?

One bad pick might be a fluke. What if you take the top 25 — the cream of 2,068 eligible strategies, ranked by in-sample risk-adjusted score? This is the shortlist any AI strategy tool would generate.

MetricTop 25 — In-SampleTop 25 — Out-of-Sample
Median CAR/MaxDD0.80320.1242
Still profitable—25 of 25 (100%)
Beat buy-and-hold—0 of 25 (0%)

Median CAR/MaxDD dropped from 0.80 to 0.12 — an 85% collapse in the risk-adjusted score.

All 25 stayed profitable out-of-sample. They are not blown-up, money-losing strategies. But not one of them beat the baseline: buy-and-hold SPY returned $87,835 over the OOS window. The best of the best from a 2,304-variant sweep could not match a strategy with zero intelligence — just hold the index.

An in-sample backtest is like a job interview where the candidate designed the questions themselves. They score close to perfect every time. The out-of-sample test is the actual job. Acing the custom interview and excelling at the real work are two very different things.

The shortlist any AI tool would hand you: median CAR/MaxDD drops from 0.8032 to 0.1242, an 84.5% collapse. All 25 stayed profitable; none of them beat the index.

Finding 3: Across all 2,068 eligible strategies, does any optimized variant beat buy-and-hold out-of-sample?

Not one.

MetricWhole Eligible Population (OOS)
Eligible variants2,068
Profitable OOS (net > $0)1,034 (50.0%)
Beat buy-and-hold OOS0 (0.0%)
Median OOS net profit$0.00

Exactly half of the 2,068 strategies made money out-of-sample. The other half did not. The median out-of-sample net profit was $0.00. That distribution is centered on zero — a coin flip. And none of them, across the full eligible population, crossed the $87,835 buy-and-hold line.

The optimizer is extremely good at one thing: finding parameters that fit the past data it was shown. It is not finding real edges. It is finding shapes in historical noise that look like edges in the training window and do not persist in the test window.

This does not mean systematic trading is hopeless. The buy-and-hold result itself is a systematic strategy — probably the most robust one in the study. What it shows is that adding oscillator conditions to a basic long-index position is not automatically adding edge. The OOS window (2016–2026) was a strong bull market for SPY, so the structural long drift dominated. Strategies that were in the market some of the time benefited from that drift, but none captured it as efficiently as simply staying in.

A strong in-sample score predicts nothing: of 2,068 eligible variants, 1,034 made money out-of-sample and not one crossed the $87,835.34 buy-and-hold line.

The benchmark nobody optimized: a 20-year-old public rule

There is one more comparison in the data, and it might be the most deflating one for the optimizer. Alongside the sweep, I ran a fixed benchmark rule that required zero optimization: the classic RSI(2) long mean-reversion strategy — published by Larry Connors in the mid-2000s, freely available in every trading book since. No parameter search. No AI. One rule, decades old.

StrategyHow it was foundOOS Net ProfitOOS CAR/MaxDDOOS Win%OOS Trades
RSI(2) long mean-reversionPublished ~20 years ago, no optimization$22,568.940.076760.34%116
Optimizer's #1 pick (of 2,304)2,304-variant sweep, best IS score$23,365.850.098070.62%160
Best AI rule (Rule 4)1 survivor of 5 LLM-generated rules$35,346.170.153873.1%—
Buy-and-hold SPYNo strategy at all$87,835.34——1

Read that first pair of rows twice. The single best pick from a 2,304-variant optimization — the output of the entire search apparatus — made $23,366 out-of-sample. The textbook rule anyone could have copied out of a 2004 book made $22,569 over the same window. The whole optimization enterprise bought roughly $800 of extra out-of-sample profit over the free, public, unoptimized alternative.

That is the cleanest summary of what optimization actually purchased in this study: almost nothing that wasn't already public knowledge. The AI's one validated rule did meaningfully better than both — and still trailed doing nothing by $52,000.

Finding 4: Do the 5 AI-generated rules produce profitable results when tested on new data?

Experiment B was more direct. I implemented each of the five AI-generated rules exactly as specified and ran them through the same engine and the same OOS window.

RuleEntry Condition (Summary)IS Net ProfitOOS Net ProfitOOS Win%MC Percentile
Rule 1: RSI Oversold BounceRSI(14) < 30, long, 5-bar hold$8,876$5,31170.6%85.5
Rule 2: Stochastic Oversold + UptrendStoch%K(14) < 20 AND SMA100 rising, long, 10-bar hold$6,068$58656.1%14.1
Rule 3: Williams %R Deep OversoldWR(14) < -85 AND prior-day return < -1%, long, 5-bar hold-$15,993-$12,86142.6%0.0
Rule 4: Multi-Indicator MomentumRSI > 55 AND Stoch > 50 AND WR > -50 AND 5-day return > 1%, long, 10-bar hold$50,043$35,34673.1%99.1
Rule 5: Double Overbought Short FadeRSI > 70 AND WR > -10 AND SMA100 falling, short, 5-bar hold-$1,543$1,80750.0%91.8

Four of five were profitable out-of-sample. That sounds solid. Look at what those profits actually mean.

Rule 3 was the clearest failure. It lost money in-sample (-$15,993) and continued losing out-of-sample (-$12,861). Its 42.6% win rate OOS means it was wrong more than half the time. Monte Carlo percentile: 0.0 — the very worst category, where every single randomized simulation outperformed it. The AI's rationale ("Williams %R below -85 combined with a prior-day down move identifies capitulation where a snap-back is probable") was a coherent story. The data said no.

Rule 2 made $586 out-of-sample. That is not a typo. The Monte Carlo percentile was 14.1, meaning 86% of random-entry strategies would have matched or beaten it. This is not a rule. This is luck indistinguishable from noise.

Rule 1 came through OOS with $5,311 and a respectable 70.6% win rate. Its 85.5th Monte Carlo percentile is suggestive — better than most random strategies — but it does not cross the 95th percentile threshold that marks "likely a real edge."

Rule 5 flipped from a small IS loss (-$1,543) to a small OOS profit ($1,807). Its 91.8th Monte Carlo percentile is interesting, but this is a short-side rule on SPY in the middle of a bull market decade. Small OOS profit, structurally unfavorable regime. Thin confidence.

Rule 4 was the only rule that cleared the bar.

Five rules from one prompt, presented with equal confidence, land anywhere from -$12,860.71 to $35,346.17 out-of-sample — and even the best of them falls short of the $87,835.34 you get for doing nothing.

Finding 5: How do I know if an AI rule has a real edge — or just got lucky?

The Monte Carlo percentile is the answer. Of 5 AI-generated rules, only one crossed the 95th percentile threshold.

RuleMonte Carlo PercentileVerdict
Rule 1: RSI Oversold Bounce85.5Suggestive; below the 95th threshold
Rule 2: Stochastic Oversold + Uptrend14.1Noise — random beats it 86% of the time
Rule 3: Williams %R Deep Oversold0.0Clear loser — worst possible result
Rule 4: Multi-Indicator Momentum99.1Real edge — 1 in 100 random runs beats it
Rule 5: Double Overbought Short Fade91.8Possible signal; short-side SPY in a bull — limited confidence

Rule 4 — RSI(14) > 55 AND Stochastic %K(14) > 50 AND Williams %R(14) > -50 AND 5-day prior return > 1% — is the survivor. It is the AI's most complex rule, requiring all three oscillators to confirm momentum plus a recent price move. Out-of-sample net profit: $35,346.17. Monte Carlo percentile: 99.1. This result is not a curve-fit artifact — 99% of random-entry strategies using the same trade frequency performed worse. That is a real edge in the data.

Even Rule 4, the one validated edge out of five AI-generated rules, did not beat buying and holding SPY. Buy-and-hold returned $87,835 in the OOS window. Rule 4 returned $35,346. The gap is more than $52,000.

The OOS window (2016–2026) was one of the strongest SPY bull markets in the last three decades. Any strategy that enters conditionally will spend some fraction of time on the sidelines, and in a straight-line bull market, time on the sidelines costs you. This is a regime caveat: in a sideways or bear market, the picture could reverse. The structural finding — that in-sample performance collapses 85% out-of-sample, and that validation requires both an OOS split and a Monte Carlo check — holds regardless of regime.

You could not tell Rule 4 from the other four by looking at in-sample numbers alone. Rule 4 had the highest in-sample profit, which might make it the first choice — but the AI presented all five rules with equal confidence. Only the out-of-sample result and the Monte Carlo percentile revealed which one was real.

Only Rule 4 clears the 95th-percentile bar, at 99.1; Rule 2 sits at 14.1 and Rule 3 at 0.0, where every random-entry simulation did better than the rule.

The verdict — and the honest limits

AI generates impressive backtests. It does not generate guaranteed edges.

This is not a condemnation of AI. Rule 4 is a real, validated edge — the AI did find something that works out-of-sample. But that is 1 out of 5 rules, and only after running an OOS blind test and a Monte Carlo screen. The other four rules ranged from clear losers to statistical noise to "probably something but not proven." And none of the five beat buy-and-hold.

The optimization result is starker: across 2,068 eligible strategies, the in-sample ranking told you almost nothing about who would win out-of-sample. The top 25 all stayed profitable, but their risk-adjusted edge collapsed 85% and not one beat the benchmark. Half of the full 2,068 made money OOS — a coin flip.

The trap is that in-sample backtests always look good. That is what they are designed to do. An AI tool that searches through thousands of parameter combinations and surfaces the best-looking one is not finding your future edge. It is finding the best-fitting shape in past data. Your job — the actual work — is validating whether that shape is real.

Honest limits of this study:

The OOS window (2016-06-06 to 2026-06-12) was a historic bull market for SPY. Buy-and-hold being unbeatable is partly a regime result. The 85% edge-collapse finding is the regime-robust result — it captures the gap between in-sample fit and out-of-sample reality regardless of whether the market is bullish, bearish, or sideways.

This study used a single IS/OOS split, not walk-forward or multiple-window validation. A single split can be unlucky at the boundary. Results are fully frictionless — no commissions, no slippage, next-open fills. Real trading costs reduce all OOS profits shown. The study covers SPY daily data only; results may not generalize to other instruments, time frames, or asset classes. Testing on a second index such as QQQ is the logical next step before treating these results as universal. Monte Carlo tests used a fixed-frequency random-entry benchmark, which is a valid but not exhaustive robustness check.

What does this mean for you?

  1. Never trust an AI strategy on in-sample data alone. The in-sample result is the application. The out-of-sample result is the job. Always lock away a test window — at least 30% of your data, untouched — before you optimize or evaluate anything.
  2. OOS profitability is not enough — run the Monte Carlo. Rule 2 in this study made $586 out-of-sample and was technically profitable. Its 14th Monte Carlo percentile means it was noise. Without that check, you would not know.
  3. Beat the benchmark, not just breakeven. The minimum bar for an active strategy is beating buy-and-hold in the OOS window. If the index made $87,835 and your strategy made $5,311, you are taking on real risk and effort for no reward. Set the hurdle before you start.
  4. Treat AI-generated rules as hypotheses, not answers. They are useful starting points — well-defined, fully mechanical, immediately testable. But the validation stack (IS/OOS split, Monte Carlo, benchmark comparison) is the work that actually tells you whether the hypothesis is true.
  5. Simple rules with large samples beat complex rules with thin samples. Rule 3 — Williams %R below -85 AND prior-day return below -1% — fired so rarely that the OOS sample was too small to measure reliably. Complex multi-condition rules are the textbook overfitting risk. Demand large trade counts before trusting any result.

Methodology

Data source
SPY daily price history from the StatOasis research dataset.
Date range
1993-02-02 to 2026-06-12 (8,398 trading bars), split 70/30 — in-sample 1993-02-02 to 2016-06-03 (5,878 bars), out-of-sample 2016-06-06 to 2026-06-12 (2,520 bars). The out-of-sample window was locked from the start and never touched during the sweep.
Entry / exit rules
Experiment A sweeps 2,304 SPY daily variants across three momentum oscillators (RSI, Stochastic %K, Williams %R) over multiple lookback lengths, entry conditions, directions (long/short), entry styles (mean-reversion/breakout) and time exits — the same brute-force search an AI strategy builder runs under the hood. Experiment B implements 5 AI-generated mechanical rules exactly as written, with no tweaking or parameter adjustment, through the same engine and the same in-sample/out-of-sample split. Next-open fills throughout — no look-ahead.
Sizing
$35,000 starting capital, flat-only, no compounding. Frictionless: no commissions or slippage.
Overlap mode
Flat-only — one position at a time, so overlapping signals are skipped. Of 2,304 variants, 2,068 (89.8%) qualified with at least 30 in-sample trades; the 236 below that floor are excluded from the eligible population as too thin to interpret.
Look-ahead
Next-open fills throughout: every oscillator reading is taken on the close of bar t and filled at the open of bar t+1. The out-of-sample window was locked from the start and never touched during the sweep, and the random control draws its entries from that window only.
Minimum sample
30 in-sample trades, not the engine default of 50 — the split leaves each half smaller, so the floor was lowered deliberately. 2,068 of the 2,304 variants qualify; the 236 below it are excluded as too thin to interpret.
Buy-and-hold benchmark
Buy and hold SPY across the out-of-sample window only (2016-06-06 to 2026-06-12): $87,835.34 net on the $35,000 basis. That is the hurdle every surviving variant is measured against, and the article's headline is how few clear it.
Random control
Seeded random control on the same out-of-sample window: entries placed at random, frequency-matched to the median out-of-sample trade count of the eligible variants, same 5-bar hold, averaged over 10 seeds from a fixed base seed. $8,201.11 net, CAR/MaxDD 0.0494, 93.2 trades. It is the baseline this study most needs: a search across 2,304 variants produces a best-looking one whether or not an edge exists, so beating buy-and-hold or beating RSI(2) cannot on its own show the search found anything.
Parameter scopeParameters swept

The study searched the parameter space and reports the spread, not one tuned setting.

Experiment A sweeps all 2,304 variants across three oscillator families, lengths, thresholds, directions, entry styles and time exits — deliberately the same brute-force search an AI strategy builder runs underneath. Experiment B then implements 5 AI-generated rules exactly as written, with no tuning at all.

Run to v1 of the StatOasis research standard - the rules every study here has to meet before it is published. The version is the study's own: a standard that gained a rule later never reaches back and claims this one met it.

Historical backtest results are not a guarantee of future returns. This content is for educational purposes only and is not investment advice. Hypothetical performance disclosure (CFTC Rule 4.41).

Frequently asked questions

Can ChatGPT build a profitable trading strategy?⌄

Sometimes — but not reliably, and you cannot tell from the output alone. In this study, 4 of the 5 AI-generated SPY strategies were profitable out-of-sample. One (Rule 4, Multi-Indicator Momentum) had a genuine statistically validated edge: 99th Monte Carlo percentile, +$35,346 OOS. But 1 of the 5 was a clear loser both periods, 1 was statistically indistinguishable from random entry (14th percentile), and 0 of the 5 beat simply buying and holding SPY (+$87,835 OOS). The AI generates a strategy definition; validation tells you whether it works.

How do you test if an AI-generated trading strategy actually works?⌄

Three steps, in order. First, split your data before you start: use 70% for building (in-sample) and hold 30% back as a blind test (out-of-sample) — never touch the OOS window until the strategy is fully specified and locked. Second, run the strategy on the OOS data and measure net profit, win rate, and CAR/MaxDD (risk-adjusted return). Third, run a Monte Carlo test: simulate thousands of random-entry strategies at the same trade frequency and check what percentile your rule lands in. The 95th percentile is the minimum bar for "likely a real edge." Anything below the 50th percentile is noise.

What happens to AI trading strategies when tested out of sample?⌄

The risk-adjusted quality typically collapses. In this study, the top 25 in-sample strategies had a median CAR/MaxDD of 0.80. The same strategies out-of-sample had a median CAR/MaxDD of 0.12 — an 85% degradation. They stayed profitable (25 of 25 made money OOS), but 0 of 25 beat the buy-and-hold baseline (+$87,835). Across the full 2,068 eligible variants, exactly 50% were profitable OOS and the median net profit was $0 — a coin flip.

Do AI trading bots actually make money in live trading?⌄

This study covers backtests only — frictionless, historical SPY data, no live execution. What it shows is that even under ideal backtest conditions with no commissions or slippage, the median optimized strategy made $0 net profit out-of-sample and none of 2,068 strategies beat buy-and-hold. Real trading adds friction (commissions, slippage, fill latency) and behavioral pressure (drawdown anxiety, execution hesitation) that backtests do not capture. Any live-trading claim from an AI strategy tool should be viewed through those caveats.

How do you avoid overfitting an AI-generated strategy?⌄

Three practices: (1) Lock your test window before you build anything — overfitting cannot happen on data the strategy has never seen. (2) Prefer simple rules with large trade samples over complex multi-condition rules with thin samples; Rule 3 in this study fired so rarely in the OOS window that the result cannot be trusted regardless of sign. (3) Run the Monte Carlo screen — an overfit strategy will typically score below the 50th percentile because its specific in-sample fit does not generalize when the entry timing is randomized.

What is the difference between in-sample and out-of-sample backtesting?⌄

In-sample is the historical data you use to build and optimize a strategy. Out-of-sample is data the strategy has never seen — a blind test of whether the rules that worked historically hold on genuinely new data. A strategy can score beautifully in-sample simply by fitting to noise in past prices. The OOS test is the only reliable check on whether the pattern is real. In this study, in-sample ran from 1993-02-02 to 2016-06-03 (5,878 bars); out-of-sample ran from 2016-06-06 to 2026-06-12 (2,520 bars).

Can AI find trading edges that human traders miss?⌄

Possibly — it generates hypotheses worth testing. Rule 4 (Multi-Indicator Momentum Confluence: RSI > 55, Stochastic > 50, Williams %R > -50, 5-day return > 1%) was the AI's most complex rule and the only one with a validated edge in this study — 99th Monte Carlo percentile, +$35,346 OOS. A human designer might not have combined all three oscillators plus a momentum filter in exactly that way. But without the validation stack — OOS test, Monte Carlo, benchmark comparison — there was no way to distinguish it from the four rules that did not hold up. The AI identifies candidates. The validation confirms them.

Which AI tool is best for building trading strategies in 2026?⌄

This study does not benchmark AI tools against each other. What it shows is that the quality of the validation process matters far more than which AI generates the initial rule. All five rules in this study came from the same prompt to the same AI; the difference between the one survivor and the four that failed was revealed entirely by the backtest engine and the validation methodology — not by anything in the AI output. The tool that runs a rigorous IS/OOS split and Monte Carlo test is more valuable than the one that generates the most confident-sounding strategy.

Why do strategies that look great in a backtest fail in live trading?⌄

Two main reasons. First, curve-fitting: a strategy built by searching across many parameter combinations will tend to fit the specific noise patterns in its training data, and those patterns do not repeat. In this study, the top-25 IS strategies lost 85% of their risk-adjusted score out-of-sample due to curve-fitting alone — before touching any live market. Second, real trading adds friction and behavioral pressure that backtests do not: commissions reduce edge, slippage affects fills, and drawdowns test discipline in ways a spreadsheet never does.

How many trades does a backtest need before you can trust it?⌄

Use 30 as a hard minimum — in-sample and out-of-sample. In this study, any variant with fewer than 30 in-sample trades was excluded from the eligible population (236 of 2,304 were filtered out this way). Thin-sample results are flagged, not buried. For a daily strategy on a single instrument, 100+ trades in the OOS window is the standard worth aiming for. More trades give the statistical test more resolution; a strategy with 15 OOS trades can look like a winner on luck alone.

Is a high win rate proof that a strategy works?⌄

No — win rate was the most stable and least informative number in this study. The optimizer's top pick won 73.6% of trades in-sample and still won 70.6% out-of-sample, yet its risk-adjusted score collapsed from 1.46 to 0.10 and it trailed buy-and-hold by more than $64,000. A mean-reversion rule on an index that drifts upward will win most of its trades almost by construction; the profits per win, the drawdowns, and the benchmark comparison are where strategies actually fail. Judge a rule by CAR/MaxDD, net profit against buy-and-hold, and the Monte Carlo percentile — not by its win rate.

Did the AI or the optimizer beat a simple published rule like RSI(2)?⌄

Barely, or not at all. The classic RSI(2) long mean-reversion rule — public since the mid-2000s, zero optimization — made $22,569 out-of-sample. The optimizer's #1 pick from 2,304 variants made $23,366 over the same window, roughly $800 more. Only the one validated AI rule (Rule 4, +$35,346 OOS, 99th Monte Carlo percentile) meaningfully outperformed the public benchmark — and it still trailed buy-and-hold by $52,000. If a 2,304-variant search buys you $800 over a free textbook rule, the search was not where the value was.

↓Download the dataset (374 KB)

Read the Tools, Software & Tech Stack hub
← Back to Research

Table of contents

  • TL;DR — the answer box
  • How I tested this
  • Finding 1: Does the optimizer's single best in-sample pick survive out-of-sample?
  • Finding 2: What happens to the top 25 "AI-selected" strategies when tested on new data?
  • Finding 3: Across all 2,068 eligible strategies, does any optimized variant beat buy-and-hold out-of-sample?
  • The benchmark nobody optimized: a 20-year-old public rule
  • Finding 4: Do the 5 AI-generated rules produce profitable results when tested on new data?
  • Finding 5: How do I know if an AI rule has a real edge — or just got lucky?
  • The verdict — and the honest limits
  • What does this mean for you?
  • Methodology
  • FAQs

Overfit - the newsletter

Skip the hype. Trust the data.One practical takeaway per issue.

Running a quick security check before this can be sent.

Delivered +2 times a month - when the work is ready, not on a calendar.I'll never sell your address.Unsubscribe in one click, any time.

Related Articles

Back to all research
#122

Robustness Testing: Why Most Traders Fail, and What 36,252 Backtests Say Actually Works

Mar 28, 2025 · 16 min read

Robustness testing is the step between a good backtest and a strategy worth funding. I measured which checks actually predict what happens next, then retested the whole thing on 53 markets — where the stack still works, several individual checks turn out to have been overstated threefold, and two of them stop working entirely.

Read more→
#131

StrategyQuant X Review: The No-Code Way to Build Trading Strategies

May 30, 2025 · 13 min read

I have run StrategyQuant X on an Ultimate licence since 2019, I am a paid affiliate, and my course is built around it — all stated up front. Here is the verified 2026 pricing ($1,290 Starter, $1,490 Professional, $2,900 Ultimate), the edition gate that decides the purchase, what Build 144 changed, and who should not buy it.

Read more→

Overfit - the newsletter

Skip the hype. Trust the data.

One practical, evidence-driven takeaway per issue - strategy testing, portfolio construction, market structure, trading psychology, tactical asset allocation.

Running a quick security check before this can be sent.

Delivered +2 times a month - when the work is ready, not on a calendar.I'll never sell your address.Unsubscribe in one click, any time.

StatOasis is calm, evidence-based algorithmic-trading education, founded by Ali Casey. Ali builds systematic trading strategies and teaches the workflow behind them: research, build, test, combine, deploy. He writes the Overfit newsletter, published since 2024, and runs the Algo Trading Masterclass.

Socials

  • X ↗
  • YouTube ↗
  • Instagram ↗
  • LinkedIn ↗
  • GitHub ↗
  • Muck Rack ↗
  • LinkedIn SO ↗
  • GitHub SO ↗

Products

  • Overfit - the newsletter
  • Algo Trading Masterclass ↗
  • StatOasis Community
  • Digital Products
  • 36 Ways to Buy the Dip
  • AlgoChef ↗

Reading & tools

  • Research
  • Methodology
  • Survive the Decade
  • Wall of Love

StatOasis

  • About Ali Casey
  • Contact
© 2026 StatOasis. Calm, evidence-based.
PrivacyTermsHypothetical resultsCalifornia