Skip to content

Backtesting & Strategy Development

Backtesting Basics

Backtesting is the process of applying a trading strategy's rules to historical market data to estimate how the strategy would have performed before committing real capital.

What Does a Backtest Actually Simulate?

A backtest walks through past bars or ticks, evaluates your rules at each step, records hypothetical entries and exits, and compiles performance statistics. It answers: if I had followed these rules exactly on this data, what would equity curve, drawdown, and trade list look like? It does not answer whether the edge persists tomorrow—that requires forward testing. Simulation quality depends on data accuracy, realistic fill assumptions, and whether rules use only information available at each bar. A backtest is a structured what-if, not a promise.

The output is only as honest as the assumptions baked into fills, costs, and signal timing.

What Data and Settings Do You Need to Start?

Historical prices at your strategy timeframe—one-minute for day strategies, daily for swings. Adjusted data for splits and dividends on longer holds. Volume for liquidity filters. Corporate actions calendar for earnings exclusions. Define backtest window: enough trades for statistics, often two to five years, plus reserved out-of-sample period. Include commission per share or round trip, slippage estimate, and borrow cost for shorts. Starting capital and position sizing rules must match planned live trading.

Shorter histories on new IPO-heavy universes skew results—require minimum listing age in your universe filter.

How Are Trades Generated in a Simple Backtest?

At each bar, the engine checks filters and entry conditions. On signal, it opens a position at modeled fill price—often next bar open or signal bar close. It tracks stop and target until hit or time exit. Overlapping trades may be allowed or capped per rules. Equity updates after each closed trade. Trade log lists dates, prices, P&L, and holding time. Review individual trades, not only summary metrics—one bad fill assumption can inflate results. Visualizing entries on charts catches look-ahead bugs quickly.

If equity curve looks too smooth, suspect look-ahead bias or unrealistic fill at exact highs and lows.

What Should Beginners Look for in First Results?

Trade count: fewer than thirty trades is anecdotal. Profit factor: gross profit divided by gross loss—above one point zero is minimum, above one point two more encouraging. Max drawdown versus average winner—can you psychologically and financially survive it? Win rate paired with average win and loss size—high win rate with tiny winners may still lose. Distribution of monthly returns—one lucky month should not carry the entire backtest. Compare to buy-and-hold benchmark on same period for context, not as sole verdict.

Export the trade list and spot-check ten random trades manually—automation errors hide in edge cases.

What Are the First Mistakes to Avoid?

Using future data in signals—close of bar for entry on same bar without lag. Ignoring costs. Testing on one symbol only. Optimizing until equity is perfect in-sample. Treating backtest profit as budget for lifestyle spending. Basics matter: honest data, explicit rules, realistic costs, enough trades, and skepticism. Backtesting basics are the foundation; advanced metrics and optimization build on this discipline.

Run the same backtest twice with identical settings—results should match exactly or your process is not reproducible.

See It In Action

Trade Ideas scans 8,000+ stocks in real time. Try the platform that puts this into practice.

Try Trade Ideas Free