Connect to MetaTrader5 on a networked device?
Actually this is possible. There is a Python library called mt5linux that implements a RPyC server to allow calling local Metatrader Python functions from remote.
Library name does not describe what it can do as it may run in windows too.
I'm developing a docker image that runs MetaTrader5 and mt5linux server on a container, exposing rpyc port so that a Python script may be run from anywhere.
I have MetaTrader5 running on Wine on Arch Linux and can connect to it just fine from that machine using the following python script:
from mt5linux import MetaTrader5 mt5 = MetaTrader5('localhost', 18812)However, I want to be able to run my script on a Windows 10 machine on the same network but still connect to the MetaTrader5 instance on the Arch Linux server. I attempted this little code:
If I run this on Windows 10 it gives this error:
According to the docs, on Windows you connect as so:
import MetaTrader5 as mt5And then you can just do the:
Whereas on Linux you have to run a server that listens on port 18812 and then do this:
mt5 = MetaTrader5('localhost', 18812) mt5.initialize()So when I'm on Windows and attempt to connect it throws the error above. Is there a way on Windows to connect to a remote MetaTrader5 instance?