MT4 Backtest Not Working: Strategy Tester Causes and Fixes

MT4 and MQL4 technical notes eyecatch image with a degu mascot, code panel, and trading chart background
Advertisement

When an MT4 backtest does not work, the problem is not always inside the EA code. In many cases, the Strategy Tester is using the wrong symbol, timeframe, date range, spread, historical data, or optimization settings.

This guide explains common reasons why MT4 Strategy Tester does not start, produces no trades, shows no useful result, or stops during optimization. Use it as a checklist before analyzing the backtest report in another tool.

Quick answer:
If an MT4 backtest is not working, check the Strategy Tester settings first: symbol, timeframe, model, date range, historical data, spread, EA inputs, and the Journal and Experts tabs. Many “no trade” cases are caused by settings or entry conditions that never become true, not by a broken EA.

Common Reasons Why MT4 Backtesting Does Not Work

SymptomCommon CauseWhat to Check First
The test does not startMissing data, invalid EA setting, or initialization errorJournal tab and Experts tab
No trades are openedEntry conditions never trigger or the wrong test settings are usedSymbol, timeframe, spread, date range, and EA filters
The result looks emptyNo trades, too short a test period, or no valid historyReport tab, date range, and history center data
Optimization does not progressToo many combinations, invalid input ranges, or initialization failuresOptimization ranges and log messages
Results change unexpectedlyHistorical data, spread, modeling method, or broker data changedData source, model, spread, and test period

No Trades in Strategy Tester

A backtest can run normally but still produce zero trades. This usually means that the EA did not find any valid entry condition during the test period.

Check these points first:

  • The selected symbol matches the EA’s intended symbol.
  • The selected timeframe matches the EA logic.
  • The test period includes enough historical data.
  • The spread is not too high for the EA’s spread filter.
  • The lot size, Magic Number, and input parameters are valid.
  • Time filters, indicator filters, and volatility filters are not blocking every trade.
Tip:
Add temporary Print() messages around the entry conditions. If the EA never reaches the final entry block, the problem is usually a condition filter, not OrderSend() itself.
Print("Spread=", MarketInfo(Symbol(), MODE_SPREAD));
Print("Hour=", Hour(), " EntrySignal=", entrySignal);
Print("Lots=", Lots, " UseTrading=", UseTrading);

Wrong Symbol, Timeframe or Date Range

The Strategy Tester must match the assumptions used by the EA. A moving-average EA designed for EURUSD H1 may not trade if you test it on another symbol or a much shorter timeframe.

SettingCommon MistakeFix
SymbolTesting a different pair from the EA’s target pairSelect the symbol used by the strategy
TimeframeRunning M5 when the EA was designed for H1Use the timeframe assumed by the EA
Date rangeTesting a period with little or no historyExtend the test period or import historical data
Visual modeAssuming the EA is frozen without watching the chartUse visual mode to confirm price movement and signals

Missing or Poor Historical Data

If MT4 does not have enough historical data for the selected symbol and date range, the Strategy Tester may not run correctly or may show messages such as TestGenerator: no history data in the Journal.

Historical data problems can cause:

  • No test starts for the selected period.
  • The backtest starts from a later date than expected.
  • Modeling quality becomes poor.
  • Results change after downloading or replacing history files.
Data check:
Open the chart for the target symbol and timeframe, scroll back to load history, and confirm that the period you want to test exists. If you need higher-quality data, prepare a separate historical data workflow before trusting the result.

If the problem is related to historical data, the next step is to prepare more reliable data before running another test. Poor data can make the test fail, start from the wrong date, or produce results that are difficult to trust.

Spread, Tick Model and Test Settings

Even when the EA and data are correct, Strategy Tester settings can change the result or prevent trades from opening.

SettingWhy It Matters
ModelFor many EA tests, “Every tick” is more appropriate than open prices only, especially if the EA uses intrabar conditions.
SpreadIf the spread is too wide, a spread filter may block every entry.
Use dateIf the selected range has no data or is too short, the report may be empty.
OptimizationIf optimization is enabled unintentionally, MT4 may run parameter passes instead of a normal single test.

If the EA has a spread filter, print the current spread during testing. For 5-digit brokers, remember that points and pips are not the same.

EA Conditions That Never Trigger

A backtest with zero trades is often a valid result: the EA simply did not see a market condition that matched its rules. This can happen when the strategy is too strict or when multiple filters are combined.

Typical blockers include:

  • Indicator conditions that never align.
  • Time filters that exclude the whole test period.
  • Spread filters that are too strict.
  • Lot size or margin filters that stop entries.
  • One-position-only logic that never resets correctly.
  • External files or global variables that are missing in the tester environment.

When debugging, do not only print the final entry result. Print each important condition separately so you can see which condition is blocking the trade.

Print("maCondition=", maCondition);
Print("timeCondition=", timeCondition);
Print("spreadCondition=", spreadCondition);
Print("lotCondition=", lotCondition);

Optimization Does Not Start or Stops Unexpectedly

Optimization problems are slightly different from normal backtest problems. A single test may work, but optimization may produce zero trades, skip many passes, or stop with initialization errors.

Check the following:

  • Input parameter ranges are not too wide.
  • Step values are not zero or invalid.
  • Minimum values are lower than maximum values.
  • The EA does not depend on chart objects that are missing in Strategy Tester.
  • OnInit() or init() does not return an error for some parameter combinations.
  • External files are available inside the tester environment.
Optimization warning:
If many passes show zero trades, do not assume the EA is broken immediately. First reduce the parameter range and run one normal backtest with a known valid setting.

How to Check the Journal and Experts Tabs

The fastest way to find the cause is to read the Strategy Tester logs. In MT4, the Journal and Experts tabs often show the real reason why the test failed or why an order was not opened.

Message TypeWhat It May Mean
no history dataThe selected test period does not have enough historical data.
initialization failedThe EA failed during initialization, often because of invalid inputs or missing resources.
OrderSend errorThe EA tried to trade, but the order request was rejected.
No order messages at allThe EA may never reach the entry block.

If an OrderSend error appears, check the exact error number. For example, invalid price, invalid stops, invalid lot size, or not enough money all require different fixes.

When to Analyze Results with Quant Analyzer

Quant Analyzer is useful after you have a valid MT4 backtest report. Before using it, make sure the test actually ran, trades were generated, the date range is correct, and the result is not based on missing or unreliable data.

A good workflow is:

  1. Fix Strategy Tester settings and data problems.
  2. Confirm that the EA opens and closes trades as expected.
  3. Export the MT4 backtest report.
  4. Load the report into Quant Analyzer.
  5. Review weak hours, weak months, large losing trades, and drawdown concentration.
Before analysis:
Do not analyze an empty or invalid report. If the Strategy Tester produced no trades or used poor historical data, fix that first. Quant Analyzer is for understanding valid backtest results, not for repairing a broken test.

Summary

  • MT4 backtests often fail because of settings, data, EA conditions, or initialization errors.
  • If there are no trades, check symbol, timeframe, date range, spread, and EA filters first.
  • Missing historical data can cause empty or misleading results.
  • Optimization failures often come from invalid input ranges or initialization problems.
  • The Journal and Experts tabs are the fastest places to find the actual cause.
  • Use Quant Analyzer only after you have a valid MT4 backtest report.

Related MT4 Backtesting Guides

Back to MT4/MQL4 Technical Notes

タイトルとURLをコピーしました