The Night My Backtest Lied to Me
One night, a backtest told me I had turned a modest starting balance into 2,792 trillion won — more than the annual output of most economies on the planet. I stared at it. For a few minutes, some quiet, greedy part of me went looking for reasons it might be real.
It wasn’t real. It was a bug. And the bug turned out to be more instructive than any winning strategy could have been, because it was a bug about the one thing a backtest exists to respect: reality.
The number that should have scared me
I was running a parameter search — thousands of configurations, each one replayed across historical data and ranked by final result. Most came back ordinary. One came back insane.
Insane-in-your-favor is the single most dangerous output a system can produce, because it arrives wearing the face of success. A losing run makes you debug. A run that “works” makes you celebrate. The scrutiny is asymmetric, and it runs in exactly the wrong direction: we interrogate the results we dislike and wave through the ones we love. I almost waved this one through.
The instinct I had to learn — the hard way — is the reverse. The more spectacular the result, the more certain it is that something is broken. Markets do not hand a first-time builder the GDP of a small country. If your simulation says they do, the simulation is lying, and your only job is to find out how.
Mistake one: betting the whole account, every time
The first flaw was in position sizing. Each trade was sized as essentially the entire account, and the profits compounded straight back into the next bet. The moment you do that, you stop modeling trading and start modeling a geometric series. A long enough run of even slightly favorable outcomes — or pure noise that happens to break the right way often enough — doesn’t grow, it detonates. The math runs away from reality and never looks back.
This is the seductive thing about a fully-compounding backtest: it doesn’t need a good strategy to produce a great number. It only needs enough trades and a simulator generous enough to let the bet keep riding. Compounding turns a faint, meaningless statistical lean into an exponential curve, and an exponential curve over thousands of trades produces a number that looks like destiny and means nothing. The astronomical balance wasn’t evidence of an edge. It was evidence of full-account exposure applied to randomness.
Mistake two: a simulator that couldn’t die
The second flaw was worse, because it was philosophical. My backtester had no absorbing barrier — no point at which the account was simply dead. So when a stretch of bad trades drove the balance down by 99.99%, the simulation didn’t stop. It kept the corpse on the table and let it keep trading. And from that near-zero balance, a lucky streak “revived” the account and carried it back up to a preposterous height.
In a real account, that recovery is impossible. Zero is zero. A liquidated balance does not get a second act — you are out of the game, permanently, and no future winning streak can reach back through time to save you. By letting a bankrupt account keep trading, my code had quietly deleted the most important rule in all of trading: that ruin is final. Everything downstream of that — the entire fantasy — followed logically from one missing constraint. The simulation wasn’t modeling a strategy that survived. It was modeling a strategy that had been allowed to die, and then forbidden from staying dead.
The optimizer was hunting my blind spot
Here is the part that took me longest to understand: the parameter search did not stumble onto that absurd configuration by accident. It went looking for it.
A search over thousands of configurations is not a neutral observer. It is an adversary that optimizes for whatever metric you hand it. If your metric is “final balance” and your simulator has a soft spot — a place where unrealistic things are quietly allowed to happen — the search will find that soft spot and lean on it with all of its weight. It does not reward the best strategy. It rewards the configuration that most efficiently exploits the gap between your simulation and reality.
So the trillion-won result wasn’t one unlucky bug surfacing at random. It was the predictable consequence of pointing a powerful optimizer at a simulator that could be fooled. Every weakness you leave in a backtest becomes, under search, a strategy. The optimizer is a machine for discovering precisely the assumptions you forgot to enforce.
The tell
Put those mistakes together and you get a machine that manufactures miracles. It can survive anything, so it survives everything; it bets everything, so when it survives it survives enormously; and a search is quietly tuning it to do both as hard as possible. The output is not a strategy’s performance. It is the shape of the bug itself, drawn in very large numbers.
This is why “survival first” is not a slogan. A backtest that cannot go broke will, given enough configurations to search through, always eventually surface one that looks like genius — not because that configuration is good, but because the search is patiently mining your simulator’s blind spot. The impressive number is the symptom. The missing bankruptcy is the disease.
The boring fix
The repair was unglamorous. Position sizes became a small fixed fraction of the account instead of the whole thing, so a win couldn’t snowball into nonsense and a loss couldn’t be all-or-nothing. The simulator got a real ruin condition: fall below a minimum surviving balance and the run is over, marked dead, full stop. And it got a minimum order size, so trades too small to exist in the real market couldn’t quietly keep a dying account on life support.
None of these are clever ideas. There is no insight in them, no edge. They are the simulation finally agreeing to obey the constraints that reality never relaxes — costs that don’t forgive you, liquidity that isn’t infinite, and a zero you can’t come back from. Most of the work of building an honest backtest is exactly this: not making it smarter, but refusing to let it cheat. An honest backtest’s first responsibility isn’t to show you profit. It is to be capable of showing you ruin.
Why I stopped trusting good news
Here is the uncomfortable part. The bug was easy. The hard thing was that I almost didn’t look — because the number was in my favor, and I wanted it to be true. A result that contradicts you gets interrogated. A result that flatters you gets believed.
That asymmetry is where most self-deception in this work lives. It isn’t that people can’t find their bugs; it’s that they stop looking the moment a bug starts paying them. The market will eventually charge full price for every comfortable assumption you never checked — but a backtest will happily let you hold that assumption for months, because it is, by construction, the one place where being wrong is free.
What it actually changed
So the discipline I kept from a fake trillion won has almost nothing to do with position sizing. It changed the order of my trust. A good-looking result is now guilty until proven innocent: before I ask “how did it do this?”, I ask “what is broken here?” — and I try, deliberately, to break it myself before the market gets the chance. The results that survive that hostile treatment are the only ones I let myself believe, and there are far fewer of them than I would like.
A backtester that can’t lose everything isn’t optimistic. It’s lying. And the most dangerous lie it can tell is the one you were already hoping to hear.
— No signals, no returns, not investment advice.