Everything on this page is published for educational and informational purposes only. Nothing here is investment, financial, legal, tax, or trading advice, a recommendation to buy or sell any security or contract, or a solicitation of any kind. Trading futures, options, equities, and crypto involves substantial risk of loss and is not suitable for every investor. Past performance — including any backtests, demos, or examples shown — does not guarantee future results. Consult a licensed professional before acting on anything you read here.
Every backtest lies. Honest ones admit how.
Most retail traders blow up because their backtest was a curve-fit. This module shows the seven biases, the engines that catch them, the validation that approximates live, the cost model that decides whether you have edge, and the eight metrics that tell you the truth. No paywall, no upsell.
The lies your backtest tells you. Every one of them is fixable.
Each card has the bias name, what the inflated equity curve looks like, a real-world example, how to detect it, and the canonical fix. Click any row to expand.
Indicator computed on the close of bar T is used to enter on the open of bar T. In live trading you cannot place an order before the close that produced the signal.
Shift every input by one bar and re-run. If returns collapse, you had look-ahead. Backtrader/vectorbt make this trivial with `.shift(1)`.
Compute signal on bar T, execute on bar T+1 open. Never let the same bar produce the signal AND the fill price.
// seven biases. every backtest has at least one. honest research finds all of them.
Five engines. Pick the one that matches your research style.
Filter by language or paradigm. Sort by lines-of-code or name. Honest notes on speed, accuracy, live-trading bridge, and cost. No affiliate links.
| Language | Paradigm | Speed | Accuracy | Live bridge | Why pick it | Cost | ||
|---|---|---|---|---|---|---|---|---|
| Backtrader | Python | Event-driven | ~50k bars/sec single-thread; slow for portfolio sweeps. | Bar-by-bar event loop; honest about partial fills, commission, and order routing. | Built-in: IBKR, Oanda, VC, ccxt. Maintenance has slowed since 2022. | 40 | Strategy classes feel right; ecosystem of community indicators. | Free / MIT. |
| Custom event-driven (asyncio) | Python | Event-driven | You control the budget. 10k–500k bars/sec depending on your hot path. | Whatever you model. Most people under-model partial fills and overestimate cash availability. | You build it. Same code runs in backtest and live. | 200 | Total control of order semantics, position bookkeeping, and live↔backtest code parity. | Free / engineering time. |
| LEAN (QuantConnect) | C# / Python | Event-driven | ~70k bars/sec local; cloud runs scale to thousands of nodes. | Production-grade order modeling: slippage, partial fills, margin, fees per broker model. | First-class: IBKR, Tradier, Alpaca, Coinbase, Binance, Bybit, Bitfinex, Kraken, OANDA, Zerodha. | 45 | One codebase from backtest → paper → live across many brokers and asset classes. | Free locally / Cloud tiers $0–$80/mo for research, more for live deployment + data. |
| vectorbt | Python | Vectorized | 100×–1000× Backtrader for parameter sweeps; uses Numba/JIT. | No event loop — slippage and partial fills must be modeled explicitly. Fewer guardrails. | None native. You wire your own broker layer. | 12 | Multi-dimensional parameter optimization in seconds; first-class hyperparameter heatmaps. | Free (open-source) + paid `vectorbtpro`. |
| Zipline-reloaded | Python | Event-driven | ~30k bars/sec; reasonable for daily-bar US equity research. | Originally Quantopian's engine; minute-level data possible but painful to set up. | Limited; community-built IB/Alpaca extensions exist but are unmaintained. | 50 | Pipeline API for cross-sectional equity research is best-in-class. | Free / Apache-2.0. |
// LOC = lines of code for a minimal SMA-crossover strategy in that engine. Lower ≠ better.
Six windows. Six honest evaluations.
Train on 24 months, lock parameters, trade 6, slide forward. Repeat. The stitched out-of-sample equity curve is your honest backtest. Step through each window below.
Window 1 — train on months 1-24, lock parameters, trade months 25-30. This out-of-sample slice is your honest test. If it diverges from the in-sample equity curve, your strategy overfit.
A single in-sample backtest with no walk-forward is not validation — it is curve-fitting. If you cannot show six out-of-sample windows, you cannot estimate live performance.
Where the edge dies. Move the sliders and watch.
Pick a strategy frequency, dial in realistic commission and slippage. If net Sharpe collapses below 0.5, the strategy never had edge — costs just exposed it.
Net Sharpe survives the cost model. Now stress-test it across regimes and confirm out-of-sample windows behave the same way.
// model is illustrative — real cost depends on order size, ADV, time of day, urgency, and venue. Never trust a backtest that assumed 0 bps.
Eight metrics. Each one hides something the next one shows.
Sharpe alone is not enough. Sortino, Calmar, max drawdown, Ulcer, win rate, profit factor, exposure. Each card includes the formula, a good value range, what it hides, and what to pair it with.
Above 1.0 net of costs; above 2.0 is excellent; above 3.0 is suspicious.
Penalizes upside volatility the same as downside; says nothing about left-tail risk; can be high while drawdown is unsurvivable.
Sortino (downside-only) and maximum drawdown.
Take the whole module offline. 36 pages. Free. No login.
The full Backtesting module — every bias, every engine note, every walk-forward window, every cost case, every metric — in one printable PDF. Same content as the web, formatted for offline study and reference.
This is one of six modules in the Nexural Automation curriculum. The library page maps every module, shows the dependency graph, and links the master 14-page Curriculum Index PDF.
browse the full PDF library →