/
How to get MDEntryTime with nanosecond precision using Spectra API
How to get MDEntryTime with nanosecond precision using Spectra API
MOEX Market Data Multicast FIX/FAST Platform uses custom UTCTimeOnly, UTCTimestamp format in the FAST messages.
Please refer to the official documentation for more details: http://ftp.moex.com/pub/FAST/Spectra e.g. http://ftp.moex.com/pub/FAST/Spectra/prod/docs/spectra_fastgate_en.pdf
Example of handling time from MDEntryTime
Application.cpp
void ConvertTimeToStr(System::u64 entry, std::string* strTime) { static std::size_t const TIME_LENGTH = sizeof( "HHMMSSsssssssss" ) - 1; std::stringstream stream; stream << entry; // convert u64 to std::string. std::string time(stream.str()); if (TIME_LENGTH > time.size()) time.insert(0, TIME_LENGTH - time.size(), '0'); strTime->assign(time, 0, 2); // HH strTime->append( ":"); strTime->append(time, 2, 2); // MM strTime->append( ":"); strTime->append(time, 4, 2); // SS strTime->append( "."); strTime->append(time, 6, 9); // sssssssss } bool InstrumentHandler::onIncrement( Spectra::SpectraSubscriptionItem const& subsItem, Engine::FIXMessage const* const* msgs, size_t incrementsCount ) { // ... for( ; i < incrementsCount; ++i ) { const Engine::FIXGroup& gr = msgs[i].getAsGroup( FIXFields::NoMDEntries ); for( int j = 0; j < gr.size(); ++j ) { const Engine::TagValue& entry = *gr.getEntry(j); std::string timeNs; if (entry.hasValue(FIXFields::MDEntryTime)) ConvertTimeToStr(entry.getAsUInt64(FIXFields::MDEntryTime), &timeNs); // .. } } // ... }
, multiple selections available,
Related content
How to Use RX/TX Network Timestamping in FIXAntenna C++
How to Use RX/TX Network Timestamping in FIXAntenna C++
More like this
How to measure and reduce latency in FIX Antenna HFT
How to measure and reduce latency in FIX Antenna HFT
More like this
How to use Spectra Application Listener callbacks
How to use Spectra Application Listener callbacks
More like this
"How to" for MOEX Spectra MD Adapter
"How to" for MOEX Spectra MD Adapter
More like this
MOEX Spectra Market Data Adapter
MOEX Spectra Market Data Adapter
More like this
CME MDP3 C++ - Release Notes
CME MDP3 C++ - Release Notes
More like this