Skip to content

Commit 6ae097a

Browse files
author
Austen Conrad
committed
Rewritten for building within ZeroMQ's solution. Also, added howto for use of the pre-compiled libraries.
1 parent 0181d24 commit 6ae097a

File tree

1 file changed

+39
-8
lines changed

1 file changed

+39
-8
lines changed

README.markdown

+39-8
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,51 @@
22

33
The goal of this project is to provide [MQL4](http://docs.mql4.com/ "MQL4 documentation homepage.") bindings for the [ZeroMQ](http://zeromq.org/ "ZeroMQ homepage.") networking library.
44

5-
This software is in an alpha state. I would <i>not</i> recommend it's use in production environments yet.
5+
### To build:
66

7-
The mql4zmq.mqh header file is a reworking of ZeroMQ's default zmq.h header file for use with the MQL4 language.
7+
0. Download and install [Microsoft Visual C++ Express 2010](http://go.microsoft.com/?linkid=9709949 "Microsoft's Visual C++ 2010 Express Download Link.") if you don't already have it.
88

9-
The included precompiled `libzmq.dll` is for a 64-bit architecture. If you need to compile the ZeroMQ library for 32-bit you can download ZeroMQ [here](http://www.zeromq.org/intro:get-the-software "ZeroMQ download page.").
9+
1. Download or git clone the [ZeroMQ v2.1 source](https://github.com/zeromq/zeromq2-1/ "ZeroMQ v2.1 github.")
1010

11-
### To install:
11+
2. Download or git clone the [MQL4ZMQ source](https://github.com/AustenConrad/mql4zmq/ "mql4zmq github.")
1212

13-
1. Move `mql4zmq.mqh` to: `c:\windows\Program Files (x86)\Metatrader\experts\include\mql4zmq.mqh`
13+
3. Copy the downloaded 'mql4zmq' source folder to: downloaded_zeromq_source_folder\builds\msvc\
1414

15-
2. Move `libzmq.dll` to: `c:\windows\Program Files (x86)\Metatrader\experts\libraries\libzmq.dll`
15+
4. Open the ZMQ build solution at: downloaded_zeromq_source_folder\builds\msvc\msvc
16+
4.1 You may need to right click on it and select: "open with" => "Microsfot Visual C++ 2010 Express"
17+
4.2 It may need to be converted. In which case, select 'next' => 'no' then 'next' => 'finish'
18+
19+
5. Now that we have the solution open we need to add the mqlzmq project to the solution. To do this:
20+
5.1 Right-click on "Solution 'msvc'" then select "add" => "existing project"
21+
5.2 A file browser opens up. Go into the 'msvc' folder then the 'mql4zmq' folder and select the 'mql4zmq' project file.
22+
5.2.1 You should now see the mql4zmq listed as project within the solution.
23+
5.3 Right-click on the 'mql4zmq' project and select 'Project Dependencies'. Make sure the drop-down 'Projects' menu is set to 'mql4zmq' and then select 'libzmq' in the 'Depends on' list. Select "OK" to complete.
24+
5.4 You are now ready to build the solution which will produce the ZeroMQ library (libzmq.dll) and the MQL4ZMQ bindings library (mql4zmq.dll). To do this right-click on the solution and select 'Build Solution'.
25+
5.5 Once all 8 projects within the solution have completed building, we need to copy the files the MetaTrader needs to the location it needs them as follows:
26+
5.5.1 downloaded_zeromq_source_folder\builds\msvc\Debug\mql4zmq.dll => c:\Program Files (x86)\[metatrader directory]\experts\libraries\mql4zmq.dll
27+
5.5.2 downloaded_zeromq_source_folder\lib\libzmq.dll => c:\Windows\SysWOW64\libzmq.dll
28+
5.5.3 downloaded_zeromq_source_folder\builds\msvc\mql4zmq\mql4zmq.mqh => c:\Program Files (x86)\[metatrader directory]\experts\include\mql4zmq.mqh
29+
5.5.3 downloaded_zeromq_source_folder\builds\msvc\mql4zmq\examples\mql4zmq.mq4 => c:\Program Files (x86)\[metatrader directory]\experts\mql4zmq.mq4
30+
5.6 You are now ready to open up metatrader, attach the example mql4zmq expert to the chart, and be off and running.
31+
5.6.1 NOTE: when attaching to the chart make sure to select "Allow DLL Imports" and de-select "Confirm DLL Function Calls".
32+
33+
34+
### To use the pre-compiled libraries:
35+
36+
0. Download and install the [Microsoft Visual C++ 2010 Redistributable Package](http://www.microsoft.com/download/en/details.aspx?id=5555 "Microsoft Visual C++ 2010 Redistributable Package Download.") if you don't already have it.
37+
38+
1. Download or git clone the [MQL4ZMQ source](https://github.com/AustenConrad/mql4zmq/ "mql4zmq github.")
39+
40+
2. Copy the following files in the pre-compiled folder to the following locations MetaTrader:
41+
2.1 mql4zmq.dll => c:\Program Files (x86)\[metatrader directory]\experts\libraries\mql4zmq.dll
42+
2.2 libzmq.dll => c:\Windows\SysWOW64\libzmq.dll
43+
2.3 mql4zmq.mqh => c:\Program Files (x86)\[metatrader directory]\experts\include\mql4zmq.mqh
44+
2.4 mql4zmq.mq4 => c:\Program Files (x86)\[metatrader directory]\experts\mql4zmq.mq4
45+
46+
3 You are now ready to open up metatrader, attach the example mql4zmq expert to the chart, and be off and running.
47+
3.1 NOTE: when attaching to the chart make sure to select "Allow DLL Imports" and de-select "Confirm DLL Function Calls".
1648

17-
3. Move `mql4zmq.mq4` to: `c:\windows\Program Files (x86)\Metatrader\experts\mql4zmq.mq4`
1849

1950
### Example Usage:
2051

21-
`code will be provided when there is working code to provide.`
52+
0. See Publish/Subscribe example in examples folder. In general the use is exactly as [documented](http://api.zeromq.org/2-1:_start "ZeroMQ API Documentation.") by ZeroMQ and described in the "C" examples in the [ZGuide](http://zguide.zeromq.org/page:all "ZeroMQ ZGuide.")

0 commit comments

Comments
 (0)