OpenTrading / OTMql4Py

Open Trading Metatrader 4 Python Integration
GNU Lesser General Public License v3.0
104 stars 49 forks source link

Named pipes #1

Closed femtotrader closed 8 years ago

femtotrader commented 8 years ago

Hi OpenTrading,

Did you ever try "named memory pipes" A DLL-free solution to communicate between MetaTrader 5 terminals using Named Pipes July, 2010 http://www.mql5.com/en/articles/115

Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs http://www.mql5.com/en/articles/503

Kind regards

OpenTrading commented 8 years ago

That's a nicely written article - it's the Windows equivalent to named pipes in Unix (mkfifo).

The drawback is that it's point to point, and doesn't have the flexibility of the different topographies of ZeroMQ/AMQP, like PUB/SUB which is ideal for making a trade copier. They also tend to be brittle, if one part of the message is lost on the netwok, or received out of order.

We now have ZeroMQ working with OpenTrader without Python under Mt4 so I don't need to require people to have installed a RabbitMQ server; that will make distribution a whole lot easier. You still need a Python for now because the software is written in Python, but I should be able to freeze it at both ends for distribution. This solves a major problem: since Build 600, I can't leave a Python EA attached to a chart and restart Mt4 (with or without Zmq) - it doesn't reload properly. No idea why: it used to work, and I see little likelihood of figuring out why.

OpenTrader now uses ZeroMQ without Python by default - OTZmqCmdEA.mq4. It uses REQ/REP to send commands to Mt4 and PUB/SUB for bars and ticks. I've started documenting it and it passes the test suite. I'll switch back to developing on ZeroMQ which is more Pythonic than AMQP, and installing and running a RabbitMQ server under Windows is a lot to ask; I want to minimize the prerequisites to installing the software.

OpenTrading commented 8 years ago

We now have OpenTrader bundled as frozen exe using ZeroMQ, and I'm testing it out. If it tests clean, I'll make an installer for it.