Skip to main content

MetaTrader5 for linux users

Project description

MetaTrader 5 for linux system

A simple package that uses wine, rpyc and a Python Windows version to allow using MetaTrader5 on Linux.

Install

  1. Install Wine.

  2. Install Python for Windows on Linux with the help of Wine.

  3. Find the path to python.exe.

    • Mine is installed on /home/user/.wine/drive_c/users/user/Local Settings/Application Data/Programs/Python/Python39.
  4. Install mt5 library on your Windows Python version.

pip install MetaTrader5
pip install --upgrade MetaTrader5
  1. Install this package on both Windows and Linux Python versions:
pip install mt5linux

How To Use

Follow the steps:

  1. Open MetaTrader5.

  2. On Windows side, start the server on a terminal:

python -m mt5linux <path/to/python.exe>
  1. On Linux side, make your scripts/notebooks as you did with MetaTrader5:
# import the package
from mt5linux import MetaTrader5
# connecto to the server
mt5 = MetaTrader5(
    # host = 'localhost' (default)
    # port = 18812       (default)
) 
# use as you learned from: https://www.mql5.com/en/docs/integration/python_metatrader5/
mt5.initialize()
mt5.terminal_info()
mt5.copy_rates_from_pos('GOOG',mt5.TIMEFRAME_M1,0,1000)
# ...
# don't forget to shutdown
mt5.shutdown()
  1. Be happy!

On step 2 you can provide the port, host, executable, etc... just type python -m mt5linux --help.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tcmetatraderlinux-0.3.0.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

tcmetatraderlinux-0.3.0-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file tcmetatraderlinux-0.3.0.tar.gz.

File metadata

  • Download URL: tcmetatraderlinux-0.3.0.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for tcmetatraderlinux-0.3.0.tar.gz
Algorithm Hash digest
SHA256 89081819e8866826269cbd22b147c33eb16fb1db8e71637288af60ed17b910e8
MD5 2472ee2d9efd26a75b707d053a3abd93
BLAKE2b-256 921b2fbfeec7fd76f28833fbddb73b909b9be73e6a148dd042b81b3eae713f96

See more details on using hashes here.

File details

Details for the file tcmetatraderlinux-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tcmetatraderlinux-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afcedd53ad9892816d4bd30affb05192819ea49b6d18a3d7044d7d8f9ee1a9fe
MD5 bbd07511f3aa0add133609de8f4e9d58
BLAKE2b-256 ebf3251b66fa4a842a74ec5d8c0870ced343ad6a5db41b2af6f0e52c4bd835d2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page