MCP: Build 6140: tester_run_backtest ignores Report= in the tester .ini

 
Build 6140, Windows, portable install.

Running a backtest through the built-in MCP server works — tester_run_backtest returns a run_id, tester_get_status reports progress, and tester_get_report returns a shortsummary. But the Report= key in the tester .ini is ignored: no report file is written, and the "writing report" dialog at the end of backtest never appears.

The same .ini run through the command line writes the report normally:

    terminal64.exe /portable /config:C:\...\MQL5\Profiles\Tester\test.ini

Same file, same [Tester] section, only the launch method differs.

The .ini contains:
  • Report=harness_out\mcp-test
  • ReplaceReport=1
  • ShutdownTerminal=0
  • Optimization=0
Everything else in the .ini is honored — expert, symbol, period, model, dates, deposit — so the file is being read.  Also, the same *set file is being used.

What I'm after is the full report, specifically the Deals table. The JSON from tester_get_report is a useful summary, but it has no per-deal data, and get_trading_history_positions returns the live account rather than the tester's.

Questions:
  1. Is Report= expected to be ignored on MCP-launched runs?
  2. Is there another way to get the deals from a run started via MCP?
  3. If not, is a tester deals/history tool planned?


Thank you

 
jacek_mql:
What I'm after is the full report, specifically the Deals table.

The native Tester Report doesn't store all Deals data. You need a custom utility for that. Here is an example of a custom MQL5 Service that creates a profit by Deal entry hour backtest report containing a table and a bar chart (still not all Deals data but it shows how to access Deals):

Profit By Deal-Entry-In Per Hour Report for MT5 (unlike deal-entry-out in the native Tester Report)
Profit By Deal-Entry-In Per Hour Report for MT5 (unlike deal-entry-out in the native Tester Report)
  • 2026.08.12
  • www.mql5.com
As the MT5 Tester does not natively support reporting hourly profit and loss by deal-entry-in (only deal-entry-out), I created this MQL5 Service to to generate custom backtest reports limited to, and
 
Ryan L Johnson #:

The native Tester Report doesn't store all Deals data. You need a custom utility for that. Here is an example of a custom MQL5 Service that creates a profit by Deal entry hour backtest report containing a table and a bar chart (still not all Deals data but it shows how to access Deals):

Hi Ryan,

Thank you for your reply and the link.  I think that it may not work, as when backtests are run via MCP, the logs in Tester\logs and Tester\agent-..\logs are empty files.

Sorry, I jumped my guns.  Just checked those folders once more, and those files are there.  so, your file may work perfectly.  Still, I would love to have mt5 write the standard reports as if it would be run manually.  Hopefully, mql5 devs can do some magic here.

Profit By Deal-Entry-In Per Hour Report for MT5 (unlike deal-entry-out in the native Tester Report)
Profit By Deal-Entry-In Per Hour Report for MT5 (unlike deal-entry-out in the native Tester Report)
  • 2026.08.12
  • www.mql5.com
As the MT5 Tester does not natively support reporting hourly profit and loss by deal-entry-in (only deal-entry-out), I created this MQL5 Service to to generate custom backtest reports limited to, and
 
jacek_mql #:

Hi Ryan,

Thank you for your reply and the link.  I think that it may not work, as when backtests are run via MCP, the logs in Tester\logs and Tester\agent-..\logs are empty files.

Sorry, I jumped my guns.  Just checked those folders once more, and those files are there.  so, your file may work perfectly.  Still, I would love to have mt5 write the standard reports as if it would be run manually.  Hopefully, mql5 devs can do some magic here.

Yeah, it takes a bit of time for the folder and.xlsx file(s) to be created following a completed backtest.
 

Thanks for the clear write-up — this matches what several people are seeing on build 6140 with the built-in MCP server.

1. Is Report= expected to be ignored on MCP-launched runs?
Yes, currently it appears to be. When the tester is started via tester_run_backtest, the terminal runs the test and exposes results only through the MCP tools (tester_get_status / tester_get_report). The classic HTML report generation (and the “writing report” dialog) is skipped. The rest of the [Tester] section is still respected, which is why everything else works. This looks like intentional design for the MCP path rather than a pure bug, but MetaQuotes hasn’t published a formal statement on it yet.

2. Is there another way to get the deals from a run started via MCP?
Not cleanly at the moment.

  • tester_get_report only returns the short summary (no deal table).
  • get_trading_history_positions / history tools still point at the live account, not the tester context.
  • The tester journal sometimes contains deal lines, but parsing it is fragile and incomplete.

The practical workarounds right now are:

  • Launch the same .ini via command line (terminal64.exe /portable /config:...) when you need the full HTML report + Deals table.
  • Or keep using MCP for quick iteration/summary, then re-run the final configuration via CLI for the detailed report.

3. Is a tester deals/history tool planned?
No public roadmap has been shared. Given how new the built-in MCP is (and that build 6140 already added a few tester-related improvements), it’s reasonable to hope for a tester_get_deals / richer report tool in a later build, but nothing is confirmed.

Until then the most reliable way to get the full Deals table remains the classic command-line launch with Report= + ReplaceReport=1.

Would be useful if others can confirm whether they see the same behaviour on non-portable installs or on different builds.

Cheers.

 

Thank you Roki for the detailed reply. It validates what we are also seeing.

Also good to hear that MetaQuotes added more features to the tester group in build 6140.  Hopefully, this is a sign that they will be dedicating more time to the tester side.

I'm working on a Python harness that drives optimization and backtests from the command line. It parses the full report from every run and derives statistics that the summary alone can't provide — position-level grouping, holding-time distributions, and cross-run comparisons over dozens or hundreds of configurations at a time.

Starting to use what's available in the MT5 MCP already simplifies that and makes the harness more robust. But a fair amount of the analysis still isn't possible without the report.

MCP isn't a different use of the tester — it's the same backtesting, but better automated. Anyone driving the tester from a script or an AI agent needs the deal-level data more than an interactive user does, not less. The whole point is to analyze many runs without opening each one by hand, and to produce cross-test summaries rather than reading per-test results.

The MCP tester tools genuinely improve that automation. Being able to start a run and poll tester_get_status for live progress removes a lot of guesswork: no waiting on file appearance, no timeout guessing, no inferring whether a run started or died. That part is a real improvement and I'd rather build on it than around it. It just needs the report to come with it to make it on par with command line.

So I'd really like to see MetaQuotes bring MCP up to at least the same functionality the command line already provides. Even the limited set available today has had a real impact on the harness I'm building.

 
jacek_mql #:
[H]olding-time distributions...

holding

(https://www.metatrader5.com/en/terminal/help/algotrading/testing_report).

 
jacek_mql #:
Anyone driving the tester from a script or an AI agent needs the deal-level data more than an interactive user does, not less. The whole point is to analyze many runs without opening each one by hand, and to produce cross-test summaries rather than reading per-test results.

"Process tests finished before start must be set to true if you want to analyze preexisting backtests. Set it to false to analyze only future backtests...

Version 1.24 was posted here at 2:30pm on 09/02/2026 NY time. This upgraded version records chunks of backtest data in testing real time to support large amounts of data. I've successfully tested it on 1.5 gigabytes of log data, and an overnight backtest, separately."

(https://www.mql5.com/en/blogs/post/774010).