0

I use the following code currently to get the current prices. Then I receive the values on the public void OnMessage(QuickFix.FIX44.MassQuote m, SessionID s)

            QuickFix.FIX44.MarketDataRequest msg = new QuickFix.FIX44.MarketDataRequest();

            // Fill message fields
            msg.SetField(new MDReqID("001"));
            msg.SetField(new SubscriptionRequestType('1'));
            msg.SetField(new MarketDepth(0));
            msg.SetField(new MDUpdateType(MDUpdateType.FULL_REFRESH));

            // Add the MDEntryTypes group
            QuickFix.FIX44.MarketDataRequest.NoMDEntryTypesGroup noMDEntryTypes = new QuickFix.FIX44.MarketDataRequest.NoMDEntryTypesGroup();
            noMDEntryTypes.SetField(new MDEntryType('0'));
            msg.AddGroup(noMDEntryTypes);

            // Add the NoRelatedSym group
            QuickFix.FIX44.MarketDataRequest.NoRelatedSymGroup noRelatedSym = new QuickFix.FIX44.MarketDataRequest.NoRelatedSymGroup();
            noRelatedSym.SetField(new Symbol(pair.Insert(3, "/")));
            msg.AddGroup(noRelatedSym);


            Console.WriteLine("Sending Market Request...");
            if(!_priceSession.SendRedundantResendRequests) _priceSession.SendRedundantResendRequests = true;
            SendMessagePrice(msg);

But this method is not ideal for me. I want to be able to see the current prices as soon as they update. In this small example, I would like to Console.WriteLine() the latest Bid/Offer prices to the console as soon as they update(I want to see the prices of only one currency pair at a time).

It would be great if someone can suggest a better way to get the data more quickly and easily.

Thank you in advance.

EDIT: Response from the server

8=FIX.4.4|9=378|35=i|34=2|49=XXXXX|52=20200122-10:09:26.537|56=QXXX|117=1|296=1|302=001|295=5|299=0|106=0|134=2000000|135=1000000|188=1.10914|190=1.10916|299=1|106=10|134=1800000|135=1000000|188=1.10914|190=1.10916|299=2|106=11|134=1500000|135=500000|188=1.10914|190=1.10916|299=3|106=6|134=1000000|135=100000|188=1.10914|190=1.10916|299=4|106=6|134=2000000|135=5400000|188=1.10913|190=1.10917|10=113|

EDIT: After a while, I get this error after receiving this message from the counterparty

Message Received

incoming: 8=FIX.4.4|9=502|35=W|34=7|49=XXXXX|52=20200122-10:09:28.074|56=QXXX|55=EUR/USD|262=001|268=10|269=0|270=1.10914|271=1700000|299=1|106=6|269=0|270=1.10914|271=1000000|299=3|106=11|269=0|270=1.10914|271=1000000|299=0|106=10|269=0|270=1.10913|271=3000000|299=4|106=10|269=0|270=1.10913|271=1500000|299=2|106=9|269=1|270=1.10916|271=1000000|299=0|106=0|269=1|270=1.10916|271=1000000|299=1|106=10|269=1|270=1.10916|271=500000|299=2|106=11|269=1|270=1.10916|271=100000|299=3|106=6|269=1|270=1.10917|271=4500000|299=4|106=13|10=232

event: Message 7 Rejected: Tag appears more than once (Field=106)

Christoph John
  • 3,003
  • 2
  • 13
  • 23
TheLastStark
  • 770
  • 5
  • 18
  • 1
    What do you mean by "see the current prices as soon as they update"? You are sending a MarketDataRequest with SubscriptionRequestType 1 (Snapshot + Updates) which means that you will get a message as soon as there are updates. – Christoph John Jan 22 '20 at 09:24
  • Thank you for the response. But I do not get updates. I only get the response from the server only just after I send the request – TheLastStark Jan 22 '20 at 09:28
  • 1
    Then there either are no updates for that instrument or your counterparty is behaving wrongly. Are you sure that you send the request with a valid instrument? Edit: what does the response from the server look like? Could you please add it to your question? – Christoph John Jan 22 '20 at 09:45
  • Sure I will add the initial response I got when I send the first MarketData Request – TheLastStark Jan 22 '20 at 09:58
  • 1
    The first is a MassQuote. The second is the MarketDataSnapshotFullRefresh. It contains the price updates. But you do not process it correctly but reject it. That's the reason why you are not seeing the updates in your application. Looks like your data dictionary is not matching the messages that your counterparty sends. You should take a look at their rules of engagement and update your dictionary accordingly. – Christoph John Jan 22 '20 at 10:22
  • I see, so if I update the DataDictionary. That Reject message won't be appearing? – TheLastStark Jan 22 '20 at 10:28
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/206433/discussion-between-thelaststark-and-christoph-john). – TheLastStark Jan 22 '20 at 10:43

1 Answers1

1

Since you are using PrimeXM the market data updates are conveyed a little differently. They are sending MassQuote messages (msgtype i) which you need to reply with a MassQuoteAck message (msgtype b).

Remember to echo back the 117/QuoteID from the MassQuote on the MassQuoteAck.

That should cause the price updates to come in constantly. I assume PrimeXM is waiting for each ACK before sending out new updates.

Christoph John
  • 3,003
  • 2
  • 13
  • 23