Backtesting guide

How to backtest a forex strategy without coding

Build a forex strategy backtest step by step: define rules, choose historical data, set costs and risk, then inspect trades and drawdown.

Start with a rule you can write down

A backtest replays trading rules over historical data. A useful test states exactly when an entry is allowed, how the trade is managed, and what closes it. A rule such as “buy a strong trend” leaves decisions unresolved. “Buy after a completed candle closes above its 20-period simple moving average” gives the engine something specific to evaluate.

This walkthrough uses the editable example already available in the EdgeMotive strategy builder. It is a way to learn the workflow, not a recommended trading strategy or a claim about returns. Loading the example does not run a test, and nothing here assumes it is profitable.

The example rules

Use ordinary time candles for this first example. The moving average and volatility indicator use the selected chart timeframe.

Editable example configuration
SettingRule
DirectionBuy only.
Trend referenceSimple moving average (SMA), 20 completed candles.
Volatility referenceAverage true range (ATR), 14 completed candles.
Entry conditionThe completed candle closes above the SMA. This is an above condition, not a crossing condition.
Entry executionUse the next-open market entry selected in the trade plan. Check that setting before running.
Initial stopTwo times the referenced ATR.
Profit targetTwo times the initial stop-risk distance, or 2R.

An “above” condition can remain true on several candles. A crossing condition only becomes true when the relationship changes. That difference can produce a different set of trades. Also review the entry limits and management controls: an entry condition does not by itself authorize unlimited simultaneous positions.

1. Choose the market and history

Open the builder and choose an available forex market, such as EUR/USD. Use Candles and a timeframe such as H4. The instrument selector and history controls show what is actually available; a guide is not a promise that every symbol or date range is supported.

Choose the dates before examining a result. Keep the same dates when comparing changes. Earlier candles may still be needed to calculate the SMA and ATR: the test window limits trading, while indicator warm-up uses earlier context where available. Check the report for the requested and actual window.

Managed profiles are historical benchmarks with stated assumptions. They are not an exact copy of every broker's feed. If you use your own supported CSV instead, review its timezone, detected columns and trading terms before continuing. Managed raw market data is not provided for redistribution.

2. Load the example and review every step

Choose Load example near the top of the builder, and confirm replacing the current rules. It loads SMA 20, ATR 14, the above condition, a 2 × ATR stop and a 2R target. Your selected market, chart, balance and costs stay as selected, so review them independently.

Follow the five sections: market, chart, strategy rules, balance and risk, then review and run. Check that the entry is a next-open market order, the direction is Buy, and no schedule or additional trade-management setting changes the experiment you intended. The final review describes the submitted setup.

If a rule needs an indicator that is absent or incompatible, resolve the warning before running. Do not substitute another indicator merely to make the form valid. For a first test, leave unrelated optional settings alone and keep a copy of the exact request.

3. State the risk and trading costs

Set the starting balance and risk percentage deliberately. These control monetary projections and position sizing; a 2R target describes the trade's planned reward relative to its initial risk, not a guaranteed account return.

Check Include spread. New setups exclude spread unless you select it, while reopening a saved setup preserves that setup's original costs. A zero-spread test can help you understand the rules, but it omits an execution cost. Review commissions and other available assumptions separately. The cost-comparison guide explains how to compare them without changing the strategy.

4. Run and inspect the individual trades

Sign in when required and submit the test. A free account provides an allowance of exact backtests; current plans and limits describe what is included. The builder flags data or configuration problems before a result can be produced.

Start with a few trade rows. Check entry times, stops, targets, exit reasons and the execution assumptions. A correct-looking equity curve does not establish that the engine interpreted your rules as you intended. Compare representative trades with the rule description before interpreting the overall numbers.

Then review the number of trades, drawdown, profit factor, R results, monetary results where executable, and the period covered. Open the public sample report to see the report format; its market and strategy are separate from this walkthrough and its numbers are not this example's results.

5. Use a later period without tuning it

A historical result can reflect chance or choices made after seeing the data. Where appropriate, use the optional holdout check to keep a later period separate. If you repeatedly change the rules after inspecting that period, it is no longer an untouched test.

Cost stress, time consistency, parameter sensitivity and Monte Carlo checks ask different questions. Review their assumptions and sample size; no individual check proves future profitability. Save the strategy and its report before making another version so that the comparison remains reproducible.

Exact backtesting and Discovery do different jobs

The manual builder replays one submitted rule set. It does not quietly search for better parameters. Discovery explores supported variations and records their rules and historical results. Searching many ideas creates a separate selection problem: an attractive historical candidate still needs further evaluation.

If you already know the rules you want to test, start with the builder. If you want to explore variations, review Discovery's current availability and subscription terms. Neither path executes arbitrary uploaded trading code or guarantees future returns.

Build your first backtest Next: understand trading costs →