2

I would like to ask how to pass some kind of data, like string to my C# DLL. This questions has been answered for C++: How to pass argument by reference from MQL4 to C++ DLL

However in my case I want my C# code to get this value from MQL4 and then do something with it (so all this while in the C# code).

It's probably a similar approach, but is this still the best way to go, and could someone provide a minimum example of doing this in C#?

Iason
  • 209
  • 3
  • 11
  • 38

1 Answers1

2

The Best Way to go?

My one would be to integrate "over" a principally neutral ZeroMQ channel.

MQL4 will sit on one side, C# or whatever other process ( python, GoLang, Erlang, FORTRAN, MATLAB, ... ) will sit on remote side, each agent-side having a chance to have also an N+M load/balancing or robustness resilience added.

Using the same byte-packing mapper on either side will enforce interoperability, even if MetaTrader Terminal platform will make any next shift of paradagms ( as it did in past, having moved string datatype into actually being a #pragma-decorated struct and similar low level surprises ).

This way one will never have to re-visit the API for any external re-factoring introduced implementation revision for gaining the lost integration back into production.


Minimum Example of doing this?

Feel free to study and re-use many of ZeroMQ examples posted here or the ZeroMQ API documentation and the C# bindings available.

user3666197
  • 1
  • 6
  • 50
  • 92
  • Thank you for the link, but I would still love to see a minimal working example, perhaps using hte ZeroMQ API. – Iason Apr 10 '18 at 13:24
  • A working example of what? Your O/P did not contain a SLOC on any such. Feel free to bring a code you have tried to design and show where / how it fails to work in spite of the API documentation or a use-case. This is a standard StackOverflow policy. – user3666197 Apr 10 '18 at 13:40
  • I added the way I;m trying to get an integer into the C# function. – Iason Apr 10 '18 at 14:22