Calling the Metatrader MQL4 / MQL5 Function from the Imported DLL

I would like to call an MQL4 or MQL5 function from my own imported DLL in Metatrader.

Is it possible?

+4
source share
3 answers

forest,

As far as I have experienced working with MetaTrader over the past two years, there is no real way to call MQL functions from an external DLL. But there are some user APIs that are very similar to what you want to achieve:

API MT4

Java / .Net MetaTrader β„’ API

These APIs allow you to use the MQL functionality out of the box.

+5
source

Principle

After several hundred man-years in the FX domain, there is another approach to organizing MT4 Terminal's smooth and elegant collaboration with other processes than trying to push water up the hill or pay USD500 + per set, which will stop working immediately after the next hit, as soon as Build 524-> Build 562-> Build 586-> Build 600-> Build 609-> Build 624 β†’ ... moves again

Toy carrier

Yes, the MT4 architecture does not provide its own interface to allow itself to be β€œviolated” by an undefined obligation to handle external low-level calls through DLLs and others.

How to fix it

However, you can undo the architecture and make MT4 Terminal a lighter thin client working with an intelligent message library through which MT4 functions will be displayed for a remote call (RPC).

Example

This way, Python Node can collect MT4 data for digital processing,

in the same way a PHP Node can handle remote-syslog-s in parallel,

just like C++ Node can integrate another task,

like another Python Node, it can act as a CLI terminal interface with a user-defined scripting syntax language to control MetaTrader actions via the / stdio command line

simple - regardless of the needs of your application infrastructure, you can do it

(You can even improve the poor real-time capabilities of MT4 native streams to get much better real-time predictability and small-sized parallel architecture with low latency .. and still be safer, protected from a torpedo from any next "new" -MQL4)

nota bene: just to present an invisible threat, a headgear collision in the β€œnew” - MQL4.56789 , among others, string , being the syntax suggested as a string, is actually not a string , but a struct , and all your previous ones DLL-related jobs just need to be reprocessed and wrapped -around to emulate a string structure or a new DLL interface should be designed for cases that return a value to the buffered ArrayOfBYTEs that the MQL4.56789 side can receive and process, but which it can't free about n owns and memory leak.

+1
source

If it is acceptable for your DLL to be a .NET DLL, then you can try this MT4.NET integration library called NQuotes.

In this library you can access any MQL4 function from your DLL.

0
source

All Articles