Backtest MT4 / MT5 strategies free in your browser
A backtest runs a set of trading rules over past prices to see how they would have traded, how much they would have made and how deep the drawdowns would have gone. Backtests in the EA Workshop run in your browser, and you build the rules from indicator blocks without code; a strategy you're happy with exports straight to an MT4 / MT5 EA.
How the backtest works
Indicators that match MT5
All 35 indicators are calculated the way MT5's built-in indicators are: ATR is a simple average of true range, and the MACD signal line is a simple average too. The exported EA calls those same built-ins, so the backtest and live trading see the same numbers.
No look-ahead
Signals use closed bars only and fill at the next bar's open. On random-walk data the median profit factor after costs is about 0.88, which shows the backtest doesn't use future data.
Realistic fills and costs
Bar prices are Bid prices: buys fill at Ask (Bid plus that bar's spread) and sells at Bid. Commission is charged on entry and on exit; swap is applied each time a position crosses server midnight, triple on Wednesday night.
Stops, targets and gaps inside a bar
Stops and targets are checked along open → low → high → close for an up bar and open → high → low → close for a down bar; a gap through the level at the open fills at the open. Trailing stops move at each new bar's open.
Margin and stop-out
Leverage runs from 1:1 to 1:5000. Without enough margin the entry signal is skipped; when equity falls to the stop-out level (50% of margin by default) the position closes at that price, as a broker would close it.
Your data stays in your browser
Use the site's data for the major forex pairs, gold and silver, or export your own broker's data (M1 to D1) from MT4 / MT5 with our script and import it. Backtests run in your browser, and imported data is never uploaded.
What the report shows
The backtest report lists about 25 statistics, including net profit, profit factor, max drawdown, win rate, Sharpe ratio, return / drawdown, max consecutive losses and longest stagnation, with an equity curve and drawdown chart, a trade list, profit by weekday and by hour, and a monthly profit table.
After the backtest: rule out overfitting
A beautiful backtest curve may only mean the rules happen to fit that stretch of history. The workshop offers five tests to judge whether a strategy is really robust:
- 1
Out-of-sample test
Hold back the last stretch of data from tuning and see whether the strategy still makes money on prices it has never seen.
- 2
Optimization
Backtest the main parameter across a range of values and see whether the results form a stable plateau or one isolated peak.
- 3
Walk-forward analysis
Optimize on one stretch of data, test on the stretch right after it, then roll the whole window forward, the way you would re-tune a live strategy.
- 4
Monte Carlo test
Shuffle the trade order and nudge prices and costs at random to see the range where max drawdown and returns could land.
- 5
Multi-market test
Backtest the same rules on other symbols and timeframes to see whether they only suit one market.
FAQ
Is the online backtester free?
Backtesting, automatic strategy generation and robustness tests are free, with no sign-up. Sign up and verify your email to export EAs for 5 single strategies for free; unlimited exports need Pro.
Do the results match the MT5 strategy tester?
Very close. Compared trade by trade with the MT5 strategy tester in “1 minute OHLC” mode on the same data, almost every trade enters on the same bar with a fill price within the spread; the few bars that touch both the stop and the target can differ.
Do I need to code to backtest?
No. You build rules from indicator blocks, and each one reads as a plain sentence, such as “RSI crosses above 30”. When you're happy with the backtest, the workshop generates a complete MQL source file that you compile in MetaEditor.
If a backtest makes money, will live trading?
No. A backtest only shows how the rules did on past data. Rule out overfitting with out-of-sample, walk-forward and Monte Carlo tests, then run the strategy on a demo account for a while. Trading carries a risk of loss.
Risk warning: forex, CFDs, options, futures and crypto assets usually involve leverage or high volatility, and you can lose more than you put in. This lesson only teaches the concepts; all numbers are for illustration and are not investment advice.