Skip to content

MetaMemoryT/OpenTrader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTrader

https://github.com/OpenTrading/OpenTrader/

OpenTrader is an Open Source platform to communicate with on-line trading platforms, and includes the ability to:

  • write trading Recipes for multiple back-end testers (1 at the moment :-),
  • import data from CSV files or from the web for Backtesting),
  • analyze the Backtesting with multiple back-end reviewers (1 at the moment :-),
  • save the backtests, along with their parameters in an HDF5 file,
  • send and receive data from multiple on-line trading platforms (1 at the moment :-).

This ia a work in progress but it has quite a lot in there already:

  • send most Mql4 commands and gets the return values as Python,
  • receive bar, tick and timer notifications, using the Python bridge enabled MetaTrader (OTMql4AMQP), or ZeroMQ enabled MetaTrader (OTMql4Zmq).
  • send and query orders to Mt4, using a better MQL4 trading library (https://github.com/OpenTrading/OTMql4),
  • reads CSV and everything internally is pandas DataFrames or Series,
  • there's a backtester for trading recipes based on pybacktest (https://github.com/ematvey/pybacktest/), using pandas with TaLib), so it's quite fast.
  • there's simple plotting of the CSV files and results using matplotlib (http://matplotlib.org),
  • you can save recipes and backtest results as an HDF5 file (see Omlettes)), viewable by ViTables)
  • if you have pyrabbit (http://pypi.python.org/packages/source/p/pyrabbit) installed, you can query the AMQP server.

Coming Real Soon Now(TM) is:

  • wiring up the backtester so that it should soon support Recipes for live-trading on Metatrader from Recipes and Chefs.
  • there's an optimizer in the backtester, but it's not yet wired up. For our future directions, see the RoadMap).

Messaging Protocols

This project now works with ZeroMQ or RabbitMQ Messaging Protocols. The ZeroMQ protocol is preferred and all development is currently on it.

ZeroMQ: To use ZeroMQ, this project builds on OTMql4Zmq), and requires that to be installed in your Metatrader as a pre-requisite. You also must have installed Python and the OTMql4Py Python bridge (https://github.com/OpenTrading/OTMql4Py/) and OTMql4Lib Metatrader library (https://github.com/OpenTrading/OTMql4Lib/). These are packaging issues for now; OpenTrader runs fine with the C coded implmentation of ZeroMQ for Metatrader: OTZmqCmdEA.mq4 (https://github.com/OpenTrading/OTMql4Zmq/raw/master/MQL4/Experts/OTMql4/OTZmqCmdEA.mq4)

RabbitMQ: To use ZeroMQ, this project builds on OTMql4AMQP), and requires that to be installed in your Metatrader Python as a pre-requisite. You also must have installed Pika (https://pypi.python.org/pypi/pika/), which must be accessible to your OTMql4Py (https://github.com/OpenTrading/OTMql4Py/). You also must have installed and started a RabbitMQ server (http://rabbitmq.org), which is not so easy under Windows.

One day we will make installers for a shrink-wrapped distribution, but for now, you must clone from github.com and manually install. See Installation).

OTCmd2 (DocOTCmd2) is a command line script to run send commands to a OTMql4Zmq) or OTMql4AMPQ enabled Metatrader. It will start a command loop to listen, send commands, based on the Cmd2) read-eval-print, or take commands from the standard input, a file, or as command-line arguments. You will have to call OTCmd2 (DocOTCmd2) with the-P option with the path of your installed Metatrader (e.g. c:\Program Files\Metatrader), or add your installed OTMql4Py Python directory to thePYTHONPATH environment variable (e.g.c:\Program Files\Metatrader\MQL4\Python).

Work in Progress

This is a work in progress - a developers' pre-release version. It has been fully checked in, and there is a test-suite based on the examples that provides good coverage, but the internal APIs will change.

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.


Parent: Home (https://github.com/OpenTrading/OpenTrader/wiki/)

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.8%
  • Shell 4.2%