dxFeed Graal CXX API
|
Base class for common fields of Order, AnalyticOrder and SpreadOrder events. More...
#include <OrderBase.hpp>
Public Member Functions | |
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) noexcept 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) noexcept |
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) noexcept |
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. | |
Public Member Functions inherited from dxfcpp::MarketEvent | |
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. | |
Public Member Functions inherited from dxfcpp::EventType | |
virtual void * | toGraal () const noexcept=0 |
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary). | |
std::string | toString () const noexcept override |
Returns a string representation of the current object. | |
Public Member Functions inherited from dxfcpp::SharedEntity | |
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. | |
Public Member Functions inherited from dxfcpp::Entity | |
virtual | ~Entity () noexcept=default |
The default virtual d-tor. | |
Static Public Attributes | |
static constexpr std::uint32_t | MAX_SEQUENCE = (1U << 22U) - 1U |
Maximum allowed sequence value. | |
Static Public Attributes inherited from dxfcpp::IndexedEvent | |
static const EventFlag | TX_PENDING = EventFlag::TX_PENDING |
0x01 - A bitmask to get transaction pending indicator from the value of eventFlags property. | |
static const EventFlag | REMOVE_EVENT = EventFlag::REMOVE_EVENT |
0x02 - A bitmask to get removal indicator from the value of eventFlags property. | |
static const EventFlag | SNAPSHOT_BEGIN = EventFlag::SNAPSHOT_BEGIN |
0x04 - A bitmask to get snapshot begin indicator from the value of eventFlags property. | |
static const EventFlag | SNAPSHOT_END = EventFlag::SNAPSHOT_END |
0x08 - A bitmask to get snapshot end indicator from the value of eventFlags property. | |
static const EventFlag | SNAPSHOT_SNIP = EventFlag::SNAPSHOT_SNIP |
0x10 - A bitmask to get snapshot snip indicator from the value of eventFlags property. | |
static const EventFlag | SNAPSHOT_MODE = EventFlag::SNAPSHOT_MODE |
0x40 - A bitmask to set snapshot mode indicator into the value of eventFlags property. | |
Additional Inherited Members | |
Public Types inherited from dxfcpp::MarketEvent | |
using | Ptr = std::shared_ptr<MarketEvent> |
The alias to a type of shared pointer to the MarketEvent object. | |
Public Types inherited from dxfcpp::EventTypeWithSymbol< std::string > | |
using | Ptr |
The alias to a type of shared pointer to the EventTypeWithSymbol's child object. | |
Public Types inherited from dxfcpp::EventType | |
using | Ptr = std::shared_ptr<EventType> |
The alias to a type of shared pointer to the EventType object. | |
Public Types inherited from dxfcpp::SharedEntity | |
using | Ptr = std::shared_ptr<SharedEntity> |
The alias to a type of shared pointer to the SharedEntity object. | |
Public Types inherited from dxfcpp::IndexedEvent | |
using | Ptr = std::shared_ptr<IndexedEvent> |
The alias to a type of shared pointer to the IndexedEvent object. | |
Protected Member Functions inherited from dxfcpp::MarketEvent | |
MarketEvent (std::string eventSymbol) noexcept | |
Protected constructor for concrete implementation classes that initializes eventSymbol property. | |
Base class for common fields of Order, AnalyticOrder and SpreadOrder events.
Order events represent a snapshot for a full available market depth for a symbol. The collection of order events of a symbol represents the most recent information that is available about orders on the market at any given moment of time.
Order event represents market depth for a specific symbol.
AnalyticOrder event represents market depth for a specific symbol extended with an analytic information, for example, whether particular order represent an iceberg or not.
SpreadOrder event represents market depth for all spreads on a given underlying symbol.
Order events arrive from multiple sources for the same market symbol and are distinguished by their index. Index is a unique per symbol identifier of the event. 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.
Some 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. The logic behind this property is detailed in IndexedEvent class documentation.
The event source identifier for an order is a part of the unique event index. It occupies highest bits of the index (index is not-negative). The lowest bits of index contain source-specific event index which is always zero in an event that is marked with EventFlag::SNAPSHOT_END bit in eventFlags.
Note that for an order with EventFlag::REMOVE_EVENT bit in eventFlags it is always the case that size is either 0
or NaN
, so no additional logic to process this bit is required for orders. Transactions and snapshots may include orders with size of 0
. The filtering that distinguishes those events as removals of orders shall be performed after all transactions and snapshot processing.
Some aggregated feeds (like CME market depth) are mapped into two distinct source ids (one for buy orders and one for sell orders), but updates and transactions may span both. It is important to keep a separate track of transactional state for each source id, but, at the same time, when DXFeedEventListener::eventsReceived() method is called for a list of events, the order book shall be considered complete and consistent only when all events from the given list are processed.
|
inlineexplicitnoexcept |
Creates new order event with the specified event symbol.
eventSymbol | The event symbol. |
|
noexcept |
Returns string representation of this order event's fields.
|
inlinenoexcept |
Returns order action if available, otherwise - OrderAction::UNDEFINED.
This field is a part of the FOB support.
|
inlinenoexcept |
Returns time of the last action.
This field is a part of the FOB support.
|
inlinenoexcept |
Returns auxiliary order ID if available:
This field is a part of the FOB support.
|
inlinenoexcept |
Returns number of individual orders in this aggregate order.
|
inlineoverridevirtualnoexcept |
Returns transactional event flags.
See EventFlag "Event Flags" section.
Implements dxfcpp::IndexedEvent.
|
inlineoverridevirtualnoexcept |
Returns transactional event flags.
See EventFlag "Event Flags" section.
Implements dxfcpp::IndexedEvent.
|
inlinenoexcept |
Returns exchange code of this order.
|
inlinenoexcept |
Returns exchange code of this order as UTF8 string.
|
inlinenoexcept |
Returns executed size of this order.
|
inlineoverridevirtualnoexcept |
Returns unique per-symbol index of this order.
Index is non-negative.
Implements dxfcpp::IndexedEvent.
|
inlinenoexcept |
Returns order ID if available.
Some actions (OrderAction::TRADE, OrderAction::BUST) have no order ID since they are not related to any order in Order book.
This field is a part of the FOB support.
Returns side of this order.
|
inlinenoexcept |
Returns price of this order.
Returns scope of this order.
|
inlinenoexcept |
Returns sequence number of this order to distinguish orders that have the same time.
This sequence number does not have to be unique and does not need to be sequential. Sequence can range from 0 to OrderBase::MAX_SEQUENCE.
|
inlinenoexcept |
Returns size of this order.
|
inlineoverridevirtualnoexcept |
Returns source of this event.
The source is stored in the highest bits of the index of this event.
Implements dxfcpp::IndexedEvent.
|
inlinenoexcept |
Returns time of this order.
Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.
|
inlinenoexcept |
Returns microseconds and nanoseconds time part of this order.
|
inlinenoexcept |
Returns time of this order in nanoseconds.
Time is measured in nanoseconds between the current time and midnight, January 1, 1970 UTC.
|
inlinenoexcept |
Returns time and sequence of this order packaged into single long value.
This method is intended for efficient order time priority comparison.
|
inlinenoexcept |
Returns trade (order execution) ID for events containing trade-related action.
This field is a part of the FOB support.
|
inlinenoexcept |
Returns trade price for events containing trade-related action.
This field is a part of the FOB support.
|
inlinenoexcept |
Returns trade size for events containing trade-related action.
This field is a part of the FOB support.
|
inlinenoexcept |
Returns true
if this order has some size (sizeAsDouble is neither 0
nor NaN
).
true
if this order has some size (sizeAsDouble is neither 0
nor NaN
).
|
inlinenoexcept |
Changes action of this order.
action | The action of this order. |
|
inlinenoexcept |
Changes time of the last action.
actionTime | last order action time. |
|
inlinenoexcept |
Changes auxiliary order ID.
auxOrderId | auxiliary order ID. |
|
inlinenoexcept |
Changes number of individual orders in this aggregate order.
count | number of individual orders in this aggregate order. |
|
inlineoverridevirtualnoexcept |
Changes transactional event flags.
See EventFlag "Event Flags" section.
eventFlags | transactional event flags' mask. |
Implements dxfcpp::IndexedEvent.
|
inlineoverridevirtualnoexcept |
Changes transactional event flags.
See EventFlag "Event Flags" section.
eventFlags | transactional event flags. |
Implements dxfcpp::IndexedEvent.
Changes exchange code of this order.
exchangeCode | exchange code of this order. |
|
inlinenoexcept |
Changes exchange code of this order.
exchangeCode | exchange code of this order. |
Changes executed size of this order.
executedSize | executed size of this order. |
|
inlineoverridevirtualnoexcept |
Changes unique per-symbol index of this order.
Note, that this method also changes source, whose id occupies highest bits of index. Use OrderBase::setSource() after invocation of this method to set the desired value of source.
index | unique per-symbol index of this order. |
Implements dxfcpp::IndexedEvent.
|
inlinenoexcept |
Changes order ID.
orderId | order ID. |
Changes side of this order.
side | side of this order. |
Changes price of this order.
price | price of this order. |
Changes scope of this order.
scope | scope of this order. |
|
inlinenoexcept |
Changes sequence number of this order.
sequence | the sequence. |
Changes size of this order.
size | size of this order. |
|
inlinenoexcept |
Changes source of this event.
This method changes highest bits of the index of this event.
source | source of this event. |
|
inlinenoexcept |
Changes time of this order.
Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.
time | time of this order. |
|
inlinenoexcept |
Changes microseconds and nanoseconds time part of this order.
timeNanoPart | microseconds and nanoseconds time part of this order. |
|
inlinenoexcept |
Changes time of this order.
Time is measured in nanoseconds between the current time and midnight, January 1, 1970 UTC.
timeNanos | time of this order in nanoseconds. |
|
inlinenoexcept |
Changes time and sequence of this order.
timeSequence | the time and sequence. |
|
inlinenoexcept |
Changes trade ID.
tradeId | trade ID. |
Changes trade price.
tradePrice | trade price. |
Changes trade size.
tradeSize | trade size. |
Maximum allowed sequence value.