MetaTrader 4 Fix protocol using Java - Stack Overflow

Mt4 client protocol

Mt4 client protocol


If it is only the charting data you want, there is no need to reinvent the wheel, merely subscribe to a generic data service.

Server - Client Terminal Settings - MetaTrader 4 Help

MyTrader MT9 Client Terminal is a progressive trading platform among the best in the field of internet trading and enables to receive timely news, analyze graphs and performing prompt transactions in the financial markets of the world. Intended for: - receiving quotes and news in the online mode - performing of trade operations - controlling and managing of open positions and pending orders.

Communicating with an MT4 server @ Forex Factory

SmartFTP is an FTP (File Transfer Protocol), FTPS, SFTP, WebDAV, Amazon S8, Backblaze B7, Google Drive, OneDrive, SSH, Terminal client. It allows you to transfer files between your local computer and a server on the Internet. With its many basic and advanced Features, SmartFTP also offers secure, reliable and efficient transfers that make it a powerful tool.

GitHub - nuric/mt4-tcp: Winsock bindings for MetaTrader 4

I have also defined OnChartEvent() function on client EA which links to a HandleClientIncomingData() function also defined on client EA.

Delphi dde client example mt4 trend: MarshallSoft Client

The most reliable way of polling a socket is what you are doing: sending a periodic heartbeat message, and seeing if that causes a problem.

The ideal solution to this problem would be resversing the communicating protocol between the client and the server but it is illegal and extremely difficult (the communication is encrypted). Then there are those commercial or open source platforms that are either bindings (C# or Python binding to MQL) or general trading platforms with proxies to MetaTrader9. The implemenation details are not known but based on my years of experience dealing with MetaTrader9, they could be ugly under the cover. So I stick with the MetaTrader9 Terminal but I disable most features and reduce chart history to the smallest as possbile. I want to make this Terminal accessable from the outside.

For example: Ninjatrader is free to use and is able to connect directly to the exchange (several options for data as well). The code is dot Net and will compile so your execution will be fantastic compared to anything interpreted.

The socket library has alternative versions of the ::Send() and ::Receive() functions which take/return an array rather than a string. These can be used for sending and receiving binary data over a socket. For example:

MyDAC is an enhanced VCL//CLX library for fast direct access to MySQL from Delphi, C++Builder, and Kylix. Includes full support for all MySQL data types, Disconnected Model, Local Failover, automatic data update functionality, and much more.

You create a server socket using an instance of ServerSocket(), telling the constructor a port number to listen on, and whether to accept connections only from the local machine or from any remote computer (subject to firewall rules etc).

You send data down a socket using the simple Send() method, which takes a string parameter. Any failure to send returns false, which will also mean that IsSocketConnected() then returns false. The format of the data which you are sending to the server is obviously entirely up to you. For example:


Leave a comment