Spread order event is a snapshot for a full available market depth for all spreads on a given underlying symbol.
More...
|
void * | toGraal () const override |
| Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
|
|
| SpreadOrder () noexcept=default |
| Creates new spread order event with default values.
|
|
| SpreadOrder (std::string eventSymbol) noexcept |
| Creates new spread order event with the specified event symbol.
|
|
SpreadOrder & | withEventSymbol (const std::string &eventSymbol) noexcept |
| Changes event's symbol and returns the current spread order.
|
|
SpreadOrder & | withEventTime (std::int64_t eventTime) noexcept |
| Changes event's creation time and returns the current spread order.
|
|
SpreadOrder & | withSource (const OrderSource &source) noexcept |
| Changes event's source and returns the current spread order.
|
|
SpreadOrder & | withEventFlags (std::int32_t eventFlags) noexcept |
| Changes transactional event flags and returns the current spread order.
|
|
SpreadOrder & | withEventFlags (const EventFlagsMask &eventFlags) noexcept |
| Changes transactional event flags and returns the current spread order.
|
|
SpreadOrder & | withIndex (std::int64_t index) noexcept |
| Changes unique per-symbol index of this spread order and returns it.
|
|
SpreadOrder & | withTime (std::int64_t time) noexcept |
| Changes time of this spread order and returns it.
|
|
SpreadOrder & | withTimeNanoPart (std::int32_t timeNanoPart) noexcept |
| Changes microseconds and nanoseconds time part of this spread order.
|
|
SpreadOrder & | withSequence (std::int32_t sequence) noexcept |
| Changes sequence number of this spread order.
|
|
SpreadOrder & | withTimeNanos (std::int64_t timeNanos) noexcept |
| Changes time of this spread order and returns it.
|
|
SpreadOrder & | withAction (const OrderAction &action) noexcept |
| Changes action of this spread order and returns it.
|
|
SpreadOrder & | withActionTime (std::int64_t actionTime) noexcept |
| Changes time of the last action and returns current spread order.
|
|
SpreadOrder & | withOrderId (std::int64_t orderId) noexcept |
| Changes order ID.
|
|
SpreadOrder & | withAuxOrderId (std::int64_t auxOrderId) noexcept |
| Changes auxiliary spread order ID.
|
|
SpreadOrder & | withPrice (double price) noexcept |
| Changes price of this spread order.
|
|
SpreadOrder & | withSize (double size) noexcept |
| Changes size of this spread order.
|
|
SpreadOrder & | withExecutedSize (double executedSize) noexcept |
| Changes executed size of this spread order.
|
|
SpreadOrder & | withCount (std::int64_t count) noexcept |
| Changes number of individual spread orders in this aggregate spread order.
|
|
SpreadOrder & | withTradeId (std::int64_t tradeId) noexcept |
| Changes trade ID.
|
|
SpreadOrder & | withTradePrice (double tradePrice) noexcept |
| Changes trade price.
|
|
SpreadOrder & | withTradeSize (double tradeSize) noexcept |
| Changes trade size.
|
|
SpreadOrder & | withExchangeCode (char exchangeCode) noexcept |
| Changes exchange code of this spread order.
|
|
SpreadOrder & | withExchangeCode (std::int16_t exchangeCode) noexcept |
| Changes exchange code of this spread order.
|
|
SpreadOrder & | withOrderSide (const Side &side) noexcept |
| Changes side of this spread order.
|
|
SpreadOrder & | withScope (const Scope &scope) noexcept |
| Changes scope of this spread order.
|
|
const std::string & | getSpreadSymbol () const &noexcept |
| Returns spread symbol of this event.
|
|
const std::optional< std::string > & | getSpreadSymbolOpt () const &noexcept |
| Returns spread symbol of this event.
|
|
void | setSpreadSymbol (std::string spreadSymbol) noexcept |
| Changes spread symbol of this event.
|
|
SpreadOrder & | withSpreadSymbol (std::string spreadSymbol) noexcept |
| Changes spread symbol of this event.
|
|
std::string | toString () const noexcept override |
| Returns a string representation of the current object.
|
|
| OrderBase () noexcept=default |
| Creates new order event with default values.
|
|
| OrderBase (std::string eventSymbol) noexcept |
| Creates new order event with the specified event symbol.
|
|
const OrderSource & | getSource () const &noexcept override |
| Returns source of this event.
|
|
void | setSource (const OrderSource &source) noexcept |
| Changes source of this event.
|
|
std::int32_t | getEventFlags () const noexcept override |
| Returns transactional event flags.
|
|
EventFlagsMask | getEventFlagsMask () const noexcept override |
| Returns transactional event flags.
|
|
void | setEventFlags (std::int32_t eventFlags) noexcept override |
| Changes transactional event flags.
|
|
void | setEventFlags (const EventFlagsMask &eventFlags) noexcept override |
| Changes transactional event flags.
|
|
void | setIndex (std::int64_t index) override |
| Changes unique per-symbol index of this order.
|
|
std::int64_t | getIndex () const noexcept override |
| Returns unique per-symbol index of this order.
|
|
std::int64_t | getTimeSequence () const noexcept |
| Returns time and sequence of this order packaged into single long value.
|
|
void | setTimeSequence (std::int64_t timeSequence) noexcept |
| Changes time and sequence of this order.
|
|
std::int64_t | getTime () const noexcept |
| Returns time of this order.
|
|
void | setTime (std::int64_t time) noexcept |
| Changes time of this order.
|
|
void | setTimeNanoPart (std::int32_t timeNanoPart) noexcept |
| Changes microseconds and nanoseconds time part of this order.
|
|
std::int32_t | getTimeNanoPart () const noexcept |
| Returns microseconds and nanoseconds time part of this order.
|
|
std::int32_t | getSequence () const noexcept |
| Returns sequence number of this order to distinguish orders that have the same time.
|
|
void | setSequence (std::int32_t sequence) |
| Changes sequence number of this order.
|
|
std::int64_t | getTimeNanos () const noexcept |
| Returns time of this order in nanoseconds.
|
|
void | setTimeNanos (std::int64_t timeNanos) noexcept |
| Changes time of this order.
|
|
const OrderAction & | getAction () const &noexcept |
| Returns order action if available, otherwise - OrderAction::UNDEFINED.
|
|
void | setAction (const OrderAction &action) noexcept |
| Changes action of this order.
|
|
std::int64_t | getActionTime () const noexcept |
| Returns time of the last action.
|
|
void | setActionTime (std::int64_t actionTime) noexcept |
| Changes time of the last action.
|
|
std::int64_t | getOrderId () const noexcept |
| Returns order ID if available.
|
|
void | setOrderId (std::int64_t orderId) noexcept |
| Changes order ID.
|
|
std::int64_t | getAuxOrderId () const noexcept |
| Returns auxiliary order ID if available:
|
|
void | setAuxOrderId (std::int64_t auxOrderId) noexcept |
| Changes auxiliary order ID.
|
|
double | getPrice () const noexcept |
| Returns price of this order.
|
|
void | setPrice (double price) noexcept |
| Changes price of this order.
|
|
double | getSize () const noexcept |
| Returns size of this order.
|
|
void | setSize (double size) noexcept |
| Changes size of this order.
|
|
bool | hasSize () const noexcept |
| Returns true if this order has some size (sizeAsDouble is neither 0 nor NaN ).
|
|
double | getExecutedSize () const noexcept |
| Returns executed size of this order.
|
|
void | setExecutedSize (double executedSize) noexcept |
| Changes executed size of this order.
|
|
std::int64_t | getCount () const noexcept |
| Returns number of individual orders in this aggregate order.
|
|
void | setCount (std::int64_t count) noexcept |
| Changes number of individual orders in this aggregate order.
|
|
std::int64_t | getTradeId () const noexcept |
| Returns trade (order execution) ID for events containing trade-related action.
|
|
void | setTradeId (std::int64_t tradeId) noexcept |
| Changes trade ID.
|
|
double | getTradePrice () const noexcept |
| Returns trade price for events containing trade-related action.
|
|
void | setTradePrice (double tradePrice) noexcept |
| Changes trade price.
|
|
double | getTradeSize () const noexcept |
| Returns trade size for events containing trade-related action.
|
|
void | setTradeSize (double tradeSize) noexcept |
| Changes trade size.
|
|
std::int16_t | getExchangeCode () const noexcept |
| Returns exchange code of this order.
|
|
std::string | getExchangeCodeString () const noexcept |
| Returns exchange code of this order as UTF8 string.
|
|
void | setExchangeCode (char exchangeCode) |
| Changes exchange code of this order.
|
|
void | setExchangeCode (std::int16_t exchangeCode) noexcept |
| Changes exchange code of this order.
|
|
const Side & | getOrderSide () const &noexcept |
| Returns side of this order.
|
|
void | setOrderSide (const Side &side) noexcept |
| Changes side of this order.
|
|
const Scope & | getScope () const &noexcept |
| Returns scope of this order.
|
|
void | setScope (const Scope &scope) noexcept |
| Changes scope of this order.
|
|
std::string | baseFieldsToString () const noexcept |
| Returns string representation of this order event's fields.
|
|
const std::string & | getEventSymbol () const &noexcept override |
| Returns symbol of this event.
|
|
const std::optional< std::string > & | getEventSymbolOpt () const &noexcept override |
| Returns symbol of this event.
|
|
void | setEventSymbol (const std::string &eventSymbol) noexcept override |
| Changes symbol of this event.
|
|
std::int64_t | getEventTime () const noexcept override |
| Returns time when event was created or zero when time is not available.
|
|
void | setEventTime (std::int64_t eventTime) noexcept override |
| Changes event creation time.
|
|
template<typename T > |
bool | is () const noexcept |
| Checks that pointer to the current type could be converted to type T* In other words: whether type T belongs to the type hierarchy in which the current type resides.
|
|
template<typename T > |
std::shared_ptr< T > | sharedAs () noexcept |
| Returns a pointer to the current object wrapped in a smart pointer to type T.
|
|
template<typename T > |
std::shared_ptr< T > | sharedAs () const noexcept |
| Returns a pointer to the current object wrapped in a smart pointer to type T.
|
|
virtual | ~Entity () noexcept=default |
| The default virtual d-tor.
|
|
Spread order event is a snapshot for a full available market depth for all spreads on a given underlying symbol.
The collection of spread order events of a symbol represents the most recent information that is available about spread orders on the market at any given moment of time.
Spread order is similar to a regular Order, but it has a spreadSymbol property that contains the symbol of the actual spread that is being represented by spread order object. eventSymbol property contains the underlying symbol that was used in subscription.
Like regular orders, spread order events arrive from multiple sources for the same market symbol and are distinguished by their index. It is unique across all the sources of depth information for the symbol. The event with size either 0
or NaN
is a signal to remove previously received order for the corresponding index. The method hasSize is a convenient method to test for size presence.
Event flags, transactions and snapshots
Some spread order event sources provide a consistent view of the price-level or detailed order book. Their updates may incorporate multiple changes to price levels or to individual orders that have to be processed at the same time. The corresponding information is carried in eventFlags property.
See Event Flags
section of OrderBase class documentation for details.
IndexedEventModel class handles all the snapshot and transaction logic and conveniently represents a list current of events. It relies on the code of AbstractIndexedEventModel to handle this logic. Use the source code of AbstractIndexedEventModel for clarification on transactions and snapshot logic.
Publishing order books
When publishing an order event with DXPublisher::publishEvents() method, least significant 32 bits of order index must be in a range of from 0 to std::numeric_limits<std::int32_t>::max()
inclusive. Use setSource method after setIndex to properly include source identifier into the index.
A snapshot has to be published in the descending order of index, starting with an event with the largest index and marking it with SpreadOrder::SNAPSHOT_BEGIN bit in eventFlags, and finishing the snapshot with an event that has zero 32 least significant bits of index. SpreadOrder::SNAPSHOT_END bit in eventFlags is optional during publishing. It will be properly set on receiving end anyway.
Limitations
This event type cannot be used with DXFeed::getLastEvent() method.
Full Order Book Support
Some feeds provide support for "Full Order Book" (FOB) where additional fields will be available:
Implementation details
This event is implemented on top of QDS records SpreadOrder#<source-id>
, where <source-id>
is up to 4 ASCII characters with a mnemonic for the source like "ISE".