Where to Backtest a Trading Strategy: Five Real Options

Written by Dominic Walsh · Published · Last updated

Deciding where to backtest a trading strategy shapes what the answer is worth. The venue sets the fidelity, the effort and the kind of error you are most likely to make.

Five options cover almost everything: the platform’s own tester, manual bar-by-bar replay, a spreadsheet, your own code, and a third-party tool. Each one answers a different question well and the others badly.

The panel above compares the four automated venues on effort against fidelity. Manual replay is the fifth, and it sits outside that grid entirely.

Where to Backtest a Trading Strategy: The Five Venues

Table of Contents

Start by naming the question. A rule that acts intrabar needs tick detail, while a rule that reads daily closes needs almost none.

Match the venue to that need. Testing a scalping rule in a spreadsheet wastes a week, and testing a weekly trend rule with imported tick data wastes a month.

The Trade-Off in One Line

Fidelity costs effort, and effort buys precision you may not need. So pick the cheapest venue that can still answer your question honestly.

Then upgrade only when the cheap venue runs out of road. Reaching for the heaviest tool first is the most common way a good idea never gets tested at all.

The Platform’s Own Strategy Tester

Most traders start here, and for automated rules it is usually the right call. The tester runs your actual code against stored history.

What MT4 Gives You

The MT4 Strategy Tester offers three models. Every tick is the most precise, and MT4 interpolates ticks from minute data unless you import real tick data.

Control points uses the nearest smaller timeframe and runs much rougher. Open prices only is the fastest, evaluates at bar open, and is meaningless for any rule that acts intrabar.

Our walkthrough of the MT4 Strategy Tester covers each field. Set the model deliberately rather than accepting the default.

Reading the Quality Figures

Modelling quality reports as a percentage. Around ninety percent is the practical ceiling using MT4’s own minute history on every tick, and it reads not applicable for open prices only.

Mismatched charts errors mean the history has gaps. That is a data problem rather than a strategy result, so fix it before reading anything else.

What It Costs You

The tester applies a fixed spread unless configured otherwise. So a run systematically understates cost during news and at the daily rollover.

It also cannot contain slippage variation, requotes, a widening spread, or your own hesitation. Those absences are structural, not settings you forgot.

Who It Suits

Coded rules with clear entries and exits fit naturally. Discretionary rules do not, because the judgement never made it into the code.

How MT5 Differs

The MT5 tester handles real ticks natively and runs several symbols in one pass. That makes portfolio questions answerable without custom code.

It also runs faster on multi-core machines. So if your rule already exists in both languages, the newer tester usually saves time.

Charting Platform Testers

Charting platforms ship their own strategy testers, and they suit a different job. Scripts run against the chart you are already looking at, so iteration is quick.

What They Do Well

Visual feedback is the strength. Entries and exits plot directly on the bars, so a logic error becomes obvious within seconds.

Our TradingView section covers scripting on that side. For a first look at whether an idea has any shape, this route is hard to beat.

Where to Be Careful

Repainting is the classic trap. A script that references a value which finalises later will show signals nobody could have taken.

Bar magnifier settings also matter. Without them, the tester guesses the order of prices inside each bar, exactly as MT4 does.

Data depth varies by account tier as well. A shallow history quietly caps your sample before you notice.

Manual Bar-by-Bar Replay

The slowest venue teaches the most. You step forward one bar at a time with the future hidden, then record what you would have done.

The panel above shows the shape of an honest replay. Everything left of the line was visible, and everything right of it was not.

How to Do It Honestly

Hide the future completely before you look. Then write the decision down before advancing, because a decision recalled afterwards is not a decision.

Log entry, stop, target and the reason in one line each. A trade journal keeps that record usable.

What It Teaches

Replay exposes hesitation, and no automated venue can. You discover which setups you actually take and which ones you talk yourself out of.

It also builds pattern recognition quickly. A hundred replayed setups beat a thousand scrolled-past ones.

Its Limits

Speed is the obvious one, since a hundred trades takes days. Bias is the quieter one, because knowing roughly what happened in that period leaks into your choices.

So replay periods you have never studied. Then treat the sample as small, because it is.

A Spreadsheet

Spreadsheets suit rules that read one value per bar. Daily closes, weekly ranges and simple crossovers all fit comfortably.

What Works Well

Formulas make the logic visible, so errors surface as you build. You can also see every intermediate value, which no tester shows you.

Export the price history, add a signal column, then add entry, exit and result columns. The whole thing takes an evening.

Where It Breaks

Anything intrabar breaks it immediately. A spreadsheet cannot tell whether your stop or your target came first on a bar that touched both.

Pending orders and partial fills get messy too. Once you find yourself writing complex nested logic, move to code.

A Practical Layout

Keep one row per bar and one column per idea. Price columns first, then indicator columns, then a signal column, then the trade columns.

Add a column that flags any bar where both stop and target were touchable. Counting those bars tells you immediately whether the spreadsheet can answer your question at all.

The Hidden Benefit

