Asynchronous web requests for MetaTrader

I am trying to find out if it is possible to create a custom indicator for MetaTrader that can make asynchronous internet requests to send data to a server with a PHP interface.

These requests may take some time for the web server to process, so I fear that they will block the indicator from constantly updating new tick data if they are executed synchronously.

Are there any async libraries for MT4?

+3


source to share


1 answer


Yes there is

MT4 can directly use out-of-the-box bindings for an excellent platform-to-process exchange platform for processes, be it or . ZeroMQ

nanomsg

Using the previous one for several years, processes can form unsynchronized (i.e. regardless of the arrival aka or less accurately also called " ") β†’ or β†’ inter-process communication solutions that allow you to create powerful advanced GUI services for professional trading and many other functions for soft real-time systems and low-intensity HFT clustering. MQL4

aMarketEVENT

quote

tick

ExpertAdvisor

script

script

script

Alternatively, one can equip MT4 EA

several indispensable services using the same messaging platform:

  • add interactive remote for CLI to run EA keyboard

  • add remote (non-blocking (!!)) for HFT services file-IO

  • add remote / centralized service for (non-blocking) logging syslog

  • add remote / cluster AI / ML models in real time for advanced trading GPU-based

Nota bene



From a design / architecture point of view, the indicator indicator MT4

has certain limitations that you should be aware of.

Otherwise, a general in- process publishing to a remote WebServer will certainly take much more than a few tens of milliseconds, which causes an unacceptable problem for the above formal architecture. POST

php

jasuk.neumannova@gmail.com?Subject=StackOverflow-HFT-27078423 (MQL4)

to minimize the entire -element part of processing to avoid overshooting the next , to prevent skew in the synchronism of the calculated values. MT4.CustomIndicator

aMarketEVENT

This can be achieved by sending all the non-core functionality "out" of the code space MT4.CustomIndicator

(using the framework communication) and solving all the rest of the logic in a different thread, out . Post-processing is the least of these problems, the logic of correcting the link and values ​​and relaying the values ​​is the focus of unloading from a very fragile thread-synchronicity ZeroMQ

MT4

MT4

(You might have noticed that this issue has gotten bigger and more dangerous in recent builds. Many robust advanced GUI solutions are starting to suffer from erratic response in Builds post 7xx and require a little adaptation of their main control loops in real time to restore their resistance to custom interface and their smooth adaptation to the user interface under heavy loads)

Feel free to ask for more information about this MQL4 or HFT or other subjects.

+8


source







All Articles