Skip to main content

MetaTrader5 for Linux users, improved version

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

Changelog

  • Updated Libs.
  • Ensured compatibility with the latest version of MetaTrader5.

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.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

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

MT5LinuxEnhanced-0.3.1.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

MT5LinuxEnhanced-0.3.1-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file MT5LinuxEnhanced-0.3.1.tar.gz.

File metadata

  • Download URL: MT5LinuxEnhanced-0.3.1.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.6

File hashes

Hashes for MT5LinuxEnhanced-0.3.1.tar.gz
Algorithm Hash digest
SHA256 fa55b13d564974fdda520991ec93658f66fc9d3f44dc5849d74e4a6550b913ab
MD5 43a6ba2489e21ac0186118af570388ed
BLAKE2b-256 57ea1c140d1eb3698c17a3515a27705a9026e01ba641f58c7315ff10efe546b3

See more details on using hashes here.

File details

Details for the file MT5LinuxEnhanced-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for MT5LinuxEnhanced-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 035921e6acb31d1906e2ec4fd67aeab486c4edd71b261cc3b354d2c6365c7522
MD5 c0cc91f241a1d6765af3ab28e1b6d497
BLAKE2b-256 39302283272e4e0b72a1afc1638002a58e5d2ce63c6fef5e6bfa29693a997263

See more details on using hashes here.

Supported by

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