Re: [Quickfix-developers] Simple beginner questions
Brought to you by:
orenmnero
From: <or...@qu...> - 2015-06-11 20:49:07
|
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 |