Quantcast
Channel: Active questions tagged zeromq - Stack Overflow
Viewing all articles
Browse latest Browse all 193

How can someone send data from MetaTrader 4/5 Terminal to external server?

$
0
0

this is somehow intended to (maybe) be(come) a guideline post in terms of MetaTrader 4/5 and its corresponding language MQL4 both set into context with sending data to external servers.

In my special case I am building a Django/Python based web application that will process FOREX trading data for further use.

Thus, I am in search for a proper solution to send data from the MetaTrader 4/5 Terminal to an external server periodically (e.g. every 60 seconds) formatted as json or csv (if possible). In particular, the data to be sent is the accounts trade history and the running + pending trades set.

After doing the research I basically found the following approaches:

1.) Using webrequest() in MQL4 wrapped in an expert advisor

As the official MQL4 docu suggests, the webrequest() function sends an http:// request to a specified server.
This is a related SO thread:
How to post from MetaTrader Terminal 5 MQL 5 a request to my nodejs server, which is running locally on my MT5 host?

and the official documentation:

https://docs.mql4.com/common/webrequest

This could be wrapped into an expert advisor to execute the request periodically on defined events given.

Which kind of data from the MT4/5 terminal can be populated into the data array?
How can that data be formatted? Is it possible to format it as json straight away or should that be done on the server-side?

2.) Using ZeroMQ

This is a setup I found in this thread: How to send a message in MQL4/5 from MetaTrader Terminal to python using ZeroMQ?

How would this be accomplished within the MetaTrader environment? Will this still be an expert advisor or some kind of DLL solution? What is the ZeroMQ's role within the setup?

What are the pros and cons compared to the webrequest() function?

3.) Others?

Are there any other possible approaches on achieving this like e.g. with APIs or MQL4 scripts?

Since this is a rare topic, I am loooking forward to any however small idea and input.


Viewing all articles
Browse latest Browse all 193

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>