EA-ProgrammierungNordZentrum GmbH & Co. KG DERequest a quote

Testing · optimisation · test evidence

Backtesting and optimisation

Most backtests are too optimistic — not because of the strategy, but because of the assumptions. We test your trading system under realistic conditions, uncover systematic errors and tell you openly what the numbers do and don't support.

For MetaTrader 5 and 4 as well as cTrader. Also available as a stand-alone service for systems we didn't build.

01

Scope of services

A backtest is not a button but a test procedure. These components can be commissioned individually or together.

1.1

Data basis

Without reliable price data, every result is worthless.

  • Checking modelling quality and the available history
  • Sourcing and preparing historical price series
  • Detecting data gaps, outliers and erroneous prices
  • Comparing several data sources when results differ
  • Realistic spreads from real tick data instead of fixed assumptions
  • Commission and swap according to your account model
1.2

Checks for systematic errors

The errors that produce good results and disappear in live trading.

  • Look-ahead bias: access to information that didn't exist yet
  • Repainting indicators in the signal chain
  • Evaluating running candles instead of closed ones
  • Survivorship bias in symbol selection over longer periods
  • Unrealistic execution: prices that could not actually be traded
1.3

Optimisation and robustness

Not looking for the best value, but for the stable region.

  • Walk-forward analysis with a moving optimisation window
  • Parameter landscapes instead of rankings — a plateau beats a peak
  • Sensitivity analysis against neighbouring settings
  • Robustness tests against slippage, delay and data gaps
  • Testing across several symbols and timeframes
  • Custom fitness function, such as the recovery factor instead of final profit
1.4

Runtime and automation

When tests take days, too little gets tested.

  • Speeding up through caching and test switches
  • Moving from tick to candle calculation, where permissible
  • Switching off chart objects and logs during test runs
  • Automated runs via the command line in the background
  • Scheduling test series across many parameters and symbols
  • Server operation for long runs outside your working computer
02

What a test report contains

A report that only shows an equity curve is not evidence. These components belong in it.

Test set-up Period, symbols, timeframe, account model, starting capital, program version used. Without this information, a result cannot be reproduced.
Data basis Source, modelling quality, handling of gaps. With differing sources, the range of results.
Costs applied Spread model, commission, swap, assumed slippage. Plus a calculation with increased costs as a stress test.
Results Broken down by time periods and market phases, not as a single overall figure. With the number of trades, maximum drawdown and its duration.
Robustness Behaviour with changed parameters, increased slippage and delayed execution.
Limits What the test does not reflect and which assumptions are included. This section is the most important and is missing from most reports.

What a test report does not contain

No statement about whether the strategy will be profitable in future. A backtest is an evaluation of the past under certain assumptions — it describes how a set of rules would have behaved on known data. Deriving a forecast from it confuses description with prediction.

We tell you openly if, in our view, the numbers don't hold up — even when that argues against commissioning further work.

03

Running a backtest in MetaTrader 5: step by step

You can run a first backtest yourself. This guide shows how — and at which point a simple test stops being meaningful.

01

Open the Strategy Tester

In the terminal, open the Strategy Tester via the View menu, or press Ctrl+R. It appears in the lower part of the window.

In MetaTrader 4 it has the same name but is much simpler
02

Select the Expert Advisor, symbol and timeframe

On the Settings tab, select the Expert Advisor, together with the symbol and timeframe it was written for.

Symbol names differ between brokers — use the name under which you will trade later
03

Set the period

Several years with different market phases — trend, sideways phase, high and low volatility. Hold back part of the period: it will later serve as a cross-check.

A test over a few months says almost nothing about the future
04

Choose the modelling

For reliable results, the setting based on real ticks, provided the broker supplies this data. Only it reflects spread and execution within a candle realistically. For quick preliminary tests, minute data is sufficient.

For systems with tight stops, the modelling determines the result
05

Deposit, leverage and delay

Choose balance and leverage as they will actually be later. Where available, set an execution delay — without it, the test assumes every order is filled instantly.

Include commissions if the broker charges them separately from the spread
06

