Re: [Quickfix-developers] Simple beginner questions
Brought to you by:
orenmnero
From: <ja...@sk...> - 2015-06-15 11:47:39
|
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 |