This is an engineering post, not trading advice. It shows no returns, balances or strategy parameters, on purpose.
Why do backtests look better than live trading?
Because simulations make quiet assumptions that leak future information or skip costs, and because testing many variants finds patterns in noise.
I started a regime-aware trading system for Binance spot markets in May 2026 to learn Python data pipelines and always-on systems. My first backtests let a decision fill on the same candle it was made, computed indicators over the full history, ignored coins that had been delisted, and kept the best of many variants. They looked great and were wrong.
A good-looking backtest is a hypothesis, not a result.
How should a backtester process each bar?
In a fixed order: fill the previous bar's decisions at this bar's open, live through the bar (stops and grid orders trigger inside it), mark to the close, and only then ask the strategy for its next decision.
# fixed order inside every bar fill(decisions_from_previous_bar, at=bar.open) # sells before buys live_through(bar) # stops and grid rungs trigger intra-bar mark_to(bar.close) decisions = rule.decide(closed_bars_only) # same-bar fills = a leak
Fees and slippage are charged on every fill, and a separate stress study checks results when slippage gets worse. A frozen reference simulator is replayed bit for bit across 1,944 pair-windows by a regression test, so a refactor can't change results unnoticed.
How do you detect look-ahead bias?
Recompute every series on truncated history and check that no past value changes, and replay pattern detectors one bar at a time.
- A truncation audit fails if any past value changes when future data is removed.
- A replay harness proves detectors never saw a future bar.
- Delisted coins stay in the data to avoid survivorship bias.
- Each check's blind spots are written down next to it.
How do you know a strategy beats luck?
Compare it with random entries matched to the trades it actually took. Mine must beat 500 such copies at the 95th percentile, with a Bonferroni correction when several variants are tested, and also beat simply holding the same coins.
The first version of that comparison was matched on the wrong thing; a review caught it and I rebuilt it. That's the process working.
What is pre-registration in trading research?
Writing the hypothesis and pass thresholds into a committed file before reading any data, then screening on design years and confirming on later, unread years.
The 2026 data is a sealed holdout: it can be opened once in total, every read goes to an append-only register, and a test checks that only listed files can touch it. About 50 studies so far, most falsified and archived. Archived studies don't get quietly re-run until they pass.
How do you keep market data trustworthy?
Make it fail loudly: immutable named snapshots, explicit checks, and errors instead of empty results.
The archive covers about 730 USDT pairs, daily back to 2017 plus 4-hour bars. One bucket listing once silently returned 203 of 735 pairs, so truncated listings now raise errors. Filenames inside zips are checked, not just checksums. Timestamp units are detected from values and mixed files are refused. A missing coin raises an error, because an empty table reads as "no trades".
How should a trading bot's kill switches work?
Every control that refuses new risk must be unable to block a stop-loss. Buys fail closed; stops always fire.
The system has a circuit breaker (drawdown, price velocity, API errors), a dead man's switch, a daily-loss halt, a portfolio heat cap and an SSH kill switch. Every position has a stop that only tightens; larger ones also rest on the exchange. Pretend mode runs on API keys that cannot trade. Research traffic has its own rate budget. Unreadable numbers show "not known", never zero. About 960 commits, ~218k lines of Python and ~5,100 tests in four and a half months, with AI writing much of the code and me owning the rules and review.
Frequently asked questions
What is look-ahead bias in backtesting?
Look-ahead bias is when a backtest uses information that wasn't available at the moment of the decision, such as filling a trade at the same candle's price or computing an indicator with future data. It makes results look better than live trading.
What is survivorship bias in crypto backtests?
Survivorship bias happens when the test data only contains coins that still exist today. Delisted coins disappear, so strategies look safer than they were. The fix is to keep delisted assets in the data.
How many random trials should a strategy beat?
There's no universal number. I compare each result with 500 random-entry copies matched to the trades actually taken and require it to beat the 95th percentile, tightening the bar with a Bonferroni correction when several variants are tested.
Is this financial advice?
No. This post describes engineering and research methods only, and deliberately shows no returns or strategy parameters.