B2BITS FIX Antenna C++  2.31.0
Classes | List of all members
Bats::InstrumentListener Class Referenceabstract

Single instrument observer. More...

#include <B2BITS_BatsUnitService.h>

Classes

struct  InstrumentCtx
 Represents current state of instrument. More...
 
struct  OrderCtx
 Represents current state of a particular ordrer. More...
 

Service notifications

virtual void onReset (ResetReason::Type rr)=0
 Called on reset, might be either single symbol or whole unit reset. More...
 
virtual void onSpinFinished ()
 Called when recovery from Spin server is finished. More...
 
virtual void onUnsubscribed ()
 Called when listener is unsubscribed. More...
 

Auction updates

Auction update messages, these messages are always delivered

virtual void onMessage (const AuctionUpdateMsg *msg, System::u32 seconds, Timestamp &ts)
 
virtual void onMessage (const AuctionSummaryMsg *msg, System::u32 seconds, Timestamp &ts)
 

Raw PITCH messages

The following raw PITCH messages are delivered only if UnitService::subscribeToInstrument has been called with dispatchMessages = true

Parameters
msgRaw PITCH message
secondsLast BATS Unit timestamp, sent via Bats::TimeMsg message
ctxThis value represents current state of this order, before message msg is applied
virtual void onMessage (const AddOrderLongMsg *msg, System::u32 seconds, Timestamp &ts)
 
virtual void onMessage (const AddOrderShortMsg *msg, System::u32 seconds, Timestamp &ts)
 
virtual void onMessage (const AddOrderExpandedMsg *msg, System::u32 seconds, Timestamp &ts)
 
virtual void onMessage (const DeleteMsg *msg, System::u32 seconds, Timestamp &ts, const OrderCtx &ctx)
 
virtual void onMessage (const OrderExecutedMsg *msg, System::u32 seconds, Timestamp &ts, const OrderCtx &ctx)
 
virtual void onMessage (const OrderExecutedAtPriceSizeMsg *msg, System::u32 seconds, Timestamp &ts, const OrderCtx &ctx)
 
virtual void onMessage (const ReduceSizeLongMsg *msg, System::u32 seconds, Timestamp &ts, const OrderCtx &ctx)
 
virtual void onMessage (const ReduceSizeShortMsg *msg, System::u32 seconds, Timestamp &ts, const OrderCtx &ctx)
 
virtual void onMessage (const ModifyLongMsg *msg, System::u32 seconds, Timestamp &ts, const OrderCtx &ctx)
 
virtual void onMessage (const ModifyShortMsg *msg, System::u32 seconds, Timestamp &ts, const OrderCtx &ctx)
 
virtual void onMessage (const TradingStatusMsg *msg, System::u32 seconds, Timestamp &ts)
 
virtual void onMessage (const TradeExpandedMsg *msg, System::u32 seconds, Timestamp &ts)
 
virtual void onMessage (const TradeLongMsg *msg, System::u32 seconds, Timestamp &ts)
 
virtual void onMessage (const TradeShortMsg *msg, System::u32 seconds, Timestamp &ts)
 

Order book incremental updates

The following updates are delivered only if UnitService::subscribeToInstrument has been called with depth > 0

Parameters
iCtxCurrent instrument context
ctxThis value represents aggregate state on this price level
ordersNumber of orders on this price level
levelPrice level > 0, top level = 1
side'B' or 'S' side
virtual void addBookItem (const InstrumentCtx &iCtx, const OrderCtx &ctx, System::u32 orders, System::u16 level, Timestamp &ts)=0
 
virtual void changeBookItem (const InstrumentCtx &iCtx, const OrderCtx &ctx, System::u32 orders, System::u16 level, Timestamp &ts)=0
 
virtual void removeBookItem (const InstrumentCtx &iCtx, char side, System::u16 level, Timestamp &ts)=0
 
virtual void onTrade (const InstrumentCtx &iCtx, Timestamp &ts)
 
virtual void onTradingStatus (const InstrumentCtx &iCtx, Timestamp &ts)
 

Detailed Description

Single instrument observer.

Member Function Documentation

◆ addBookItem()

virtual void Bats::InstrumentListener::addBookItem ( const InstrumentCtx iCtx,
const OrderCtx ctx,
System::u32  orders,
System::u16  level,
Timestamp ts 
)
pure virtual

◆ changeBookItem()

virtual void Bats::InstrumentListener::changeBookItem ( const InstrumentCtx iCtx,
const OrderCtx ctx,
System::u32  orders,
System::u16  level,
Timestamp ts 
)
pure virtual

