Backtesting & Automation
How to Backtest a Trading Strategy Properly

How to Backtest a Trading Strategy Properly

Strategy Development and Validation

How to Backtest a Trading Strategy Properly: From Visual Testing to Python

Backtesting is not about producing the most impressive equity curve. It is about collecting evidence that a simple set of rules has a repeatable edge and can survive different markets, regimes and execution conditions.

By Stephen Hoad · Professional trader and systematic strategy developer · Updated July 2026
The four-level roadmap
0Visual or eyeball testing
1Statistical assumption and forward log
2Platform-based strategy testing
3+No-code automation and Python
The immediate answer

A proper backtest looks for evidence of edge, not certainty. Start visually, define objective rules, test with realistic assumptions, validate on unseen data, stress the result and only then move to micro-sized live trading.

The Goal of Backtesting Is Evidence of Edge

Backtesting does not predict the future. It shows how a defined set of rules behaved on historical data under a stated set of assumptions.

Therefore, the professional question is not, “How much money did the test make?” It is, “What behaviour did the rules produce, and is that behaviour repeatable?”

You are testing behaviour, not indicators

Indicators are mathematical transformations. The real subject of the test is price behaviour, volatility, regime, execution and risk.

Level 0: Visual or Eyeball Testing

0

Use charts to reject weak ideas quickly

Scroll back, mark entries and exits, inspect structure and estimate whether the idea has enough logic to justify further work.

At this stage, look for clean behaviour, repeatable turning points, sensible stop placement and realistic reward-to-risk.

Visual testing is biased

It is useful as a filter, not as proof. Human memory selects attractive examples and often ignores missed trades, slippage and ambiguous signals.

Level 1: Statistical Assumption and Forward Testing

1

Turn the idea into rules and a trade log

When the historical win rate is unknown, begin with conservative assumptions and record every valid signal over a meaningful period.

The lecture proposes a simple baseline of a 51% win rate at 1:1 reward-to-risk, followed by a three-month micro-sized forward test.

What should be tracked?

Performance

Win rate and expectancy

Measure average outcome, not just total profit.

Risk

Drawdown and losing clusters

Understand how the strategy behaves when results turn against it.

Context

Regime and behaviour

Record trend, volatility, session and market conditions.

VaR and statistical stress testing

A rolling risk model can compare realised P&L against expected statistical bands. However, normal-distribution assumptions should never be treated as complete protection because markets can produce fat tails and sudden regime shifts.

Level 2: Off-the-Shelf Backtesting Platforms

2

Use a platform to increase speed and consistency

Tools such as NinjaTrader and TradingView can test many rules quickly and produce structured performance reports.

At this level, the trader can compare markets, time periods and parameter ranges. More importantly, they can inspect drawdown, trade clusters and sensitivity to small rule changes.

ToolBest useMain limitation
TradingViewFast strategy prototyping and visual inspectionExecution assumptions and data limits must be understood
NinjaTrader Strategy AnalyzerFutures strategy testing, optimisation and reportingHistorical fills may differ from live execution
ExcelR-multiple models, Monte Carlo and risk simulationManual data handling and limited market logic
PythonCustom data, portfolios and advanced validationRequires coding discipline and careful debugging

Level 3: No-Code and Low-Code Automation

3

Convert simple rules into repeatable tests

Strategy builders, templates and spreadsheets can remove emotional judgement without requiring full programming skills.

Excel is particularly useful for prototype work. It can model R-multiples, randomised trade sequences, drawdown distributions and conservative position sizing.

Level 4: Programmatic Backtesting with Python

4

Use code when platform limits become the bottleneck

Python allows custom data processing, portfolio testing, advanced execution models and large-scale parameter research.

However, faster testing also makes it easier to overfit. A researcher can run thousands of variations and accidentally select the luckiest historical result.

Backtests Lie When the Assumptions Are Wrong

A profitable backtest can be fake even when nobody deliberately manipulated it.

  • Entries use information that was not available at the time.
  • Slippage and commissions are omitted.
  • Historical fills are unrealistically generous.
  • Data contains survivorship or selection bias.
  • Too many parameter combinations were tested.
  • The strategy only works in one regime or market.

A beautiful backtest is not proof

The more perfect the equity curve appears, the more carefully the assumptions and optimisation process should be inspected.

The Five Tests of a Real Trading Edge

Test 1

Multiple regimes

The strategy should not depend on one isolated market phase.

Test 2

Parameter tolerance

Small input changes should not destroy the result.

Test 3

Stable drawdown

Risk behaviour should remain broadly consistent.

Test 4

Logical equity curve

Performance should reflect understandable market behaviour.

Test 5

Out-of-sample survival

The edge must work on data not used to design it.

How to reduce curve-fitting

  • Keep the rules simple.
  • Use behaviour-based logic.
  • Test several instruments and regimes.
  • Separate development data from validation data.
  • Use walk-forward testing and Monte Carlo simulation.
  • Include realistic costs and execution delays.

The Practical Backtesting Framework

From idea to controlled live deployment

Idea→Eyeball test→Objective rules→Trade log→Expectancy and risk→Platform test→Anti-curve-fit tests→Walk-forward→Micro live→Scale

What to do with the results

Identify weak behaviour, simplify the rules and retest. Do not improve the strategy merely by forcing better historical numbers. Instead, improve the economic and behavioural logic.

A trading system is a living process

Systems evolve, edges decay and markets cycle. Therefore, backtesting is not a one-off exercise completed before launch.

The strategy must be monitored, compared with its expected behaviour and reviewed when live performance changes materially.

The edge comes from the full process: research, validation, execution, risk and disciplined maintenance.

New NinjaTrader users

Start Testing Futures Strategies with the $200 Renko Trading Starter Pack

Build your futures platform foundation through Stephen Hoad’s tracked NinjaTrader route and claim the Renko Trading Starter Pack. No funding or live trade is required for this bonus route.

Renko Chart Trading Revolution PDF
Samurai Trading Code PDF
Renko Block Size Calculator
Renko Masterclass 2025 recording
Start the tracked NinjaTrader route →

Official backtesting documentation

See NinjaTrader’s Backtest a Strategy guide, its Strategy Analyzer overview, and TradingView’s explanation of backtesting and forward testing.

Backtesting a trading strategy: frequently asked questions

Can I backtest without coding?

Yes. Begin with visual testing, spreadsheets and strategy-building tools before moving to custom programming.

How many trades should a backtest contain?

There is no universal number, but the sample should cover enough trades and market regimes to make the behaviour meaningful.

What is out-of-sample testing?

It tests the strategy on data that was not used to select or optimise the rules.

Why do live results differ from backtests?

Live trading includes slippage, latency, spread changes, missed fills, emotional decisions and market behaviour not captured by the model.

Risk warning: Backtests are hypothetical and do not guarantee future results. Real execution can differ materially from historical simulation. This content is educational and is not financial advice.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_USEnglish