1

Looking for the simplest possible example of how to communicate with Metatrader client via its TCP stack using perl.

{perl} --[client_TCP_api]--> {MT_client} --[server_API]--> metatrader_server

Here is an question looking for a [server_API]. I'm looking for a [client_API] that is completely different and it is publicly available.

Only my experiments don't work. Unfortunately, this question is answerable only by person who know metatrader and perl together.

Community
  • 1
  • 1
kobame
  • 5,766
  • 3
  • 31
  • 62

1 Answers1

2

There is no such thing as client api. You can not extend the actual client app.

What you can do is write mql scripts that, once attached to a chart, can provide some level of programability in terms of automated trading.

In terms of driving functionality on the client you are at the mercy of what mql provides for you, which is quiet enough if all you want to do is trading.

In terms of talking to mql from the outside, there is a way to import and load dlls into the process space, there are examples all over the web on how to do this.

So the order of things would be:

  • Metatrader client starts up and loads an mql script attached to a chart.

  • The mql script loads a dll containing tcp server functionality and a way to start it and poll requests.

  • Mql script uses one of the bootstrap methods to call the tcp server start() method in the dll.

  • Perl connects and sends tcp to dll.

  • Mql polls dll to get requests and translate them into mql trade actions.

The best part is that this is all perfectly legal, does not violate the meta quotes ula and update compatible.

Dmitry
  • 1,513
  • 1
  • 15
  • 33
  • Nice answer. My searching failed. Could you please add some GOOD pointers for: _In terms of talking to mql from the outside, there is a way to import and load dlls into the process space,_ __there are examples all over the web on how to do this.__ ? Thanx. – clt60 Apr 03 '13 at 19:34
  • http://docs.mql4.com/runtime/imports search keywords: "mql import dll sample" or "mql laod dll" – Dmitry Apr 03 '13 at 20:30