Building it forces you to state the rule exactly. Half of all strategy ideas die at that step, which saves the weeks that would have followed.

Download the complete indicator database

Put these concepts on your charts. One email unlocks the full library of 1,380+ indicators with compiled MT4 and MT5 files, plus my TradingView scripts. No paywall, no spam, unsubscribe any time.

Get free access to my indicator database

One email unlocks 1,380+ free MT4, MT5 and TradingView indicators — the complete library. No single-tool download; you get the whole database.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

Your Own Code

Writing the test yourself gives full control. It also gives you full responsibility for every bug.

What You Gain

You choose the fill assumptions, the cost model and the way ties get resolved. Nothing hides behind a platform default.

Portfolio-level questions become answerable as well. Correlated positions, shared risk limits and combined drawdown all need code.

What You Risk

Lookahead bias slips into custom code easily. Reading a bar’s close and acting at its open is one line, and the result looks wonderful.

Test the harness before you test the rule. Run a random-entry rule through it and confirm the result lands near zero minus costs.

Who It Suits

People who intend to test many ideas over years. For one or two rules, the platform tester gets you there faster.

Third-Party Tools

A category of tools imports real tick data and feeds it into the platform tester. They exist to raise fidelity above what stored minute history allows.

What They Add

Real tick data replaces interpolation, so intrabar sequence becomes far more reliable. Variable spread modelling usually arrives with it.

Our note on tick data backtesting covers what that buys and what it does not. Higher modelling figures come from this route rather than from the platform alone.

What They Cannot Fix

Better ticks do not create a bigger sample. Forty trades modelled perfectly still tell you very little.

They also cannot supply your live fills. Slippage on your account remains an unknown until you measure it there.

Testing a Rule You Did Not Write

Many traders test something bought or downloaded rather than built. The venue question changes shape when the logic is closed.

You Can Still Measure Behaviour

Run it in the platform tester and read the trade list rather than the curve. Trade count, holding time, largest loss and the longest losing run describe the thing accurately.

Compare those against the description that came with it. Disagreements matter more than any profit figure.

You Cannot Review the Logic

An opaque rule cannot be inspected, so you cannot check it for lookahead or repainting. That limitation is permanent, and no amount of testing removes it.

A system nobody can explain also cannot be debugged when it stops working. Treat that as a cost, not a detail.

Test It on Data It Never Saw

Whoever built it tuned it on something. Pick a period and a symbol outside the obvious choices, then run the identical settings there.

That single test filters most of what circulates online. It costs an hour.

Data Is the Real Constraint

Venue matters less than the history behind it. Bad data produces a confident wrong answer at any fidelity.

The panel above ranks three sources on cost against coverage. None of them is right for every job.

Broker Feed

Free, convenient and specific to one venue. Gaps are common in older history, and the pricing reflects that venue rather than the wider market.

Use it for a first pass, then check a second feed. Large disagreement between two feeds points at data rather than at strategy.

Vendor Tick Data

Paid tick histories go back further and arrive cleaner. They cost money and time, and importing them is its own small project.

Worth it when the rule acts intrabar. Rarely worth it for a daily-close rule.

Exchange Data

Futures and other exchange-traded instruments publish centralised data. Spot forex has no central exchange, so no equivalent single record exists.

That absence explains a great deal. Two honest forex backtests of the same rule can disagree simply because they used different feeds.

Choosing a Venue

The decision takes about five minutes once you know the questions. Work down them in order.

The flow above puts them in sequence. Notice that data quality comes before tool choice, not after.

Ask What the Rule Touches

A rule that reads only closed bar values fits a spreadsheet. A rule with a stop and a target inside the same bar needs tick detail.

Ask How Many Trades You Need

Manual replay produces dozens. Automated venues produce thousands, and thousands is what most claims require.

Feed whatever you get into the expectancy calculator and see whether the count supports the figure. Often it does not.

Ask What You Can Maintain

A test you cannot re-run in a year is a one-off opinion. Spreadsheets and platform runs both survive that test, while a half-documented script rarely does.

Save the file, the settings and the data source together. Then re-running next year takes minutes rather than a rebuild.

Ask Who Will Trade It

If a person makes the final call, replay measures something the code cannot. Run both, then compare the two logs.

Automated Testing Against Manual Replay

These two are not rivals. They answer different questions, and a serious process uses both.

The comparison above sets them side by side. Speed and coverage sit on one side, and realism about the human sits on the other.

Use Automation for Breadth

Run the rule across years and symbols to find the shape of the result. Then check whether the edge survives being sliced by year.

Cross-Check One Against the Other

Pick twenty trades from the automated log and replay those same bars by hand. Where the two disagree, something in the code does not match what you thought it did.

That exercise finds more bugs than reading the code does. It also finds the setups you would have skipped in practice.

Use Replay for Depth

Replay the fifty most awkward occurrences by hand. Failed breaks, choppy sessions and news bars teach more than the clean examples.

Multi-timeframe reading matters here, and our guide to multi-timeframe analysis covers how the higher chart changes what a signal means.

