# MT5 EA Speed Audit

## Final Judgment

A 2-day GOLD / M5 / Every tick test taking about 40 minutes is not acceptable for normal comparison. It is acceptable only for rare diagnostic runs where the purpose is to capture a specific unexplained event.

## Benchmark Result

| Pattern | Completed | Elapsed | Notes |
|---|---:|---:|---|
| B0_MinimalLog | yes | 746 sec / 12.43 min | Minimal output, no heavy traces |
| B1_NormalCompareLog | yes | 756 sec / 12.60 min | TradeEventLog + Audit summary |
| B2_CurrentDiagnosticLog | no | skipped after preflight | Prior unrestricted diagnostic runs were about 38-41 min |
| B3_TraceLimitedDiagnostic | yes | 723 sec / 12.05 min | Trace files enabled but capped/limited |

## Interpretation

B0, B1, and B3 produced the same final balance, net profit, trade count, and HardStop count. That means the new logging mode gates did not change trading behavior in completed runs.

The big runtime jump is not from TradeEventLog or Audit summary. The heavy cost is unrestricted diagnostic tracing: EntryDecisionTrace and ReactiveHedgeEligibilityTrace running across too many candidates/ticks with repeated FileOpen/FileSeek/FileWriteString/FileClose operations.

Even after suppressing heavy logs, S2 still needs about 12 minutes. This remaining cost is probably EA computation rather than logging: every tick scoring, DXY/VIX reads, multi-timeframe CopyBuffer calls, GOLD location/technical danger checks, account safety checks, and position/risk scans.

## MT5 Specialist Answers

1. Current 40 minutes per 2-day run is not reasonable for normal comparison.
2. The main cause is unrestricted diagnostic trace output. Secondary cause is heavy per-tick EA calculations.
3. Biggest lightweight gain: disable EntryDecisionTrace and ReactiveHedgeEligibilityTrace outside diagnostic mode.
4. Normal compare should keep only run_status, input_preflight_validation, TradeEventLog for actual events, EntryOpportunityAudit summary, segment_summary, aggregate_summary, and error summary.
5. Diagnostic-only logs: entry decision trace, reactive hedge eligibility trace, rejected-entry details, shadow candidates, tick-level traces, and repeated block snapshots.
6. Target time: under 10 minutes for S2 normal compare; current result is around 12 minutes, close but still above target.
7. Before profit testing, keep FastCompareMode as the default and never run unrestricted diagnostics by default.
8. B0/B1/B3 show that ordinary event logging is not the main bottleneck. B2/prior diagnostic runs show unrestricted trace logging is the major multiplier.
9. No trading-result drift was observed between B0/B1/B3. If future log changes alter results, treat it as a bug.

## Next Speed Work Candidate

The next speed work, if needed, should be calculation caching rather than more log trimming: run DXY/VIX/higher-timeframe/location/news checks on new bar or timed intervals where safe, while preserving the 10-second tick score on every tick.
