FX TERMINAL · BLOG

Trading Strategy

Free Forex Backtesting in the Browser — And How to Know It's Real

you can build, test and analyse a forex strategy without writing code, installing MetaTrader or paying for a data subscription. The forex strategy backtester runs entirely in the browser against…

FX Terminal Research · 2026-08-16 · 12 min read

Short answer: you can build, test and analyse a forex strategy without writing code, installing MetaTrader or paying for a data subscription. The forex strategy backtester runs entirely in the browser against real historical candles, gives you win rate, profit factor, expectancy, maximum drawdown, an equity curve and a searchable trade log, and lets you build rules visually with nested AND/OR logic across multiple timeframes.

The harder part is not running the backtest. It is knowing whether the result means anything. This article covers both — how the builder works, then the four robustness tests that we now run on every candidate, using a real example where a strategy with a 3.27 profit factor turned out to be nothing at all.


Part 1: What the builder actually does

Rules are data, not code

A strategy in the Strategy Lab is a set of conditions, each comparing two operands. An operand can be:

Operand type Examples
Price open, high, low, close of the current or a previous bar
Indicator EMA, SMA, RSI, MACD, ADX, ATR, Bollinger Bands, Donchian channels, Supertrend, session/weekly/monthly VWAP, anchored VWAP, stochastic RSI, Ichimoku
Structure order blocks, support/resistance levels, market structure breaks
Constant a fixed number
Higher timeframe any of the above evaluated on a different timeframe than the chart
Fundamental a macro series such as COT net positioning, with publication-lag alignment

Conditions compare them with operators like crosses above, crosses below, greater than, less than, is rising, is falling. Conditions nest inside AND/OR groups to arbitrary depth, so "long when close is above the 200 SMA and (session VWAP crosses above the 100 SMA or price taps a bullish order block)" is a thing you assemble by clicking, not typing.

The architectural principle underneath is worth stating because it explains the feature's shape: engines are code, definitions are data. The rule interpreter lives in the application; a strategy is a serialisable configuration object. Adding a new strategy of an existing type is a saved record, not a code change.

Multi-timeframe done correctly

The higher-timeframe operand is the feature most likely to be silently wrong in a homemade backtester, so it deserves a note.

When your chart is H1 and your rule references the D1 trend, the naive implementation reads today's completed daily bar — which does not exist yet at 09:00. That is lookahead, and it makes every trend filter look brilliant. The Strategy Lab evaluates higher-timeframe operands against the last closed bar available at the current bar's timestamp.

Risk management is part of the strategy, not an afterthought

Setting What it does
Stop loss Fixed pips, or ATR multiple
Take profit Fixed pips, or ATR multiple, or R multiple
Trailing stop Pips or ATR, ratchet-only
Break-even stop Arms after a favourable excursion clears a trigger, then moves the stop to entry ± an offset
Max hold Caps trade duration so stalled positions cannot run for weeks
Spread Charged per round turn
Commission Per lot, charged at open
Slippage Optional additional cost

Two implementation details that change results and are worth knowing:

When a single bar spans both the stop and the target, the stop wins. Intrabar order is unknowable from OHLC data, so the engine assumes the worst case. Backtests that assume the target hit first are systematically optimistic, and the gap widens as your stop and target get closer together.

Break-even stops are not free. They convert losers into scratches, but they also convert winners into scratches, and which effect dominates depends entirely on the strategy's style. On trend and breakout systems they help. On mean-reversion and fade systems they are usually a net negative — one VWAP mean-reversion preset performed measurably worse with break-even and trailing enabled. Test it both ways rather than assuming it is protective.

The statistics you get

Metric Why it matters
Win rate Least useful of the set. A 20% win rate with 5:1 payoff beats an 80% win rate with 1:4.
Profit factor Gross profit ÷ gross loss. Below 1.0 loses money. Above ~1.3 on a decent sample is interesting.
Expectancy Average pips or dollars per trade. The number that scales.
Maximum drawdown The peak-to-trough loss. The number that decides whether you could actually have traded it.
Exit mix How trades ended: target, stop, trailing, break-even, time. Reveals whether the strategy is doing what you think.
Equity curve Shape matters more than the endpoint. A straight line and a hockey stick with the same return are different strategies.
Trade log Every entry, exit, reason, duration and P&L — filterable, sortable, searchable, exportable.

Costs, quantified

An illustrative run makes the point better than a warning does. An EMA-cross strategy over 126 trades:

Configuration Ending equity
No commission −$402
$5 per lot commission −$1,032

The commission alone cost $630 across 126 trades — about $5 per trade, exactly as specified, and two and a half times the strategy's "gross" loss. On a strategy that trades frequently, the cost model is not a detail. It is often the dominant term.


