Skip to content
Open Trading edited this page Feb 26, 2016 · 13 revisions

Installation

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

Prerequisites

You must have cmd2 installed the Python that runs these scripts: see https://bitbucket.org/catherinedevlin/cmd2

You must have configobj installed in the Python that runs these scripts. The up-to-date one is at https://github.com/DiffSK/configobj/

Plotting Prerequisites

You must have pandas installed in the Python that runs these scripts: http://pypi.python.org/pypi/pandas

You must have matplotlib installed in the Python that runs these scripts: http://pypi.python.org/pypi/matplotlib

Backtesting Prerequisites

For backtesting (DocOTCmd2_backtest), you need to have pybacktest installed in the Python that runs these scripts: https://github.com/ematvey/pybacktest/

You must have pandas installed in the Python that runs these scripts: http://pypi.python.org/pypi/pandas

You will probably also want the Cythoned ta-lib that works with pandas/numpy: see TaLib.

Metatrader Prerequisites

In your Metatrader Python, you also must have installed Pika: https://pypi.python.org/pypi/pika/

In order to interact with Metatrader, you will need to install the OTMql4Py and OTMql4Lib projects from https://github.com/OpenTrading/ into the Python called by your Metatrader:

One day we will make installers for shrink-wrapped distributions, but for now, you must clone them from https://github.com and manually install. Make a directory anywhere called OpenTrading, and clone each of the above into that directory. Then recursively copy the contents of each of the three MQL4 subdirectories into your Metatrader MQL4 subdirectory.

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

Metatrader ZeroMQ

For ZeroMq you will need to have installed

Attach the OTZmqCmdEA.mq4 EA in OTMql4AMQP to a chart and make sure it's working; look at the Experts log in Mt4 to see messages of success. With the EA loaded onto a chart, run the OTCmd2 script (DocOTCmd2) from a command line, with the -P option to give the path to your Metatrader installation. Then give the commands sub set and sub run retval timer. Within about 15 seconds you should see timer messages coming for your OTMql4Zmq enabled Metatrader.

Metatrader RabbitMQ

For RabbitMQ you will need to have installed:

You must have a AMQP server running, such as RabbitMQ, by default with the default guest account: see http://rabbitmq.org

Attach the OTPyTestPikaEA.mq4 EA in OTMql4AMQP to a chart and make sure it's working; look at the Experts log in Mt4 to see messages of success. With the EA loaded onto a chart, run the OTCmd2 script (DocOTCmd2) from a command line, with the -P option to give the path to your Metatrader installation. Then give the commands sub set and sub run retval.# timer.#. Within about 15 seconds you should see timer messages coming for your OTMql4AMQP enabled Metatrader.

Setup

Clone this project from github

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

and then run change to the OpenTrader directory and run

python setup.py

to create the 3 scripts:


Parent: Home