Giter VIP home page Giter VIP logo

mt5linux's Introduction

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.

mt5linux's People

Contributors

lucas-campagna avatar james-coder avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.