Part 2: The four robustness tests

Here is the example the entire section is built around.

The strategy that looked great

We built a monthly-VWAP mean-reversion strategy on EUR/USD H1, gated by a contrarian COT filter: only take the fade when speculative positioning in the euro is at a 52-week extreme (|z-score| > 0.5).

Result on EUR/USD H1, twelve months:

Metric Ungated With COT gate
Profit factor 2.45 3.27
Win/loss ratio 0.79 1.74
Net pips +613
Trades 23
Max drawdown 0.93%

A 3.27 profit factor with under 1% drawdown. If you saw that in a screenshot you would probably buy the course.

Test 1: Timeframe stability

Run the identical logic on a different timeframe over the identical period. Genuine edges are not fussy about bar size; curve fits are.

Instrument / timeframe Profit factor
EUR/USD H1 3.27
EUR/USD M15 (same 12 months) 1.01
GBP/USD M15 marginal

1.01 is a coin flip with extra steps. The edge did not survive contact with a different bar size, which means it was never an edge — it was 23 trades landing favourably.

How to run this test: change the timeframe selector, re-run, compare. It takes about ten seconds and it is the highest-yield check available.

Test 2: Sample size

Twenty-three trades. That was the whole basis of the result.

The rough rule for a strategy backtest is that under 30 trades tells you nothing, 30–100 is suggestive, and several hundred is where confidence starts. This is not a hard threshold — it depends on the variance of your returns — but 23 trades is comfortably inside the range where random noise produces profit factors above 3 with unremarkable frequency.

Check the trade count before you look at the profit factor. If you look at the result first, you will find reasons to believe it.

A structural caveat specific to intraday FX backtesting, ours included: the deepest intraday history available here is roughly twelve months (about 6,200 H1 bars or 24,800 M15 bars on EUR/USD). That is enough to generate hundreds of trades for a frequent intraday strategy, and not enough to validate a selective strategy that trades twenty times a year. If your rules are picky, you will hit the sample-size wall before you hit any other limitation. We flag this rather than hide it, because it is the binding constraint on validating slow-moving fundamental factors and no amount of interface polish changes it.

Test 3: Parameter sensitivity

Nudge each parameter by 10–20% and re-run. A real edge degrades gently. A curve fit falls off a cliff.

If your 14-period RSI strategy makes money at 14 and loses at 13 and 15, you have found a property of your specific dataset, not of the market. Build a small sensitivity table:

Parameter −20% −10% Base +10% +20%
RSI period
Stop (pips)
ADX threshold

You want a plateau, not a spike. A spike means the next twelve months will land you on the side of it.

Test 4: Cost sensitivity

Re-run with double your assumed spread. If the strategy dies, its edge was inside the noise band of execution quality, and your live results will depend entirely on which broker you happen to use and what time of day you happen to trade.

For any strategy averaging under about 3 gross pips per trade, this test is decisive.

What we did with the result

We did not ship the COT-gated preset. The fundamental operand engine — including the strict publication-lag semantics described below — shipped, because the machinery is correct and reusable. The specific strategy did not, because it failed Test 1 and Test 2 simultaneously.

That is the discipline the tests are for. Building the thing and validating the thing are separate activities, and the second one is allowed to say no.


Part 3: Testing fundamental data without cheating

The fundamental operand deserves its own section because it is where lookahead bias is easiest to introduce and hardest to spot.

Macro data has two dates: the period it describes and the date it was published. A COT report dated Tuesday is released Friday evening. A GDP figure for Q2 arrives in late July. If your backtest lets a bar on Tuesday see Tuesday's COT number, you have given your strategy three days of foresight, every single week, and your equity curve will look wonderful.

Every fundamental data point in the engine carries an availableAt timestamp — the release time, not the reference time — and a bar can only see values whose availableAt is at or before that bar's timestamp. The COT series stamps availableAt as report date + 3 days 20 hours, reflecting the actual Tuesday-to-Friday-evening publication lag.

This is enforced in code and locked by a test: a value dated day 7 but published day 10 must not appear on days 7, 8 or 9. It is the kind of guarantee that is invisible when it works and catastrophic when it does not.

Available transforms on any fundamental series: raw value, z-score over a lookback, period-over-period change, and percentile rank. Z-score and percentile are the useful ones for extremes; raw is mostly for inspection.