◆ onMessage() [1/16]

virtual void Bats::InstrumentListener::onMessage ( const AuctionUpdateMsg msg,
System::u32  seconds,
Timestamp ts 
)
inlinevirtual

◆ onMessage() [2/16]

virtual void Bats::InstrumentListener::onMessage ( const AuctionSummaryMsg msg,
System::u32  seconds,
Timestamp ts 
)
inlinevirtual

◆ onMessage() [3/16]

virtual void Bats::InstrumentListener::onMessage ( const AddOrderLongMsg msg,
System::u32  seconds,
Timestamp ts 
)
inlinevirtual

◆ onMessage() [4/16]

virtual void Bats::InstrumentListener::onMessage ( const AddOrderShortMsg msg,
System::u32  seconds,
Timestamp ts 
)
inlinevirtual

◆ onMessage() [5/16]

virtual void Bats::InstrumentListener::onMessage ( const AddOrderExpandedMsg msg,
System::u32  seconds,
Timestamp ts 
)
inlinevirtual

◆ onMessage() [6/16]

virtual void Bats::InstrumentListener::onMessage ( const DeleteMsg msg,
System::u32  seconds,
Timestamp ts,
const OrderCtx ctx 
)
inlinevirtual

◆ onMessage() [7/16]

virtual void Bats::InstrumentListener::onMessage ( const OrderExecutedMsg msg,
System::u32  seconds,
Timestamp ts,
const OrderCtx ctx 
)
inlinevirtual

◆ onMessage() [8/16]

virtual void Bats::InstrumentListener::onMessage ( const OrderExecutedAtPriceSizeMsg msg,
System::u32  seconds,
Timestamp ts,
const OrderCtx ctx 
)
inlinevirtual

◆ onMessage() [9/16]

virtual void Bats::InstrumentListener::onMessage ( const ReduceSizeLongMsg msg,
System::u32  seconds,
Timestamp ts,
const OrderCtx ctx 
)
inlinevirtual

◆ onMessage() [10/16]

virtual void Bats::InstrumentListener::onMessage ( const ReduceSizeShortMsg msg,
System::u32  seconds,
Timestamp ts,
const OrderCtx ctx 
)
inlinevirtual

◆ onMessage() [11/16]

virtual void Bats::InstrumentListener::onMessage ( const ModifyLongMsg msg,
System::u32  seconds,
Timestamp ts,
const OrderCtx ctx 
)
inlinevirtual

◆ onMessage() [12/16]

virtual void Bats::InstrumentListener::onMessage ( const ModifyShortMsg msg,
System::u32  seconds,
Timestamp ts,
const OrderCtx ctx 
)
inlinevirtual

◆ onMessage() [13/16]

virtual void Bats::InstrumentListener::onMessage ( const TradingStatusMsg msg,
System::u32  seconds,
Timestamp ts 
)
inlinevirtual

◆ onMessage() [14/16]

virtual void Bats::InstrumentListener::onMessage ( const TradeExpandedMsg msg,
System::u32  seconds,
Timestamp ts 
)
inlinevirtual

◆ onMessage() [15/16]

virtual void Bats::InstrumentListener::onMessage ( const TradeLongMsg msg,
System::u32  seconds,
Timestamp ts 
)
inlinevirtual

◆ onMessage() [16/16]

virtual void Bats::InstrumentListener::onMessage ( const TradeShortMsg msg,
System::u32  seconds,
Timestamp ts 
)
inlinevirtual

◆ onReset()

virtual void Bats::InstrumentListener::onReset ( ResetReason::Type  rr)
pure virtual

Called on reset, might be either single symbol or whole unit reset.

◆ onSpinFinished()

virtual void Bats::InstrumentListener::onSpinFinished ( )
inlinevirtual

Called when recovery from Spin server is finished.

◆ onTrade()

virtual void Bats::InstrumentListener::onTrade ( const InstrumentCtx iCtx,
Timestamp ts 
)
inlinevirtual

◆ onTradingStatus()

virtual void Bats::InstrumentListener::onTradingStatus ( const InstrumentCtx iCtx,
Timestamp ts 
)
inlinevirtual

◆ onUnsubscribed()

virtual void Bats::InstrumentListener::onUnsubscribed ( )
inlinevirtual

Called when listener is unsubscribed.

Listener is not used by service after this call, you may call delete this from it. When service is being destroyed it automatically unsubscribes all listeners.

◆ removeBookItem()

virtual void Bats::InstrumentListener::removeBookItem ( const InstrumentCtx iCtx,
char  side,
System::u16  level,
Timestamp ts 
)
pure virtual