Skip to content

Advanced MTsocketAPI Configuration

MTsocketAPI listens on ports:

Description Type Port Use
Commands TCP 77 Legacy
Data TCP 78 Legacy
HTTP/Websockets TCP 81 Recommended

Starting with version 5.40, there is a new port (TCP 81) that responds to http request and stream realtime data using websocket protocol.

The Input tab enables users to adjust the ports used by MTsocketAPI:

Note

If you set "HTTP/Websockets only" to true, then the command and data ports will be closed and only the HTTP/Websockets port will work.

Tip

In the event that multiple Metatrader 5 applications are running on the same computer, it is necessary to utilize different ports.

As an illustration, if four Metatrader applications are running on the same machine, the following ports can be utilized::

MT5 (1) MT5 (2) MT5 (3) MT5 (4)
Command TCP Port 71 73 75 77
Data TCP Port 72 74 76 78
HTTP/Websockets Port 81 82 83 84
Note

Please ensure that you check the Expert tab to verify that the new selected ports have been opened successfully: