Skip to content

fdoperezi/OTMql4AMQP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTMql4AMQP

OTMql4AMQP - AMQP bindings for MQL4 Python

https://github.com/OpenTrading/OTMql4AMQP/

This project allows the OpenTrading Metatrader-Python bridge (https://github.com/OpenTrading/OTMql4Py/) to work with RabbitMQ, or probably any version of AMQP, the emerging standard for high performance enterprise messaging, for asynchronous communications between financial and trading applications. It builds on OTMql4Py, and requires it as a pre-requisite.

In your Python, you must have installed Pika: https://pypi.python.org/pypi/pika/ Pika offers the advantage of being pure Python: no DLLs to compile or install. Pika communicates with AMQP servers, the most common open-source one being RabbitMQ http://www.rabbitmq.com You will need an AMPQ server installed, configured and running to use this project. The code assumes the default server setup of username: guest, password: guest, virtual host: /.

This is a work in progress - a developers' pre-release version.

It works on builds > 6xx, but the documentation of the wiring up of an asnychronous event loop under Python still needs to be done, as well as more tests and testing on different versions. Only Python 2.7.x is supported.

The project wiki should be open for editing by anyone logged into GitHub: Please report any system it works or doesn't work on in the wiki: include the Metatrader build number, the origin of the metatrader exe, the Windows version, and the AMQP server version and version of the Pika. This code in known to run under Linux Wine (1.7.x), so this project bridges Metatrader to RabbitMQ under Linux.

Installation

For the moment there is no installer: just "git clone" or download the zip from github.com and unzip into an empty directory. Then recursively copy the folder MQL4 over the MQL4 folder of your Metatrader installation. It will not overwrite any Mt4 system files; if it overwrites any OTMql4Py files, the files are in fact identical (e.g. init.py).

Project

Please file any bugs in the issue tracker: https://github.com/OpenTrading/OTMql4AMQP/issues

Use the Wiki to start topics for discussion: https://github.com/OpenTrading/OTMql4AMQP/wiki It's better to use the wiki for knowledge capture, and then we can pull the important pages back into the documentation in the share/doc directory. You will need to be signed into github.com to see or edit in the wiki.

You may want to also look at: https://github.com/OpenTrading/OpenTrader which provides a command-line interpreter to speak to an OTMql4AMQP enabled Metatrader.

Testing

If you open a command window and go to your MQL4\Python directory run this command first python OTMql427/PikaListener.py "#" Then open another command window and go to your MQL4\Python directory run this command second python OTMql427/PikaChart.py "foo" You should soon see ['foo'] appear in the first window.

If it does not work, then solve this problem first, because it won't work from Python under Mt4 if it doesn't work here.

If you leave the first command running, you should see the tick and bar information broadcast by the calls in OnTimer and OnTick in MQL4/Experts/OTMql4/OTPyTestPikaEA.mq4

OnTimer is called every iTIMER_INTERVAL_SEC (10 sec.) which allows us to use Python to look for Pika inbound messages, or execute a stack of calls from Python to us in Metatrader.

About

OpenTrading Metatrader bindings for AMQP via Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 76.3%
  • C 23.7%