pymt5linux
Forked from lucas-campagna/mt5linux. This is a up-to-date version which incorporates recent MT5 software updates. It works with Python 3.13.
As an alternative to the setup below, you can also opt to run a Docker image of MT5 with x11/noVNC remote access. Check out mt5docker for details.
How To Use
- Install (as per MT5 Linux user guide):
- Install MetaTrader5 package inside your Wine Python installation.
pip install MetaTrader5
- Install pymt5linux package in both Wine and Linux Python versions.
pip install pymt5linux
- Establish the connection.
python -m pymt5linux <path/to/python.exe>,
or if you want to specify the host and port:
python -m pymt5linux --host localhost --port 8001 <path/to/python.exe>
from pymt5linux import MetaTrader5
mt5 = MetaTrader5()
mt5 = MetaTrader5(host="localhost", port=8001)
- Make sure you test with a DEMO account first, then have fun!
Most importantly, see MetaQuotes' official documentation.