Re: [Quickfix-developers] Simple beginner questions
Brought to you by:
orenmnero
From: <ja...@sk...> - 2015-06-15 16:01:09
|
Yes, I do understand that I'm trying to extract field 268, which is the NoMDEntries. However, I'm not sure why it is not set in this case, and when I print out the value of NoMDEntries, it gave me 0. What I really need is in field 270, MDEntryPx, but I'm not able to retrieve this information. Apparently, I'm able to receive the field 270 from the Market Data Snapshot request reply, but not field 268, which I have to refer to as a group in order to retrieve it. I am able to provide the message given by the server. 15:56:20.567 262=MARKETDATAID 55=F.US.GCEQ15 387=104656 268=1 269=0 290=1 270=1188.6000 271=26 10=123 I am using the below code to retrieve field 270. void Application::onMessage (const FIX42::MarketDataSnapshotFullRefresh& message, const FIX::SessionID&) { FIX42::MarketDataSnapshotFullRefresh::NoMDEntries group; FIX::MDEntryType MDEntryType; FIX::MDEntryPx MDEntryPx; FIX::MDEntrySize MDEntrySize; FIX::OrderID orderID; message.getGroup(0, group); group.get(MDEntryType); group.get(MDEntryPx); group.get(MDEntrySize); group.get(orderID); } However, I am unable to retrieve the value in field 270. Please advise. On 2015-06-15 22:52, Grant Birchmeier wrote: > "conditionally required field missing" means that YOU are trying to > extract a field that is not in the message. This field is apparently > optional for the message you are decoding. Since you've tried to > extract it and it's not there, QF assumes that YOU are requiring it, > hence "conditionally required". > > Without seeing your code or your message, I can't tell you much. You > need to look at the message you actually received. Is 268 actually > there? > > On Mon, Jun 15, 2015 at 6:47 AM, <ja...@sk...> wrote: > >> QuickFIX Documentation: >> http://www.quickfixengine.org/quickfix/doc/html/ [1] >> >> I have followed your advice on including the header file and also >> followed the example on receiving messages in the documentation. >> However, I have the problem of conditionally required field missing >> (268). >> I have googled the problem and a similar issue was found here. >> > http://stackoverflow.com/questions/26937458/quickfix-error-58-conditionally-required-field-missing-268 >> [2] >> Will it be possible to get only the field 270 from the reply >> message, or >> what should I need to do in order to just get the market value? >> >> On 2015-06-12 04:32, or...@qu... wrote: >>> For your first example, I think you are probably just not >> including the >>> proper header file for that message. >>> >>> #include <quickfix/fix42/MarketDataSnapshotFullRefresh.h> >>> >>> The message cracker just uses forward declarations, you need to >> include >>> the header to actually use the object. >>> >>> For your second example, field 270 is not a header field, nor can >> it be >>> accessed directly from the message since it is a repeating group. >>> Instead of dealing with this however, I would recommend just >> including >>> the proper header file and continue on with your first approach. >>> >>> >>>> -------- Original Message -------- >>>> Subject: [Quickfix-developers] Simple beginner questions >>>> From: ja...@sk... >>>> Date: Thu, June 11, 2015 3:17 pm >>>> To: qui...@li... >>>> >>>> >>>> QuickFIX Documentation: >>>> http://www.quickfixengine.org/quickfix/doc/html/ [1] >>>> >>>> Hi, >>>> >>>> Currently I'm trying to obtain the market value of a symbol from >> a >>>> reply >>>> message from a server, however, I'm not sure on how to obtain >> the >>>> value >>>> in field 270(MDEntryPx). >>>> >>>> void Application::onMessage >>>> (const FIX42::MarketDataSnapshotFullRefresh& message, const >>>> FIX::SessionID&) { >>>> FIX::NoMDEntries noMDEntries; >>>> message.get(noMDEntries); // incomplete type is not allowed >>>> } >>>> >>>> when I typed in the above code in my application.cpp, I could >> not >>>> compile due to the error commented. >>>> >>>> >>>> void Application::fromApp(const FIX::Message& message, const >>>> FIX::SessionID& sessionID) >>>> throw(FIX::FieldNotFound, FIX::IncorrectDataFormat, >>>> FIX::IncorrectTagValue, FIX::UnsupportedMessageType) >>>> { >>>> crack(message, sessionID); >>>> std::cout << std::endl << "IN: " << message << std::endl; >>>> FIX::MsgType msgType; >>>> message.getHeader().getField(msgType); >>>> if (msgType.getValue() == "W"){ >>>> std::string value = message.getHeader().getField(270); >> //MDEntryPx >>>> mkval = std::stod(value); //mkval is a double >>>> } >>>> } >>>> >>>> when I used the above code, I could compile and run, but when it >>>> reached >>>> the line std::string value = >>>> message.getHeader().getField(270); >>>> I received an toApp message with 58=Conditionally Required Field >>>> Missing >>>> <270> >>>> >>>> May I know what I can change in order to be able to store the >> symbol >>>> price into a double object? >>>> >>>> >>>> >> > ------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> Quickfix-developers mailing list >>>> Qui...@li... >>>> https://lists.sourceforge.net/lists/listinfo/quickfix-developers >> [3] >> >> > ------------------------------------------------------------------------------ >> _______________________________________________ >> Quickfix-developers mailing list >> Qui...@li... >> https://lists.sourceforge.net/lists/listinfo/quickfix-developers >> [3] > > -- > > Grant Birchmeier > > CONNAMARA SYSTEMS, LLC > > MADE-TO-MEASURE TRADING SOLUTIONS. > Exactly what you need. No more. No less. > > http://connamara.com [4] > > > Links: > ------ > [1] http://www.quickfixengine.org/quickfix/doc/html/ > [2] > http://stackoverflow.com/questions/26937458/quickfix-error-58-conditionally-required-field-missing-268 > [3] https://lists.sourceforge.net/lists/listinfo/quickfix-developers > [4] http://connamara.com |