I have a simple test.py
script that I would like to run from an MQL4 EA.
How can I implement this?
I have tried using ShellExecute()
but that will not work in my case as I am running MetaTrader4 Terminal on a linux machine and thus cannot call windows based ShellExecute()
( even with a wine
).
Option 0: use of a
wine
-promise to have a full DLL-abstractionThe
wine
project, if configured properly, ought provide a full DLL-abstraction, so that a legitimateShellExecute()
ought provide a way to launch a wine-enveloped MetaTrader4 Terminal a launch of such intended process.Option 1: use a distributed processing { ZeroMQ | nanomsg }
Given this option feasible since ZeroMQ v2.11, the python was always ready to communicate with MQL4 and start/stop any service provisioning on-
{MQL4|*}
-demand. This would be my preferred way, as the workflow is not isolated to just "fire-and-forget" missile-control.Using this architecture many years for AI/ML-predictor Predictive Engine, Remote Keyboards, off-site centralised smart-logging, process-health/performance-telemetry services integration ( not only with MQL4-code execution-units ) and remaining happy all the years for having chosen this advanced distributed architecture way.
Nota Bene: It is fair to note, that somewhere around an MQL4 Build 850 / 900 MetaTrader4 Terminal code-execution engine revision has created a few dozens headbang issues for DLL-wrapper / original ZeroMQ v2.11 wrapper, but some moderate amount of efforts made the New-
MQL4.56789
change ofstring
, which stopped to bestring
anymore ( being surprisingly a re-dressedstruct
), but in most high-performance processing interactions are bit-packed, so no heart-breaks ought appear from this.Python side:
MQL4 side: