Skip to content

A wrapper of MetaTrader5 official package that enables multiple terminal instances at the same time.

License

Notifications You must be signed in to change notification settings

coke5151/py2mql5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Py2MQL5

A wrapper of MetaTrader5 official package that enables multiple terminal instances at the same time.

Documentation

First copy your MetaTrader5 from its installation directory to a normal folder (don't put it in a system directory like Program Files, C:, root, etc).

Then you can use the following code to connect to the terminal:

from py2mql5 import Client

client = Client(terminal_path="path/to/your/MetaTrader5", login=123456, password="password", server="server-demo")

All original functions will be client.official.function_name(parameter) now.

For example:

# Original MetaTrader5 usage (only support one terminal):
import MetaTrader5 as Mt5
Mt5.initialize()
Mt5.terminal_info()

# Py2MQL5 usage:
from py2mql5 import Client

client = Client(terminal_path="path/to/your/MetaTrader5", login=123456, password="password", server="server-demo") # must provide login and password, and portable mode will be True
client.official.terminal_info() # Will work as Mt5.terminal_info()

# You can also create multiple clients:
client2 = Client(terminal_path="path/to/your/MetaTrader5", login=123457, password="password2", server="server-demo")
client2.official.terminal_info() 

Because this is a wrapper, you can refer to the MetaTrader5 official docs for more details.

About

A wrapper of MetaTrader5 official package that enables multiple terminal instances at the same time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published