Welcome to pymt5linux repository!
Forked from lucas-campagna/mt5linux. This is a up-to-date version which incorporates recent MT5 software updates. It works with Python 3.13.
Check out mt5docker. It is also possible to run pymt5linux embedded in a Docker image that runs MT5 with x11/noVNC remote access.
Before stepping into the below, I strongly recommend you to check MetaQuotes' official Python MQL5 documentation.
1. As per MT5 Linux user guide, install:
- Wine in your Linux machine.
- Python for Windows inside Wine.
- MT5 client terminal for Windows inside Wine.
2. In your Windows environment (Wine), install the following packages:
pip install MetaTrader5 pymt5linux
3. In your Linux environment, install the following packages:
pip install pymt5linux
4. In your Windows environment (Wine), open the MT5 client terminal and run the server:
python -m pymt5linux --host localhost --port 8001 <path/to/python.exe>
5. In your Linux environment, run your Linux script.
# establish connection to MT5
from pymt5linux import MetaTrader5
mt5 = MetaTrader5(host="localhost", port=8001)6. Make sure you test with a DEMO account first, then have fun!