Pages - Menu

標籤

AWS (1) bash (1) Boost (2) C (2) CMake (2) Concurrency_Programming (3) CPP (37) Database (2) DNS (1) Docker (4) Docker-Compose (1) ELK (1) emacs (4) gcp (1) gdrive (1) git (1) gitbash (2) gitlab (1) kvm (4) Linux (5) MT4 (4) MT5 (4) Multicast (2) MySQL (2) Nijatrader8 (1) OpenCV (1) Python (4) QT5 (1) R (1) rdp (3) screenshot (1) ssh (3) Tabnine (1) TCP (1) TensorFlow (1) Tools (12) Ubuntu_1904 (11) Ubuntu_20_04 (5) UDP (1) VS2010 (1) VS2015 (1) VS2019 (1) WebServer (1) Win10 (1) winmerge (1) WSL (1) xrdp (1)

搜尋此網誌

2020年3月17日星期二

Integrate MT4/5 with other process through ZMQ

Aim

We would like to treat MT4 as a server that can provide market data, backtest environment, trading execution. Other applications written by different programming language such as python, c++, R, c# can use ZMQ library as an interface to communicate with MT4.

Learning Source

Installation Steps --- Publish market data from MT4

  1. git clone
    1. darwinex github example
    2. mql-zmq github for mt4
  2. copy DWX_ZeroMQ_Server_v2.0.1_RC8.mq4
    • From dwx-zeromq-connector/v2.0.1/mql4/
    • To MT4/MQL4/Experts
  3. copy all folders and files
    • From mql-zmq/Include/
    • To MT4/MQL4/Include
  4. copy all dll files
    • From mql-zmq/Library/MT4/
    • To MT4/MQL4/Libraries
  5. Compile EA from MT4, drag and drop the EA and enable dll import
  6. Try to publish market data
    • You will see the following logs when success

Installation Steps --- Receive market data using python

  1. copy DWX_ZeroMQ_Connector_v2_0_1_RC8.py
    • From dwx-zeromq-connector/v2.0.1/python/api/
  2. Set up vitrualenv with python3
    1. Windows
      • Install python 3
      • open cmd
      • pip install virtualenv
      • virtualenv ./pythonEnv
      • ./pythonEnv/Script/activate
    2. Linux
      1. steps
  3. Install packages
    • pip install zmq
    • pip install pandas
  4. test.py, reference Example

import sys
sys.path.insert(1, '..')

import ZMQConnector.api.DWX_ZeroMQ_Connector_v2_0_1_RC8 as zmq

# ----------------------------------- Main
if __name__ == "__main__":
    _zmq = zmq.DWX_ZeroMQ_Connector()
    _zmq._DWX_MTX_SUBSCRIBE_MARKETDATA_('EURUSD')

沒有留言:

發佈留言