Skip to content

MQL5: fix stale .ex5 and add timer-based command polling#1

Open
biohazardxxx wants to merge 2 commits intodevfrom
fix/mql5-timer-based-command-polling
Open

MQL5: fix stale .ex5 and add timer-based command polling#1
biohazardxxx wants to merge 2 commits intodevfrom
fix/mql5-timer-based-command-polling

Conversation

@biohazardxxx
Copy link
Owner

Summary

  • Fix unresolved DLL import error: The compiled MtApi5.ex5 was stale and still referenced removed DLL functions (getIntValue, getDoubleValue, etc.) from MT5Connector.dll. Recompiled to match the current source which uses the JSON payload-based protocol (getPayload).
  • Add timer-based command polling for live trading: Previously OnTimer()/executeCommand() was only called from OnTick() during backtesting. In live mode, commands from the .NET client would queue up until the next market tick, making the EA unresponsive on low-volume symbols or outside market hours. Now uses EventSetMillisecondTimer(100) in live mode.

Test plan

  • Load MtApi5.ex5 in MetaTrader 5 — verify no "unresolved import function call" errors
  • Connect .NET client and verify commands are processed promptly in live trading mode
  • Verify backtesting still works correctly (no timer, tick-driven as before)

🤖 Generated with Claude Code

biohazardxxx and others added 2 commits February 19, 2026 16:18
OnTimer() (which drains the command queue via executeCommand()) was only
called from OnTick() during backtesting. In live trading, commands from
the .NET client would queue up and never be processed until the next
market tick arrived, making the EA unresponsive on low-volume symbols
or outside market hours.

- Add EventSetMillisecondTimer(100) in init() for live trading mode
- Call OnTimer() on every tick regardless of mode (supplements the timer)
- Add EventKillTimer() in deinit() for cleanup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The .ex5 binary was stale and still referenced removed DLL imports
(getIntValue, getDoubleValue, etc.) that no longer exist in
MT5Connector.dll since the migration to the JSON payload-based
protocol (getPayload). This caused "unresolved import function call"
errors when loading the EA in MetaTrader.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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