HA
Topics
30 Mar 2017, 18:08
2498
2
24 Mar 2017, 22:26
2856
10
Replies
hans177
27 Mar 2017, 15:28
Ok, I managed to do it, without really understanding what I'm doing of course ;)
1. Subscribe to quote updates
2.
private AsyncCallback quoteReceived; ... quoteReceived = new AsyncCallback(OnTick); ... _priceStream.BeginRead(buffer, 0, 1024, quoteReceived, null);
3.
private void OnTick(IAsyncResult ar) { int bytesRead = _priceStream.EndRead(ar); if (bytesRead > 0) { Console.WriteLine(Encoding.ASCII.GetString(buffer, 0, bytesRead)); _priceStream.BeginRead(buffer, 0, 1024, quoteReceived, null); } }
@hans177
hans177
25 Mar 2017, 10:59
I'm quite expierenced in MQL4/5. There you got functions like OnTick(), which is called in case of a new quote. Unfortunately the tutorial isn't really explaining basic stuff about FIX API very well in my opinion. Can I only get a single response to a message I sent or can I get continuos messages (which I assumed 'subscribing to future quote updates' meant)?
@hans177
hans177
30 Mar 2017, 18:37
Nevermind, updated the library. Now everything works.
@hans177