A guide to successfully install MT5 and MetaTrader5 package for Python on Linux. - page 2

Arda Kaya #:

Thanks for sharing — this is a clear and useful guide for running the MetaTrader5 Python integration on Ubuntu via Wine. Important reminder: MetaTrader5 Python package only works when MT5 is open in Wine, and all Python calls must run in the same Wine environment.

This method is a valid workaround since MT5 doesn't natively support Linux or Python integration outside Windows APIs.

Thanks Arda Kaya.

Your reminder is helpful, yes, "MetaTrader5 Python package only works when MT5 is open in Wine, and all Python calls must run in the same Wine environment".

Hey guys, 

I'd like to know from you who used this setup. Do you still enjoy the benefits of Linux's python computing power while using it in wine, OR does it automatically get the Windows limitations when doing so?

I started using Linux to optimize the python ML calculations as Windows has limitations to computing power with this. I want full CPU/GPU access for my ML code but if I can't set up a proper ONNX communication channel simply because the MT5 dev team can't figure out creating a program optimized for ML algo trading in Linux....I'm bound to creating a Windows environment with it's limitations again.

Anyone seen a boost in performance compared to Windows? It's best to have the shortest computing times between MQL5 EA <> Python ML environment

FransinSG #:

Hey guys, 

I'd like to know from you who used this setup. Do you still enjoy the benefits of Linux's python computing power while using it in wine, OR does it automatically get the Windows limitations when doing so?

I started using Linux to optimize the python ML calculations as Windows has limitations to computing power with this. I want full CPU/GPU access for my ML code but if I can't set up a proper ONNX communication channel simply because the MT5 dev team can't figure out creating a program optimized for ML algo trading in Linux....I'm bound to creating a Windows environment with it's limitations again.

Anyone seen a boost in performance compared to Windows? It's best to have the shortest computing times between MQL5 EA <> Python ML environment


Hi FransinSG,

What matters is where Python runs. If your ML code runs natively on Linux, it still uses the Linux CPU/GPU stack, even with MT5 running under Wine. Windows Python inside Wine is a different setup. I’d keep ML on Linux and connect it to the EA through a persistent localhost TCP connection. MQL5 supports sockets. Another option is a small FastAPI bridge running in Windows Python alongside MT5 in Wine. Your Linux ML code sends trade requests over localhost HTTP, and the bridge calls MetaTrader5.order_send(). You’d just need to check that the bridge works properly in your Wine setup.

FransinSG - Trader's profile
FransinSG - Trader's profile
  • 2015.08.29
  • www.mql5.com
Trader's profile