Comments (7)
Once I have something worth sharing, I'll send it to you!
from metatrader4-bridge.
@beauxjim if you already can see the id of the request in the C# zeromq package, then you're probably missing the parsing part https://github.com/BonneVoyager/node-mt4-zmq-bridge/blob/master/index.js#L202-L218 which is required by MetaTrader4-Bridge here https://github.com/BonneVoyager/MetaTrader4-Bridge/blob/master/MetaTrader4Bridge.mq4#L188. If the parsed message doesn't recognize supported type, it might not respond due to this piece of code https://github.com/BonneVoyager/MetaTrader4-Bridge/blob/master/MetaTrader4Bridge.mq4#L500-L631.
from metatrader4-bridge.
Thank you for the response.
I will research everything mentioned.
Please note that the MT4 Expert logs show that the message was recognized and that it is responding back with a string such as "2|0|xxxx". In the response of the C# request, I only see "2". In the subscribed pull channel for C#, I see nothing. Your node library is the only thing that has successfully subscribed to the pull channel, however, it also only sees a "2" in the push messages, and that does not matter whether the original request came from the node application or the C# application.
The code above is a working example of my explanation.
Thanks again!
from metatrader4-bridge.
@beauxjim that 0
makes me think that your request doesn't have any type, for example 1
for PING as described in below section:
https://github.com/BonneVoyager/MetaTrader4-Bridge#request
The simplest test scenario would be to send a message with incremented id and type REQUEST_PING, so for example 123|1
(request with id 1 and type of REQUEST_PING). In the response, you should see 123|0|<timestamp>
(because of this), where 123
is an id of your request, 0
is RESPONSE_OK and <timestamp>
is unix epoch.
from metatrader4-bridge.
Thank you again for your response. After thoroughly reviewing the code and stepping through the referenced spots, I can say that the code does understand the request. Also the bridge does say that it is responding with the ping time stamp, however the zmq push message is never received, and the req message only has the id of the message in the response. I've attached a screen shot as a picture is worth a thousand words.
Also here is my pull client code from c#. Is there something blatantly missing?
using (var subSocket = new SubscriberSocket())
{
subSocket.Options.ReceiveHighWatermark = 10;
subSocket.Connect("tcp://127.0.0.1:5556");
subSocket.Subscribe("pull");
Console.WriteLine("Subscriber socket connecting...");
while (true)
{
string messageTopicReceived = subSocket.ReceiveFrameString();
string messageReceived = subSocket.ReceiveFrameString();
Console.WriteLine(messageReceived);
}
}
from metatrader4-bridge.
I figured it out. It was my lack of understanding Zmq. I was trying to to use a Subscrition socket when I should have been using a Pull socket. I can now see the ping response in the c# code with the timestamp.
Thanks again
from metatrader4-bridge.
I'm glad it worked for you @beauxjim
Did you also figure out the C# code for handling the messages? I could potentially add it to this section here https://github.com/BonneVoyager/MetaTrader4-Bridge#libraries if it's made in a reusable way?
from metatrader4-bridge.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metatrader4-bridge.