When using c++, is it possible to access the mql methods from within the c++ code? Or is it only possible to pass primitives between the c++ and mql?
To clarify, I am wanting the ability to call orderSend in c++ code.
You have to get the MQL code to initiate the process. Check here for a solution in C# : https://github.com/jseparovic/MQL4CSharp
It's quite simple really, just makes use of the onTimer function and launches the C# code in it's own thread, so it can block while the MQL function completes and sets the result
You have a very interesting project there!
Whats the story of the AlgoTrader github repo? Seems someone didnt like you using that!
How do you get the command response back though within the same C# call?
So C# call to OrderSend waits until MT4 detects the command and sets the result. It must be in a separate thread if it is blocking.
"There is no "same C# call.""?? haha, yes there is!
You are missing the point, that it the goal of my api! The idea of this library it to write code purely in C#, and never touch MQL.
So therefore if I want to call OrderSend in C#, I must have it in a separate thread, as multiple DLL calls from MT4 need to be made during the start and end of the C# method. The C# method blocks, while MT4 does it's stuff.
I'm just offering a different approach. no need to get all black and white about it
I just committed a bunch of the framework stuff. Checkout https://github.com/jseparovic/MQL4CSharp/blob/master/MQL4CSharp/UserDefined/Strategy/MaCrossStrategy.cs
This is the basic idea I'm going for. All the bits should be reusable, and strategies simple to write.
I just tested a REST API too and it works nicely. In the next commit you will be able to run MQL commands from REST. Then I'll add a websockets API for events and onTick RatesInfo. Get some pretty JS frontends happening.
To add comments, please log in or register