Esteban | ˈe-stə-vən - /collection/check-ai-trading-strategies/

Check the AI-written trading strategy before you run it

Oct. 13, 2026

Read time: 4 minutes and 55 seconds.

tags:

A strategy that looks brilliant on paper has earned nothing yet

Picture a software developer on a quiet Saturday, coffee going cold, typing a request into an AI assistant: write me a trading strategy for this stock, with a backtest. A minute later he has a tidy script, a confident explanation of the logic, and a chart that climbs from the bottom left to the top right with barely a dip. He reads it twice. It looks like the answer to a question he’s been asking for years. His cursor drifts toward the button that would connect it to his real brokerage account.

Ask an AI to write you a trading strategy and you’ll get something impressive. Clean code, a neat explanation, maybe a backtest chart that climbs steadily from the bottom left to the top right. The temptation is to connect it to a real account and let it run. I’d treat that chart the way I’d treat a stranger’s holiday photos: nice to look at, and no proof of anything.

The problem isn’t that AI writes bad strategies. The problem is that it writes convincing ones, and convincing is cheap.

In an older post about pulling my hair out with AI, I called these models fancy word predictors: they produce whatever is most likely given what they were fed. Ask that machine for a strategy that looks good, and it will give you exactly that. Looking good is what it’s built to do.

Why the chart lies

A backtest is a story about the past. When a strategy is built and tested on the same slice of history, it can quietly learn the quirks of that slice instead of anything that will repeat. The model doesn’t mean to cheat. It just has every incentive to produce something that looks good on the data it was shown, and looking good on known data is the easiest thing in the world.

The general idea is well established. Backtesting means testing a model on historical data, and its known weakness is that a strategy which worked in the past may simply fail in the future. The deeper reason has its own name, overfitting: a model that matches one dataset so closely, noise included, that it does poorly on anything new. An AI-written strategy with a beautiful curve is often a beautiful case of exactly that.

That’s why an independent test is the only check that matters.

Think of a student who has seen the exam questions in advance. Their score tells you they saw the questions. It tells you nothing about whether they understand the subject. To find out, you give them questions they’ve never seen. Strategies deserve the same treatment.

Split the history

So split your history. Build on one period, then test on a separate period the strategy never touched. If the results fall apart, you’ve learned something cheap. Then go further. Include realistic costs: fees, the gap between the price you see and the price you get, the delay before an order fills. Many strategies that look profitable on paper are only profitable in a world with no friction, and that world doesn’t exist.

If you write code, you don’t have to invent the splitting. scikit-learn’s TimeSeriesSplit is built for time-ordered data: each round trains on earlier data and tests on the period that comes after, so the model never trains on the future. It’s a small tool that enforces a big rule.

The gap between the price you see and the price you get is called slippage. It comes from thin markets, large orders and the simple fact that prices move while your order travels. A strategy that trades often and aims for small gains can be wiped out by slippage alone. Ask the AI to include it, then check that it actually did.

The usual suspects

Check for the classic mistakes too. Is the strategy using information it couldn’t have known at the time of the trade? Did it only test on assets that survived, ignoring the ones that went bust? Does it depend on one lucky stretch? AI-written code makes these mistakes as easily as people do, and it explains them with more confidence.

The second of those mistakes is survivorship bias, and it’s sneakier than it sounds. The Wikipedia article gives examples from finance, like fund studies that leave out funds which closed, and backtests that only use a stock index’s current members. If your test universe is “today’s winners,” of course the past looks profitable. You picked the winners after the race.

The first mistake, using information from the future, often hides in a single line of code: a value calculated from the whole day’s data and then used to trade at the open. When you read AI-written strategy code, find every place it decides to trade, and ask what it could actually have known at that moment. If you can’t answer, don’t run it.

Paper first, then pennies

After the historical tests, run it on paper in real time for a while. No real money, just live prices and honest records. Markets have a way of humbling strategies that looked perfect last time someone checked. A period of paper trading shows you how it behaves when the future is genuinely unknown.

Only after all of that should real money enter the picture, and even then, start with an amount you’d be fine losing entirely. Scale up slowly, if at all, based on live behaviour, not on the original backtest.

None of this is glamorous. It slows you down, and it often kills an idea you were excited about. That’s the point. Every idea you kill on paper is money you didn’t lose finding out the hard way.

The same discipline sits behind fact-checking the trading bot ads and building chart-reading apps that sell confidence, not edge. Whether the claim comes from a promoter, an app or your own AI assistant, the answer is the same: separate what was claimed from what was tested.

One thing to try this week

Take one AI-written strategy, yours or one you’ve seen shared. Split its data into an earlier part and a later part, run it only on the later part, and add a realistic fee and a little slippage to every trade. Write the before and after results side by side. If the curve survives, keep testing on paper. If it doesn’t, you just saved yourself the expensive version of the lesson.

Test it like you want it to fail.