9 #ifndef CPPTRADER_ITCH_HANDLER_H
10 #define CPPTRADER_ITCH_HANDLER_H
12 #include "utility/endian.h"
13 #include "utility/iostream.h"
34 template <
class TOutputStream>
60 template <
class TOutputStream>
76 template <
class TOutputStream>
90 template <
class TOutputStream>
107 template <
class TOutputStream>
122 template <
class TOutputStream>
135 template <
class TOutputStream>
151 template <
class TOutputStream>
168 template <
class TOutputStream>
186 template <
class TOutputStream>
201 template <
class TOutputStream>
218 template <
class TOutputStream>
232 template <
class TOutputStream>
245 template <
class TOutputStream>
261 template <
class TOutputStream>
279 template <
class TOutputStream>
296 template <
class TOutputStream>
309 template <
class TOutputStream>
330 template <
class TOutputStream>
344 template <
class TOutputStream>
361 template <
class TOutputStream>
370 template <
class TOutputStream>
404 bool Process(
void* buffer,
size_t size);
443 std::vector<uint8_t> _cache;
445 bool ProcessSystemEventMessage(
void* buffer,
size_t size);
446 bool ProcessStockDirectoryMessage(
void* buffer,
size_t size);
447 bool ProcessStockTradingActionMessage(
void* buffer,
size_t size);
448 bool ProcessRegSHOMessage(
void* buffer,
size_t size);
449 bool ProcessMarketParticipantPositionMessage(
void* buffer,
size_t size);
450 bool ProcessMWCBDeclineMessage(
void* buffer,
size_t size);
451 bool ProcessMWCBStatusMessage(
void* buffer,
size_t size);
452 bool ProcessIPOQuotingMessage(
void* buffer,
size_t size);
453 bool ProcessAddOrderMessage(
void* buffer,
size_t size);
454 bool ProcessAddOrderMPIDMessage(
void* buffer,
size_t size);
455 bool ProcessOrderExecutedMessage(
void* buffer,
size_t size);
456 bool ProcessOrderExecutedWithPriceMessage(
void* buffer,
size_t size);
457 bool ProcessOrderCancelMessage(
void* buffer,
size_t size);
458 bool ProcessOrderDeleteMessage(
void* buffer,
size_t size);
459 bool ProcessOrderReplaceMessage(
void* buffer,
size_t size);
460 bool ProcessTradeMessage(
void* buffer,
size_t size);
461 bool ProcessCrossTradeMessage(
void* buffer,
size_t size);
462 bool ProcessBrokenTradeMessage(
void* buffer,
size_t size);
463 bool ProcessNOIIMessage(
void* buffer,
size_t size);
464 bool ProcessRPIIMessage(
void* buffer,
size_t size);
465 bool ProcessLULDAuctionCollarMessage(
void* buffer,
size_t size);
466 bool ProcessUnknownMessage(
void* buffer,
size_t size);
469 size_t ReadString(
const void* buffer,
char (&str)[N]);
470 size_t ReadTimestamp(
const void* buffer, uint64_t& value);
NASDAQ ITCH handler class.
virtual bool onMessage(const AddOrderMPIDMessage &message)
virtual bool onMessage(const OrderDeleteMessage &message)
virtual bool onMessage(const SystemEventMessage &message)
virtual bool onMessage(const RPIIMessage &message)
ITCHHandler & operator=(ITCHHandler &&)=delete
bool ProcessMessage(void *buffer, size_t size)
Process a single message from the given buffer in ITCH format and call corresponding handlers.
virtual bool onMessage(const NOIIMessage &message)
virtual bool onMessage(const OrderExecutedMessage &message)
virtual bool onMessage(const UnknownMessage &message)
virtual bool onMessage(const OrderExecutedWithPriceMessage &message)
virtual ~ITCHHandler()=default
virtual bool onMessage(const IPOQuotingMessage &message)
virtual bool onMessage(const StockTradingActionMessage &message)
ITCHHandler(ITCHHandler &&)=delete
virtual bool onMessage(const OrderReplaceMessage &message)
virtual bool onMessage(const StockDirectoryMessage &message)
virtual bool onMessage(const MarketParticipantPositionMessage &message)
virtual bool onMessage(const LULDAuctionCollarMessage &message)
ITCHHandler & operator=(const ITCHHandler &)=delete
virtual bool onMessage(const RegSHOMessage &message)
bool Process(void *buffer, size_t size)
Process all messages from the given buffer in ITCH format and call corresponding handlers.
ITCHHandler(const ITCHHandler &)=delete
virtual bool onMessage(const MWCBDeclineMessage &message)
virtual bool onMessage(const CrossTradeMessage &message)
virtual bool onMessage(const TradeMessage &message)
void Reset()
Reset ITCH handler.
virtual bool onMessage(const MWCBStatusMessage &message)
virtual bool onMessage(const AddOrderMessage &message)
virtual bool onMessage(const OrderCancelMessage &message)
virtual bool onMessage(const BrokenTradeMessage &message)
NASDAQ ITCH handler inline implementation.
C++ Trader project definitions.
Add Order with MPID Attribution Message.
friend TOutputStream & operator<<(TOutputStream &stream, const AddOrderMPIDMessage &message)
uint64_t OrderReferenceNumber
friend TOutputStream & operator<<(TOutputStream &stream, const AddOrderMessage &message)
uint64_t OrderReferenceNumber
friend TOutputStream & operator<<(TOutputStream &stream, const BrokenTradeMessage &message)
friend TOutputStream & operator<<(TOutputStream &stream, const CrossTradeMessage &message)
IPO Quoting Period Update Message.
friend TOutputStream & operator<<(TOutputStream &stream, const IPOQuotingMessage &message)
Limit Up – Limit Down (LULD) Auction Collar Message.
uint32_t UpperAuctionCollarPrice
uint32_t AuctionCollarExtension
uint32_t LowerAuctionCollarPrice
uint32_t AuctionCollarReferencePrice
friend TOutputStream & operator<<(TOutputStream &stream, const LULDAuctionCollarMessage &message)
MWCB Decline Level Message.
friend TOutputStream & operator<<(TOutputStream &stream, const MWCBDeclineMessage &message)
friend TOutputStream & operator<<(TOutputStream &stream, const MWCBStatusMessage &message)
Market Participant Position Message.
friend TOutputStream & operator<<(TOutputStream &stream, const MarketParticipantPositionMessage &message)
char MarketParticipantState
Net Order Imbalance Indicator (NOII) Message.
char PriceVariationIndicator
uint32_t CurrentReferencePrice
friend TOutputStream & operator<<(TOutputStream &stream, const NOIIMessage &message)
friend TOutputStream & operator<<(TOutputStream &stream, const OrderCancelMessage &message)
uint64_t OrderReferenceNumber
friend TOutputStream & operator<<(TOutputStream &stream, const OrderDeleteMessage &message)
uint64_t OrderReferenceNumber
friend TOutputStream & operator<<(TOutputStream &stream, const OrderExecutedMessage &message)
uint64_t OrderReferenceNumber
Order Executed With Price Message.
uint64_t OrderReferenceNumber
friend TOutputStream & operator<<(TOutputStream &stream, const OrderExecutedWithPriceMessage &message)
uint64_t OriginalOrderReferenceNumber
uint64_t NewOrderReferenceNumber
friend TOutputStream & operator<<(TOutputStream &stream, const OrderReplaceMessage &message)
Retail Price Improvement Indicator (RPII) Message.
friend TOutputStream & operator<<(TOutputStream &stream, const RPIIMessage &message)
Reg SHO Short Sale Price Test Restricted Indicator Message.
friend TOutputStream & operator<<(TOutputStream &stream, const RegSHOMessage &message)
friend TOutputStream & operator<<(TOutputStream &stream, const StockDirectoryMessage &message)
uint32_t ETPLeverageFactor
char LULDReferencePriceTier
char ShortSaleThresholdIndicator
char FinancialStatusIndicator
Stock Trading Action Message.
friend TOutputStream & operator<<(TOutputStream &stream, const StockTradingActionMessage &message)
friend TOutputStream & operator<<(TOutputStream &stream, const SystemEventMessage &message)
uint64_t OrderReferenceNumber
friend TOutputStream & operator<<(TOutputStream &stream, const TradeMessage &message)
friend TOutputStream & operator<<(TOutputStream &stream, const UnknownMessage &message)