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

 
jacek_mql #:
[W]hen backtests are run via MCP, the logs in Tester\logs and Tester\agent-..\logs are empty files.

Whoa. That was unexpected.

As Alain subsequently replied, I'm sure that the MQ Developers will deem it a bug to be fixed.

 

Thank you Alain.  Looking forward to having it being addressed by MQ.

 
Two more .ini-related things from the same MCP path, in case they help
others. The first one is verifiable; the second I can only report, not
prove, and I say which is which.

1. THE RUN USES WHATEVER .SET FILE IT FINDS ON DISK, AS IS.

My first MCP-driven backtest silently started from an existing
<EAname>.set left in MQL5\Profiles\Tester from an earlier session. That
file still had a filter enabled which I had tested and rejected weeks
before, so the run measured a configuration I had not asked for.

Nothing in the MCP response says which parameter file was used, and the
report looks completely normal. I only noticed because the number of
operations did not match what I expected.

What I do now: state every parameter explicitly in the request instead of
letting it pick the file up, and ask the assistant to echo back the values
the tester actually applied. If the echo does not match the request, the
run is discarded.

2. CHECK THE LEVERAGE IN THE GENERATED .INI - reported, not proven.

On my first run the leverage in the generated .ini was not the one my
account uses, and margin during the test was therefore far more optimistic
than reality. I no longer have that file - it was overwritten by the
corrected run - so I am reporting this as something worth checking rather
than as a finding. If someone else sees the same thing with the file still
on disk, that would settle it.

It is worth checking because leverage decides margin, margin decides
whether the account is stopped out during the run, and none of that shows
up as an error anywhere: the report just comes out different.
 
Update on build 6182.

"Report=" is still ignored on MCP-launched runs. Nothing is written, and tester_get_report still returns the summary only - 42 fields, no deal table.

Two things did improve:

run_id is now returned as a quoted string rather than a bare JSON number. Above 2^53 that used to lose precision in any JavaScript client, so the MCP Inspector could not drive these tools at all. It can now.

get_tester_journal (new in 6180) reads both the main tester and the agent journals over MCP, with a substring filter and a time range. That turns out to be a usable workaround for the missing deals:

    filter "deal #" -> every execution, with time, side, volume, symbol, price and order id
    filter "received for order" -> the INFO[340036] line, which appears only when a position is created, so entries can be told from exits

Between those two you can reconstruct the deal sequence and group it into baskets without touching the filesystem. What is still missing per deal is profit, swap and commission - derivable from prices and the symbol spec, but not free.

So the data exists and is now reachable. It is a partial workaround rather than a fix - profit, swap and commission are still missing per deal.

Honoring Report= on MCP-launched runs, writing the same report the command line produces, would still be worth doing. The report carries a richer dataset than the journal: per-deal profit, swap, commission and balance, the orders table, the full input list, and history quality, some pngs. Reconstructing those from journal lines is possible for some and guesswork for others.