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
- darwinex blog post --- There are several tutorial videos please have a look first
- darwinex github example --- Included workable example
- mql-zmq github for mt4
Installation Steps --- Publish market data from MT4
- git clone
- darwinex github example
- mql-zmq github for mt4
- copy DWX_ZeroMQ_Server_v2.0.1_RC8.mq4
- From dwx-zeromq-connector/v2.0.1/mql4/
- To MT4/MQL4/Experts
- copy all folders and files
- From mql-zmq/Include/
- To MT4/MQL4/Include
- copy all dll files
- From mql-zmq/Library/MT4/
- To MT4/MQL4/Libraries
- Compile EA from MT4, drag and drop the EA and enable dll import
- Try to publish market data
Installation Steps --- Receive market data using python
- copy DWX_ZeroMQ_Connector_v2_0_1_RC8.py
- From dwx-zeromq-connector/v2.0.1/python/api/
- Set up vitrualenv with python3
- Windows
- Install python 3
- open cmd
- pip install virtualenv
- virtualenv ./pythonEnv
- ./pythonEnv/Script/activate
- Linux
- Install packages
- pip install zmq
- pip install pandas
- 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')
沒有留言:
發佈留言