# MetaTrader 5 for linux system
A simple package that uses [wine](https://www.winehq.org), [rpyc](https://github.com/tomerfiliba-org/rpyc) and a Python Windows version to allow using [MetaTrader5](https://pypi.org/project/MetaTrader5) on Linux.
## Install
1. Install [Wine](https://wiki.winehq.org/Download).
2. Install [Python for Windows](https://www.python.org/downloads/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](https://www.mql5.com/en/docs/integration/python_metatrader5) library on your **Windows** Python version.
```
pip install MetaTrader5
pip install --upgrade MetaTrader5
```
5. 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>
```
3. On **Linux** side, make your scripts/notebooks as you did with MetaTrader5:
```python
# 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()
```
4. Be happy!
On step 2 you can provide the port, host, executable, etc... just type `python -m mt5linux --help`.
Raw data
{
"_id": null,
"home_page": "https://github.com/Traders-Connect/mt5linux-tc",
"name": "tcmetatraderlinux",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Lucas Prett Campagna",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/92/1b/2fbfeec7fd76f28833fbddb73b909b9be73e6a148dd042b81b3eae713f96/tcmetatraderlinux-0.3.0.tar.gz",
"platform": null,
"description": "# MetaTrader 5 for linux system\r\n\r\nA simple package that uses [wine](https://www.winehq.org), [rpyc](https://github.com/tomerfiliba-org/rpyc) and a Python Windows version to allow using [MetaTrader5](https://pypi.org/project/MetaTrader5) on Linux.\r\n\r\n## Install\r\n\r\n1. Install [Wine](https://wiki.winehq.org/Download).\r\n\r\n2. Install [Python for Windows](https://www.python.org/downloads/windows/) on Linux with the help of Wine.\r\n\r\n3. Find the path to `python.exe`.\r\n\r\n - Mine is installed on `/home/user/.wine/drive_c/users/user/Local Settings/Application Data/Programs/Python/Python39`.\r\n\r\n4. Install [mt5](https://www.mql5.com/en/docs/integration/python_metatrader5) library on your **Windows** Python version.\r\n\r\n```\r\npip install MetaTrader5\r\npip install --upgrade MetaTrader5\r\n```\r\n\r\n5. Install this package on both **Windows** and **Linux** Python versions:\r\n\r\n```\r\npip install mt5linux\r\n```\r\n\r\n## How To Use\r\n\r\nFollow the steps:\r\n\r\n1. Open MetaTrader5.\r\n\r\n2. On **Windows** side, start the server on a terminal:\r\n\r\n```\r\npython -m mt5linux <path/to/python.exe>\r\n```\r\n\r\n3. On **Linux** side, make your scripts/notebooks as you did with MetaTrader5:\r\n\r\n```python\r\n# import the package\r\nfrom mt5linux import MetaTrader5\r\n# connecto to the server\r\nmt5 = MetaTrader5(\r\n # host = 'localhost' (default)\r\n # port = 18812 (default)\r\n) \r\n# use as you learned from: https://www.mql5.com/en/docs/integration/python_metatrader5/\r\nmt5.initialize()\r\nmt5.terminal_info()\r\nmt5.copy_rates_from_pos('GOOG',mt5.TIMEFRAME_M1,0,1000)\r\n# ...\r\n# don't forget to shutdown\r\nmt5.shutdown()\r\n```\r\n\r\n4. Be happy!\r\n\r\nOn step 2 you can provide the port, host, executable, etc... just type `python -m mt5linux --help`.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "MetaTrader5 for linux users",
"version": "0.3.0",
"project_urls": {
"Homepage": "https://github.com/Traders-Connect/mt5linux-tc"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ebf3251b66fa4a842a74ec5d8c0870ced343ad6a5db41b2af6f0e52c4bd835d2",
"md5": "bbd07511f3aa0add133609de8f4e9d58",
"sha256": "afcedd53ad9892816d4bd30affb05192819ea49b6d18a3d7044d7d8f9ee1a9fe"
},
"downloads": -1,
"filename": "tcmetatraderlinux-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bbd07511f3aa0add133609de8f4e9d58",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 31918,
"upload_time": "2024-01-25T00:07:10",
"upload_time_iso_8601": "2024-01-25T00:07:10.772469Z",
"url": "https://files.pythonhosted.org/packages/eb/f3/251b66fa4a842a74ec5d8c0870ced343ad6a5db41b2af6f0e52c4bd835d2/tcmetatraderlinux-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "921b2fbfeec7fd76f28833fbddb73b909b9be73e6a148dd042b81b3eae713f96",
"md5": "2472ee2d9efd26a75b707d053a3abd93",
"sha256": "89081819e8866826269cbd22b147c33eb16fb1db8e71637288af60ed17b910e8"
},
"downloads": -1,
"filename": "tcmetatraderlinux-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "2472ee2d9efd26a75b707d053a3abd93",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 32392,
"upload_time": "2024-01-25T00:07:12",
"upload_time_iso_8601": "2024-01-25T00:07:12.452231Z",
"url": "https://files.pythonhosted.org/packages/92/1b/2fbfeec7fd76f28833fbddb73b909b9be73e6a148dd042b81b3eae713f96/tcmetatraderlinux-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-25 00:07:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Traders-Connect",
"github_project": "mt5linux-tc",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "tcmetatraderlinux"
}