Setting Up a Test in Any Venue

The setup steps barely change between tools. Only the buttons differ.

Fix the Rule First

Write entry, exit, stop, target, size and filters down before you open anything. A rule decided while testing is not a rule.

Include the awkward cases. What happens on a Friday close, on a gap, or when two signals fire at once?

Choose the Window Deliberately

Pick the start and end dates in advance, then leave them alone. Shifting a start date after seeing results is one of the easiest ways to fool yourself.

Reserve a slice of history you will not touch during tuning. That reserve is the only honest test you get.

Set Cost Before You Run

Enter spread, commission and swap deliberately. Then run the whole thing again at double the cost and compare.

A robust rule loses part of its result. A fragile one loses all of it.

Record the Assumptions

Save the settings beside the report. Six months later the figure will look far more authoritative than it deserves, and the note is your defence.

What Each Venue Costs in Time

Effort is the constraint most people underestimate. Budget it before you commit.

An Evening

A spreadsheet test of a simple daily rule takes one evening. So does a replay session of twenty or thirty setups.

Both are cheap enough to run on a hunch. That cheapness is exactly why they belong first.

A Weekend

Coding a rule for the platform tester and running it across several years usually fills a weekend. Debugging the rule takes longer than writing it.

Add another day if the history needs cleaning. Gaps in the data cause more lost hours than any other single problem.

A Month

Importing vendor tick data, validating it and re-running everything is a month-long project for most people. It is worth doing once, for a rule that has already survived cheaper tests.

Doing it first is the common error. Precision applied to an untested idea buys nothing.

Mistakes Specific to Each Venue

Every venue has a signature error. Knowing yours in advance saves a rebuild.

VenueBest forSignature mistake
Platform testerCoded rules across years of historyAccepting the default spread and model
Manual replayDiscretionary rules and pattern learningPeeking, or replaying a period you remember
SpreadsheetOne value per bar, simple logicGuessing which came first inside a bar
Own codePortfolio questions and many experimentsLookahead bias hidden in one line
Third-party toolIntrabar rules needing real ticksTreating high fidelity as a large sample

Read the right column as a checklist. Each row names the thing that will go wrong if you stop paying attention.

Notice that four of the five errors are assumptions rather than bugs. Tools rarely lie, and defaults quietly do.

A Practical Sequence

Most people get better results by using several venues in order. The order matters more than the tools.

Start Cheap

Build the rule in a spreadsheet or replay thirty setups by hand. That first pass kills most ideas in an evening.

Then Scale

Move the survivors into the platform tester for breadth. Set a pessimistic cost model, run once, and read the trade count before the profit line.

Then Raise Fidelity

Only rules that depend on intrabar sequence justify tick data. For everything else, the extra precision changes nothing worth having.

Then Re-Test the Survivor

Take whatever cleared the earlier stages and run it once on the reserved history. Accept that answer, whatever it says, because it is the only unbiased number you own.

Most rules fail here, and that failure is the process working. A cheap rejection at this stage is worth far more than a slow one on a live account.

Then Go Forward

A good historical result earns permission to run a forward test. Demo prices expose session and symbol errors, and small live size exposes execution.

What No Venue Can Do

Every option on this page shares the same ceiling. A backtest can only disprove a strategy, never prove one.

It Cannot Contain the Unknown

No simulation holds slippage variation, requotes, a widening spread, or the trader’s own hesitation. Those arrive only with real orders.

It Cannot Predict

Conditions change, and a rule keeps trading through the change. Nothing in any report speaks to next quarter.

It Can Reject Cheaply

That is the real value, and it is considerable. Our step-by-step guide to how to backtest a trading strategy covers the process end to end.

For raw material, browse the MT5 indicators library and test what you find rather than trusting a description.

FAQ

Is the MT4 Strategy Tester good enough?

For most coded rules, yes, provided you set the model and the cost deliberately. Use every tick rather than control points or open prices only, check the modelling quality figure, and confirm the mismatched charts errors count is zero before reading any result.

Can I backtest a discretionary strategy?

Only through manual replay, and the sample will be small. Hide the future, write each decision down before advancing, and replay a period you have never studied. That process measures your judgement, which no automated venue can reach.

Do I need paid tick data?

Only when the rule depends on the sequence of prices inside a bar. Scalping rules, tight stops and trades that could hit stop and target on the same bar all justify it. A daily-close rule gains nothing from the extra detail.

Should I use a spreadsheet or write code?

Use a spreadsheet while the logic reads one value per bar and stays simple. Move to code once you need pending orders, partial fills, several symbols at once or portfolio-level risk limits. Building the spreadsheet first is rarely wasted, since it forces you to state the rule exactly.

Which venue gives the most trustworthy result?

None of them gives a trustworthy result on its own, and that is the honest answer. Higher fidelity narrows one kind of error while leaving sample size, cost assumptions and your own behaviour untouched. Use the cheapest venue that can answer your question, then let a forward test settle what history cannot. Results are not guaranteed; past performance is not indicative of future results.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment