Skip to content

EA correctness fixes + group-state persistence (removes roadmap, executes it)#12

Merged
codedpro merged 1 commit into
mainfrom
execute-fixes
Jul 6, 2026
Merged

EA correctness fixes + group-state persistence (removes roadmap, executes it)#12
codedpro merged 1 commit into
mainfrom
execute-fixes

Conversation

@codedpro

@codedpro codedpro commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Executes the audited bug list directly and removes the roadmap doc.

EA / API fixes

  • MaxSpreadPips enforced — reject new orders when live spread exceeds it (0 disables; pip = 10 points on 5/3-digit symbols, 1 otherwise).
  • MaxPositions counts pending orders too (default 10 → 50) — a burst of pending split orders can no longer exceed the cap unseen.
  • Daily-loss resets at broker midnight (iTime D1), not the server's UTC day.
  • partial_close_percent removed end to end (was forwarded and ignored).
  • Group state persisted to disk (MQL5/Files/split_groups_<magic>_<login>.csv) on every change, reloaded and reconciled against live orders on restart — survives broker comment rewrites and restores the real level count. Comment-based recovery stays as the fallback.

Also

  • Fixed a flaky correlation test (caller timeout was shorter than the fake-EA serve window → abandon-cascade). Now 6/6 across reruns.
  • README/config updated; roadmap doc removed per request.

Verification

  • MetaEditor compile 0 errors / 0 warnings (Wine /portable; CI recompiles on Windows)
  • 12/12 pytest pass locally, correlation test deterministic across reruns

Compile/unit verified only — demo-test before live use. The 9 roadmap issues I filed earlier can't be closed by this token; close them in the UI if you want them gone.

🤖 Generated with Claude Code

…nfig

Executes the audited bug list directly (roadmap doc removed):
- MaxSpreadPips is now enforced: reject new orders when the live spread exceeds
  it (0 disables). Pip = 10 points on 5/3-digit symbols, 1 point otherwise.
- MaxPositions now counts open positions AND pending orders (default raised
  10 -> 50), so a burst of pending split orders can't blow past the cap.
- Daily-loss window follows broker midnight (iTime D1) instead of the server's
  UTC day, so offset-timezone brokers reset at the right moment.
- partial_close_percent removed from the API model, command dict, and config
  (it was forwarded to the EA and ignored end to end).
- Split-group state is persisted to MQL5/Files/split_groups_<magic>_<login>.csv
  on every change and reloaded on restart, reconciled against live orders. This
  restores the real level count and survives brokers that rewrite comments;
  comment-based recovery remains the fallback when no state file exists.

Also fixes a genuinely flaky test: the envelope-correlation test used a caller
timeout (5s) shorter than the fake-EA serve deadline (8s), so a transient
scheduling hiccup abandoned a command permanently and failed the assertion.
Callers now outlast the serve window.

Verified: MetaEditor compile 0 errors/0 warnings (Wine /portable); 12/12 tests
pass (correlation test 6/6 across reruns). Runtime behavior still needs a
demo-account pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codedpro codedpro merged commit 5b9a96f into main Jul 6, 2026
4 checks passed
@codedpro codedpro deleted the execute-fixes branch July 6, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant