Algorithmic trading and quantitative trading platform to develop trading robots (stock markets, forex, bitcoins and options)
This project provide MQL4 and MQL5 bindings for the ZeroMQ networking library to an external server to create live streaming pipeline with real time data of ticks and order book changes.
With ZeroMQ (http://zeromq.org/) you can:
- Connect your code in any language, on any platform.
- Carries messages across inproc, IPC, TCP, TIPC, multicast.
- Smart patterns like pub-sub, push-pull, and router-dealer.
- High-speed asynchronous I/O engines, in a tiny library.
- Backed by a large and active open source community.
- Supports every modern language and platform.
- Build any architecture: centralized, distributed, small, or large.
In this example we are using just two brokers XM and FXPRO for streaming the data but you can connect to an unlimit numner of brokers at the same time.
Recursively copy the folder MQL4 for metatrader4 over the MQL4 folder or for metatrader5 recursively copy the folder MQL5 over the MQL5
I'm using MetaTrader build 1000+ and ZeroMQ4.x
- NOTE: when attaching to the chart make sure to select "Allow DLL Imports" and de-select "Confirm DLL Function Calls".
- NOTE: If you want to use ZeroMQ different of 4.x you must compile the dll again
- NOTE: Precompiled DLLs of both 64bit and 32bit ZeroMQ and libsodium are provided. If you are using MT5 32bit, use the 32bit version from
Library/MT4
. The DLLs require that you have the latest Visual C++ runtime (2015). Note that these DLLs are compiled from official sources, without any modification. You can compile your own if you don't trust these binaries. Thelibsodium.dll
is copied from the official binary release. If you want to support security mechanisms other thancurve
, or you want to use transports like OpenPGM, you need to compile your own DLL.
MQL strings are Win32 UNICODE strings (basically 2-byte UTF-16). In this binding all strings are converted to utf-8 strings before sending to the dll layer. The ZmqMsg supports a constructor from MQL strings, the default is NOT null-terminated.
Inside the Server folder there is a server with ZMQ that subscribe the brokers to get every tick and also the order book in real time. Once the ZMQ receive new ticks or any change on the order book happen, it is automatically re-streamed to Kafka / ZeroMQ and PubNub and you can process this data in real time.
sudo apt-get install libtool pkg-config build-essential autoconf automake
sudo apt-get install libzmq-dev
git clone git://github.com/jedisct1/libsodium.git
cd libsodium
./autogen.sh
./configure && make check
sudo make install
sudo ldconfig
wget http://download.zeromq.org/zeromq-4.1.2.tar.gz
tar -xvf zeromq-4.1.2.tar.gz
cd zeromq-4.1.2
./autogen.sh
./configure && make check
sudo make install
sudo ldconfig
- PubNub
- RabbitMQ
- ZeroMQ
- Kafka