Skip to content
Module 1 / 2
  1. Trading plan: how to write and enforce
  2. Setup definition: how to write rules
  3. Backtest and forward test: how to test
  4. From demo to live

Backtest and forward test: how to test

Backtest and forward test without fooling yourself: test hygiene, costs in R, history split into windows, and probation period pass criteria.

How a backtest differs from a forward test0:00 / 11:00
Illustration for lesson: Backtest and forward test: how to test
3 / 7
Author
Zordon Intelligence Sp. z o.o.
Updated
11 min read
Structure sources
3

How a backtest differs from a forward test

This lesson explains how to test a setup so that the result can be defended — before yourself and before your own journal. We direct it to people who already have a written setup definition and want to check its rules on data, instead of evaluating them based on the feeling from recent sessions.

Backtest answers whether the rules made sense historically. Forward test answers whether you can stick to them in real time, without changing them midway. Both tests measure something different, and neither replaces the other.

An equity curve without recorded rules is decoration, not evidence. Before you evaluate the chart, calculate expectancy and maximum drawdown — the method for calculating uncertainty of the mean is in the lesson expectancy and drawdown.

Seven backtest hygiene rules

Order matters: you record the rules before opening the history, not after seeing the result.

  1. Record rules before the test. The setup definition with date and version number lies next to the chart before you scroll the first chart back.
  2. Go candle by candle. You evaluate the signal only on closed candles; no decision uses information that did not yet exist at that moment.
  3. Record every signal, including rejected ones. The list of skipped signals later shows whether the filter works or only removes trades.
  4. Count costs. Spread, commission, slippage, swap, and round-trip cost enter every result, not as an afterthought.
  5. Set a fixed set of instruments. Changing the market during the sample because it “looks better” invalidates the comparison.
  6. Keep one version of rules. A correction midway through the test means a new test from the beginning, not a result adjustment.
  7. Record date range and number of transactions. Without this, you do not know whether the result describes a month or three years.
MistakeSymptom in reportHow to avoid it
Look-aheadentry on knowledge from the next candleevaluation only on closed candles
Zero costshigh R that does not appear on livefixed round-trip cost from the broker table
Curve fittinga dozen filters fitted to one chartat most one or two filters in the first version
Rule changes during test“it turned out better”rule version with date and no backward editing
Skipping signals outside the periodno trades in a difficult monthcontinuous test, without cutting out fragments

Costs in R — arithmetic that changes the result

Cost is easiest to compare with risk, so you express it in R. The basis is the expectancy formula:

E (in R) = win_rate × average_win − (1 − win_rate) × average_loss
required_win_rate = average_loss / (average_win + average_loss)

The table below uses numbers from the report template: win rate 42%, average win +2.1R, average loss −1R. All values are illustrative (illustrative number).

Cost variantNet winNet lossExpectancy at 42%Required win rate
no cost+2.1R−1.0R0.42 × 2.1 − 0.58 × 1.0 = +0.30R1.0 / 3.1 ≈ 32.3%
cost 0.1R+2.0R−1.1R0.42 × 2.0 − 0.58 × 1.1 = +0.20R1.1 / 3.1 ≈ 35.5%
cost 0.2R+1.9R−1.2R0.42 × 1.9 − 0.58 × 1.2 = +0.10R1.2 / 3.1 ≈ 38.7%

Three conclusions follow from simple subtraction. A 0.1R cost lowers expectancy by one third, and a 0.2R cost — to one third of the initial value. At the same time, the required win rate rises from about 32% to almost 39%, i.e. a threshold that was recently met ceases to be met. A test without costs therefore measures a different system than the one that hits the account.

Therefore, after every backtest, perform a sensitivity check: raise the assumed cost by half and recalculate expectancy. At a cost of 0.15R, the formula gives about +0.15R (illustrative number). If the result falls to around zero, the edge was an assumption effect, not a rule effect.

History split into windows

One test on the whole history describes an average that never occurred. History is divided into parts, and each part is treated as a separate exam:

  1. In-sample — the period on which the rules were created. The result from this period is always optimistic and is not used for decisions.
  2. Out-of-sample — the period you did not see while writing the rules. Here you check whether signals appear at all and whether the result has the same direction.
  3. Walk-forward — history cut into test windows of constant length, shifted by a constant step. A three-month test window shifted every three months gives eight windows in 24 months of history (illustrative number).
WindowDate rangeNumber of transactionsExpectancy in RMax DD in RResult consistent with previous?
1
2
3
4
Total

You draw the conclusion from the scatter between windows, not from the average. If one window gives all the profit and the others oscillate around zero, the rules describe one market episode, not a repeatable process.

How many transactions are needed to say anything

The number of transactions per window matters more than their sum in the whole test. Starting point (illustrative number): at least 30 transactions in one window and at least three windows indicating the same result direction. With two signals per week, thirty transactions is about fifteen weeks of records.

The scatter of results also matters — a system with a jagged curve needs a longer sample than a system with even results. The method for calculating uncertainty of the mean is in the lesson on expectancy and drawdown; here the rule is enough that you make a decision after windows, not after five transactions.

A small sample plus high leverage on a CFD is the classic road to drawdown. Increasing position size is covered in a separate lesson scaling size — without the result from this test, there is nothing to scale.

Backtest report template

