Interaction between mql4 and Python

 

Hi everybody!
This is my very first message on this board, so I thank you in advance for the help you will kindly provide me with.


I would like to have some hints about the best way to make mql4 interact with external programs, written in a different language as it may be Python.

The task I'd like to accomplish is to send informations from mql4 program to an external Python program, which would make its stuff and send back informations to the first mql4 program.

I am programming on Windows environment.


I'm asking this because, as far as I undestand, mql is a very nice programming language but it may be "dumb" if used for "strong" calculation.

I clarify that, for my background, I am very familiar C, C++, Python and others. I am new to mql though.


Many thanks in advance.

 
vaeVictis: I would like to have some hints about the best way to make mql4 interact with external programs,

Best way is don't. You know C/C++ then you know most of MTx.

 
vaeVictis:

Interaction between mql4 and Python

1) I use python for automation of command line optimization for MT5. I like python for automation. It's better than batch files.

Inputs are CSV and XML files.

2) "but it may be 'dumb' if used for 'strong' calculation."

That has not been my experience . . . yet.

 
Anthony Garot:

1) I use python for automation of command line optimization for MT5. I like python for automation. It's better than batch files.

Inputs are CSV and XML files.

2) "but it may be 'dumb' if used for 'strong' calculation."

That has not been my experience . . . yet.


Many thanks for your answer.


About 1)
Could you please explain further details about automation?
Is it possible to set EA parameters by an external program? And also modify the parameters of an EA which is running?


About 2)

I see that I badly explained myself. Sorry.

What I meant is that other languages, like Python, provide the user with several high level library and modules already coded. An example may be numpy or scikit.

As far as I understand, it is not the same for mql. 

From this point of view I am considering to make mql an Python work togheter.

This being said, I am looking for the best way to make an EA communicate with an external program.
To accomplish this task, I would like to avoid CSV, XML and similia.

 
vaeVictis:


About 1)
Could you please explain further details about automation?
Is it possible to set EA parameters by an external program? And also modify the parameters of an EA which is running?

Look here:

https://www.mql5.com/en/forum/127577

and here:

https://www.metatrader5.com/en/terminal/help/start_advanced/start

(under the Tester section)

 
You could use ZeroMq. If you google for ZeroMQ - How To Interface Python/R with MetaTrader 4 you will find examples.
 

@Anthony Garot and @aslkdjf

Many thanks for your hints.

I'll take a look and give you a feedback :)