You have to allow external addresses in MetaTrader's settings in order for it to be able to connect to external hosts via sockets or web requests.
Network functions
MQL5 programs can exchange data with remote servers, as well as send push notifications, emails and data via FTP.
- The Socket* group of functions allows establishing a TCP connection (including a secure TLS) with a remote host via system sockets. The operation principle is simple: create a socket, connect to the server and start reading and writing data.
- The WebRequest function is designed to work with web resources and allows sending HTTP requests (including GET and POST) easily.
- SendFTP, SendMail and SendNotification are more simple functions for sending files, emails and mobile notifications.
For end-user security, the list of allowed IP addresses is implemented on the client terminal side. The list contains IP addresses the MQL5 program is allowed to connect to via the Socket* and WebRequest functions. For example, if the program needs to connect to https://www.someserver.com, this address should be explicitly indicated by a terminal user in the list. An address cannot be added programmatically.
- www.mql5.com
You have to allow external addresses in MetaTrader's settings in order for it to be able to connect to external hosts via sockets or web requests.
Thank you so much for your reply. I am using mql4 language and the document you just have send is for mql5 languages. Does this matter ?
The same conditions apply to MQL4 for Webrequest, but not for DLL calls for networking. So your problem is therefore something else. Maybe firewall settings?
The same conditions apply to MQL4 for Webrequest, but not for DLL calls for networking. So your problem is therefore something else. Maybe firewall settings?
IP address which I am using to send and receive data is an IP of a website. Do I need to open port on that server? I am using 5559 port which is not well known port.
I suggest you ask the ZeroMQ community. This is not a MetaTrader or MQL related issue, so you are asking in the wrong place.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello there
I am using zmq in my copy trading project. More precisely I am using Pub and Sub pattern for sending trades signal. I have tested zmq on localhost but facing problem to make it online.
I am not have much knowledge of networking. In zmq website they said about replace localhost with TCP IP address to make the whole thing online. In localhost testing I am using "tcp://localhost:5559" on subscriber side and "tcp://*:5559" on publisher side. When I replace localhost with IP address noting works.
I am not sure what is the issue. Someone can please help me.