The columns below are a format. The “illustrative example” row shows how to read the table, not the course system’s result; all values in that column are illustrative numbers. You fill in the “Your data” column with your own records.

FieldIllustrative example (format)Your data
Setup and rule versionbreakout H1 v1.2
Date range2025-01 → 2025-06
InstrumentEUR/USD, CFD
Number of transactions40
Win rate42%
Average win / average loss+2.1R / −1R
Round-trip cost0.1R
Expectancy≈ +0.2R
Maximum drawdown−8R
Walk-forward windows4 out of 4 consistent
Forward: period and number of signals6 weeks / 22
Decisionrepeat / keep / reject

If you cannot fill in the “Your data” column, the problem is not in the table. Return to setup definition: lack of a number in the report means lack of a number in the rules.

Forward test: period and pass criteria

Forward test is the same set of rules running on the current market, without changes. Minimum period (illustrative number): three weeks and at least 20 signals — the period extends when the setup appears rarely.

Record pass criteria before starting, not after finishing:

CriterionThreshold (illustrative number)Result
Rule compliance≥ 90% of transactions per checklist
Trades outside planat most 2
Period expectancy≥ 0R
Maximum drawdownnot larger than 1.5 × backtest drawdown
Rule changes during testnone

Passing all five criteria means the setup moves to the next stage. Failing one means returning to the rules or the sample — not to increasing position size. Set the loss limit in the trial period as in the plan, e.g. 2–3R daily (daily limit, illustrative number).

How to read the equity curve critically

A rising curve is not proof of edge. It can be the effect of a fitted period, one lucky trade, or lack of costs. Before you consider the result reasonable, check four things:

  • Profit concentration — whether most of the result comes from one or two trades. If so, the sample is too small and the average is unstable.
  • Drawdown shape — long, flat periods underwater say more than the maximum drawdown expressed in R.
  • Stability over time — divide the sample into two halves. A clearly weaker second half means rules fitted to the first.
  • Cost sensitivity — raise the assumed cost by half and recalculate the result, as in the table above.

When the test result says “do not trade live”

Four situations where the test does not give a green light:

  1. Profit comes from one or two trades. With such concentration, you do not know whether the setup works or one anomaly did.
  2. Expectancy falls to zero after raising cost by half. The edge was an assumption effect, not a rule effect.
  3. Forward test fails at least one criterion. The result from history did not transfer to the current market or to your execution.
  4. The second half of the sample is clearly weaker than the first. The rules describe a past that no longer exists.

Common anti-patterns in testing

  • Backtest without rules recorded before the test — conditions added after the fact to fit the chart.
  • Forward test interrupted after the first loss — that is not a test, but confirmation of a prior assumption.
  • Changing instrument during the sample because another “looks better” — data stops being comparable.
  • Ignoring session hours — setup tested on full-day data and executed in the evening has a different volatility distribution.
  • Testing only one side of the market — checking only long positions in an uptrend inflates the result.

Measurable exercise

Choose one setup from the plan and record its rules with a version number before the test. Manually go through ten historical sessions, candle by candle, recording every signal together with cost. Then calculate three numbers: expectancy, required win rate, and number of transactions after subtracting a 0.2R cost (illustrative number). Fill out the report template with your own data and record whether the result holds after raising the cost by half. You will find the protocol format in Method.

Next step

When the test goes well, define the criteria for moving from demo to live: from demo to live.

Check yourself

What is look-ahead bias?

Common questions

Is an automatic backtester mandatory?

No. A manual candle-by-candle test on a small sample often teaches rules better. Automation helps at larger scale, provided it uses the same costs and does not peek into the future.

Forward test on demo or micro account?

First demo, to check the process without money pressure. An account with minimum size makes sense only when the pass criteria are met and a single loss does not affect the decision.

What to do when backtest and forward go well, but live does not?

Check slippage, spread in your hours, percentage of trades outside the plan, and position size. Most often, execution fails, not the signal itself.

Why split history into windows and count costs, when it is enough to check whether the strategy earned?

Because the question 'did it earn' does not tell you thanks to what. Without splitting into windows, you cannot distinguish a repeatable edge from one successful period, and without costs you measure a system that does not exist on the account. Measurement is not for decorating the report — it is so that the decision to go live is based on something more than the curve shape.

Advertisement

Key takeaways

  • Backtest answers whether the setup rules made sense historically, and forward test checks whether you can stick to them in real time. This lesson gives seven test hygiene rules, a formula for expectancy and required win rate, history split into windows, and probation period pass criteria. Example numbers serve only to show the format — every result you calculate on your own data and own costs.

Structure sources

The material is based on source documents. Variable values — fees, limits, regulatory figures — are worth checking at the source before making a decision.

Disclaimer

  • Educational material. Not investment advice or a recommendation. Trading involves the risk of losing capital.
  • The materials are educational. They are not investment advice or a recommendation within the meaning of financial instruments trading regulations. Numbers in examples are illustrative unless a measurement date and source are given.

Who writes this and how we check it

The materials are written and verified by Redakcja Kurs Tradera — the rules are described on about the site: every number has a source, and we show gaps openly. Report a factual error via contact — corrections are described in the content.

Course progress 0 / 7
Next →

Progress is stored only in this browser (localStorage) — there is no account and no copy on the server. Clearing site data will remove it. Manage your data