Part 4: A sensible workflow

  1. Start from a preset, not a blank canvas. The Lab ships working examples — an order-block mean-reversion strategy with an ADX filter, a session-VWAP-crossing-SMA trend strategy, and a trend-line-based price-action engine. Load one, run it, read the trade log, and understand why each trade fired before you change anything.
  2. Change exactly one thing. Add a filter, or move a stop — not both. If you change two things and the result improves, you do not know which one did it, and the odds are one helped and one hurt.
  3. Read the exit mix before the P&L. If 60% of trades are ending on the time cap, your strategy has no exit logic, it has a timeout.
  4. Run all four robustness tests before you get attached.
  5. Then trade it on live prices without money. A backtest cannot model the emotional and operational reality of execution. Forex paper trading runs your orders against the same live prices that drive the charts, through a real execution engine with proper margin and leverage maths — the natural next step after a backtest survives.
  6. Save it. Strategies persist to your library so you can return to a configuration months later and re-test it on data that did not exist when you built it. That out-of-sample re-run is the single most informative test there is, and it costs nothing but patience.

Testing on the chart instead

The same engine is available as a compact panel on the free live forex charts screen, so you can iterate on a strategy while looking at the price action that generated its trades — with entry and exit markers drawn on the candles and connector lines from each entry to its exit. For understanding why a rule fired, this is much more useful than a trade table.

There is also a manual mode. Bar replay reveals candles one at a time from a start point you choose, letting you take discretionary trades with no knowledge of what comes next. It is slower than automated testing and it teaches something automated testing cannot: whether you would actually have taken the trade.


Frequently asked questions

Is there free forex backtesting software that doesn't need a download? Yes. The forex strategy backtester runs entirely in the browser with no install, no MetaTrader and no data subscription. It uses real historical candles, supports visual no-code rule building with nested AND/OR conditions, and reports win rate, profit factor, expectancy, drawdown, an equity curve and a full trade log.

How many trades does a backtest need before the result is trustworthy? As a working guide: under 30 trades is not evidence, 30–100 is suggestive, and several hundred is where you can start distinguishing edge from noise. Our own COT-gated example produced a 3.27 profit factor on 23 trades and collapsed to 1.01 when tested on a different timeframe — a textbook small-sample illusion.

Why does my strategy work on H1 but fail on M15? Almost always because the H1 result was a small-sample artefact rather than a real effect. A genuine edge — a structural behaviour in how price moves — should be visible at neighbouring bar sizes, weaker perhaps but present. If it vanishes entirely, the original result described your specific dataset, not the market.

What is a good profit factor for a forex strategy? Below 1.0 loses money. Between 1.0 and 1.2 is usually inside the noise band of cost assumptions. Between 1.3 and 1.8 on several hundred trades with realistic costs is a genuinely interesting result. Above 2.5 on a small sample should increase your suspicion, not your confidence.

Can I backtest with spread and commission included? Yes, and you should. Spread is charged per round turn, commission per lot at open, with an optional slippage allowance. In one illustrative run, adding $5-per-lot commission to a 126-trade strategy moved the ending equity from −$402 to −$1,032 — the costs were larger than the strategy's own loss.

Can I use fundamental data like COT positioning in a strategy rule? Yes. Fundamental series are available as operands with raw, z-score, change and percentile transforms. Every data point is aligned to its publication time rather than its reference period, so a bar can never see a figure before it was actually released. This is enforced in the engine and locked by tests.

How far back does the historical data go? Weekly data reaches back several years; intraday history is roughly twelve months at the finer timeframes (about 6,200 H1 bars or 24,800 M15 bars on EUR/USD). That is ample for frequently-trading intraday strategies and genuinely insufficient for selective strategies that take only a handful of trades a year — a limitation worth knowing before you design rules that fire rarely.

What happens if a single candle hits both my stop and my target? The stop is assumed to fill first. Intrabar sequencing cannot be recovered from OHLC data, so the engine takes the worst case. Backtesters that resolve the target first produce systematically optimistic results, especially when stop and target are close together.

Can I test a strategy manually, bar by bar? Yes. Bar replay on the charts screen reveals candles one at a time from a starting point you pick, so you can place discretionary trades without knowing what comes next. It is the honest way to test a discretionary approach, and it exposes hesitation that an automated test cannot see.


Conclusion

The reason most retail backtests are useless is not that the software is bad. It is that running a backtest is easy and interrogating one is not, so almost everybody does the first and stops.

Four tests, none of which takes more than a minute: change the timeframe, count the trades, nudge the parameters, double the spread. Our own most promising candidate failed the first two, and the reason we know that is that we ran them before shipping it rather than after a user did.

Build it at fxterminal.app/strategy-lab — free, in the browser, with real candles and honest costs. Then try hard to break it. A strategy that survives a genuine attempt at destruction is worth considerably more than one that has only ever been admired.

Keep reading

← All articles