Start and read the results

After the run, the Backtest tab shows the key figures and the Graph tab the development of the balance. The largest drawdown, the profit factor, the number of trades and the shape of the curve say more than the net profit.

Which figure really counts is covered in Practice: 16 common pitfalls, group B
07

Cross-check on the held-back period

Repeat the test with the same settings over the held-back period. If the result collapses there, the system is fitted to the past, not to the market.

This is the simplest form of checking for overfitting

Where this guide ends

A single backtest with a cross-check shows whether a system works in principle. It doesn't show whether it is robust: that requires a walk-forward analysis across several time windows, checks for look-ahead bias, realistic costs and an assessment of how sensitively the result reacts to small parameter changes. We provide this as a test with a written report.

04

Pricing

Testing services are billed by time because the scope depends on the system and the desired depth of testing.

€75 / hour
net; VAT is added where applicable. After a short initial call you receive an effort estimate with an upper limit that will not be exceeded.
Checking a system Review of the source code for look-ahead bias, repainting indicators and unrealistic assumptions, with written findings.
Test series with report Carried out over an agreed period with realistic costs, robustness checks and a written report.
Walk-forward analysis Set-up and execution, including evaluation of parameter stability.
Runtime optimisation Speeding up existing systems. The effort usually pays for itself after a few test series.
05

Frequently asked questions about backtests

Why is my backtest much better than live trading?

The most common causes are unrealistic spread assumptions, missing commissions and swap rates, insufficient data quality and look-ahead bias, where signals are based on still-running candles or repainting indicators. A hit rate above eighty per cent should always be checked for look-ahead bias first, before anything else is considered.

What is a walk-forward analysis?

Instead of optimising the parameters over the entire period, you optimise on one section and test unchanged on the section immediately following. Then the window moves on and the process repeats. The result shows how the system would have behaved if it had actually been readjusted regularly — not how it looks when the future was already known.

How do I recognise overfitting?

Not by the best value, but by its surroundings. If neighbouring parameter settings perform much worse, you have found a coincidence. A broad plateau of similarly good results, on the other hand, is a reliable sign. As a rule of thumb: the more optimisable parameters, the greater the risk — four to five is usually the limit.

Which figure is more meaningful than final profit?

Any figure that relates return to the risk taken. Common ones are the recovery factor, i.e. net profit divided by maximum drawdown, as well as profit factor and Sharpe ratio, taking into account the number of trades. In MetaTrader you can store a custom fitness function that also rates the smoothness of the equity curve.

How long should a test period be?

More important than the length is that different market phases are included: trend, sideways movement, bursts of volatility, at least one major slump. A year of calm upward movement says less than three years with a mixed course. Equally important is a sufficient number of trades — below a hundred, key figures are hardly reliable.

Can you produce a test report that I can pass on?

Yes. The report contains the test set-up, data source and quality, costs applied, results per time period, robustness checks and an assessment of the limits. It deliberately contains no statement about whether the strategy will work in future — nobody can determine that seriously.

My optimisation runs for days. Can it be sped up?

Usually considerably. Typical causes are calculations performed on every tick instead of on every new candle, repeated queries of time series, and chart objects that aren't even visible during the test run. A speed-up by a factor of ten or more is not unusual.

Do you also assess my strategy in terms of content?

We tell you what the numbers support and where the test reaches its limits. What we don't do: forecast whether the strategy will be profitable in future. A backtest is a statement about the past under certain assumptions — no more, but no less either.

Have your system tested

Send us the source code and a short description of what you want to know. You receive an effort estimate with an upper limit — free of charge and without obligation.

EA-Programmierung is a service of NordZentrum GmbH & Co. KG, Germany: Expert Advisors, indicators and trading systems for MetaTrader 5 and 4, cTrader, TradingView and ATAS, developed by André Liebetrau, Dipl.-Inf., a development service provider since 2009. Fixed price based on a written specification, complete source code included.

Request a test

Which errors make a backtest worthless is covered in Practice: 16 common pitfalls, group B. How TradingView's strategy tester compares is covered in the platform comparison.