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
-
Install Wine.
-
Install Python for Windows on Linux with the help of Wine.
-
Find the path to
python.exe
.- Mine is installed on
/home/user/.wine/drive_c/users/user/Local Settings/Application Data/Programs/Python/Python39
.
- Mine is installed on
-
Install mt5 library on your Windows Python version.
pip install MetaTrader5
pip install --upgrade MetaTrader5
- Install this package on both Windows and Linux Python versions:
pip install mt5linux
How To Use
Follow the steps:
-
Open MetaTrader5.
-
On Windows side, start the server on a terminal:
python -m mt5linux <path/to/python.exe>
- 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()
- 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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file mt5linux_tc-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: mt5linux_tc-0.2.3-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0549286dd6008260b72607e2a97a067a652ad31fbd74bea8fb55de5e0213af9a |
|
MD5 | c4b60add796ed395e90a7fd4206197bb |
|
BLAKE2b-256 | 1c5bc2ce041cfb218a87b6f75a5c81d6fad052245e319efaa08a859ddc380af8 |