Re: [Quickfix-developers] Simple beginner questions
Brought to you by:
orenmnero
From: Grant B. <gbi...@co...> - 2015-06-15 14:52:47
|
"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/ > > 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 > 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/ > >> > >> 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 > > > ------------------------------------------------------------------------------ > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > -- Grant Birchmeier *Connamara Systems, LLC* *Made-To-Measure Trading Solutions.* Exactly what you need. No more. No less. http://connamara.com |