dxFeed Graal CXX API
|
Base class for common fields of Trade} and TradeETH events. More...
#include <TradeBase.hpp>
Public Member Functions | |
TradeBase () noexcept=default | |
Creates new trade event with default values. | |
TradeBase (std::string eventSymbol) noexcept | |
Creates new trade event with the specified event symbol. | |
std::int64_t | getTimeSequence () const noexcept |
Returns time and sequence of last trade packaged into single long value. | |
void | setTimeSequence (std::int64_t timeSequence) noexcept |
Changes time and sequence of last trade. | |
std::int64_t | getTime () const noexcept |
Returns time of the last trade. | |
void | setTime (std::int64_t time) noexcept |
Changes time of the last trade. | |
std::int64_t | getTimeNanos () const noexcept |
Returns time of the last trade in nanoseconds. | |
void | setTimeNanos (std::int64_t timeNanos) noexcept |
Changes time of the last trade. | |
void | setTimeNanoPart (std::int32_t timeNanoPart) noexcept |
Changes microseconds and nanoseconds time part of the last trade. | |
std::int32_t | getTimeNanoPart () const noexcept |
Returns microseconds and nanoseconds time part of the last trade. | |
std::int32_t | getSequence () const noexcept |
Returns sequence number of the last trade to distinguish trades that have the same time. | |
void | setSequence (std::int32_t sequence) |
Changes sequence number of the last trade. | |
std::int16_t | getExchangeCode () const noexcept |
Returns exchange code of the last trade. | |
std::string | getExchangeCodeString () const noexcept |
Returns exchange code of last trade as UTF8 string. | |
void | setExchangeCode (char exchangeCode) noexcept |
Changes exchange code of the last trade. | |
void | setExchangeCode (std::int16_t exchangeCode) noexcept |
Changes exchange code of the last trade. | |
double | getPrice () const noexcept |
Returns price of the last trade. | |
void | setPrice (double price) noexcept |
Changes price of the last trade. | |
double | getSize () const noexcept |
Returns size of the last trade as floating number with fractions. | |
void | setSize (double size) noexcept |
Changes size of the last trade as floating number with fractions. | |
std::int32_t | getDayId () const noexcept |
Returns identifier of the current trading day. | |
void | setDayId (std::int32_t dayId) noexcept |
Changes identifier of the current trading day. | |
double | getDayVolume () const noexcept |
Returns total volume traded for a day as floating number with fractions. | |
void | setDayVolume (double dayVolume) noexcept |
Changes total volume traded for a day as floating number with fractions. | |
double | getDayTurnover () const noexcept |
Returns total turnover traded for a day. | |
void | setDayTurnover (double dayTurnover) noexcept |
Changes total turnover traded for a day. | |
const Direction & | getTickDirection () const &noexcept |
Returns tick direction of the last trade. | |
void | setTickDirection (const Direction &direction) noexcept |
Changes tick direction of the last trade. | |
bool | isExtendedTradingHours () const noexcept |
Returns whether last trade was in extended trading hours. | |
void | setExtendedTradingHours (bool extendedTradingHours) noexcept |
Changes whether last trade was in extended trading hours. | |
double | getChange () const noexcept |
Returns change of the last trade. | |
void | setChange (double change) noexcept |
Changes change of the last trade. | |
std::string | baseFieldsToString () const noexcept |
Returns string representation of this trade event's fields. | |
Public Member Functions inherited from 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 EventType | |
virtual void * | toGraal () const =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 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 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. | |
Additional Inherited Members | |
Public Types inherited from MarketEvent | |
using | Ptr = std::shared_ptr<MarketEvent> |
The alias to a type of shared pointer to the MarketEvent object. | |
Public Types inherited from EventTypeWithSymbol< std::string > | |
using | Ptr |
The alias to a type of shared pointer to the EventTypeWithSymbol's child object. | |
Public Types inherited from EventType | |
using | Ptr = std::shared_ptr<EventType> |
The alias to a type of shared pointer to the EventType object. | |
Public Types inherited from SharedEntity | |
using | Ptr = std::shared_ptr<SharedEntity> |
The alias to a type of shared pointer to the SharedEntity object. | |
Public Types inherited from LastingEvent | |
using | Ptr = std::shared_ptr<LastingEvent> |
The alias to a type of shared pointer to the LastingEvent object. | |
Protected Member Functions inherited from MarketEvent | |
MarketEvent (std::string eventSymbol) noexcept | |
Protected constructor for concrete implementation classes that initializes eventSymbol property. | |
Base class for common fields of Trade} and TradeETH events.
Trade events represent the most recent information that is available about the last trade on the market at any given moment of time.
Trade event represents last trade information for regular trading hours (RTH) with an official volume and turnover for the whole trading day identified by dayId field.
TradeETH event is defined only for symbols (typically stocks and ETFs) with a designated extended trading hours (ETH, pre market and post market trading sessions). It represents last trade price during ETH and also accumulated volume and turnover during ETH for current trading day.
|
inlineexplicitnoexcept |
Creates new trade event with the specified event symbol.
eventSymbol | The event symbol. |
|
noexcept |
Returns string representation of this trade event's fields.
|
inlinenoexcept |
Returns change of the last trade.
|
inlinenoexcept |
Returns identifier of the current trading day.
Identifier of the day is the number of days passed since January 1, 1970.
|
inlinenoexcept |
Returns total turnover traded for a day.
Day VWAP can be computed with getDayTurnover() / getDayVolume()
.
|
inlinenoexcept |
Returns total volume traded for a day as floating number with fractions.
|
inlinenoexcept |
Returns exchange code of the last trade.
|
inlinenoexcept |
Returns exchange code of last trade as UTF8 string.
|
inlinenoexcept |
Returns price of the last trade.
|
inlinenoexcept |
Returns sequence number of the last trade to distinguish trades 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 TradeBase::MAX_SEQUENCE.
References MAX_SEQUENCE.
Referenced by setTime().
|
inlinenoexcept |
Returns size of the last trade as floating number with fractions.
|
inlinenoexcept |
Returns tick direction of the last trade.
|
inlinenoexcept |
Returns time of the last trade.
Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.
Referenced by getTimeNanos().
|
inlinenoexcept |
Returns microseconds and nanoseconds time part of the last trade.
|
inlinenoexcept |
Returns time of the last trade in nanoseconds.
Time is measured in nanoseconds between the current time and midnight, January 1, 1970 UTC.
References getTime().
|
inlinenoexcept |
Returns time and sequence of last trade packaged into single long value.
|
inlinenoexcept |
Returns whether last trade was in extended trading hours.
true
if last trade was in extended trading hours.
|
inlinenoexcept |
Changes change of the last trade.
change | price of the last trade. |
|
inlinenoexcept |
Changes identifier of the current trading day.
Identifier of the day is the number of days passed since January 1, 1970.
dayId | identifier of the current trading day. |
|
inlinenoexcept |
Changes total turnover traded for a day.
dayTurnover | total turnover traded for a day. |
|
inlinenoexcept |
Changes total volume traded for a day as floating number with fractions.
dayVolume | total volume traded for a day as floating number with fractions. |
|
inlinenoexcept |
Changes exchange code of the last trade.
exchangeCode | exchange code of the last trade. |
|
inlinenoexcept |
Changes exchange code of the last trade.
exchangeCode | exchange code of the last trade. |
|
inlinenoexcept |
Changes whether last trade was in extended trading hours.
extendedTradingHours | true if last trade was in extended trading hours. |
|
inlinenoexcept |
Changes price of the last trade.
price | price of the last trade. |
|
inline |
Changes sequence number of the last trade.
sequence | the sequence. |
References MAX_SEQUENCE.
|
inlinenoexcept |
Changes size of the last trade as floating number with fractions.
size | size of the last trade as floating number with fractions. |
|
inlinenoexcept |
Changes tick direction of the last trade.
direction | tick direction of the last trade. |
|
inlinenoexcept |
Changes time of the last trade.
Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.
time | time of the last trade. |
References getSequence().
Referenced by setTimeNanos().
|
inlinenoexcept |
Changes microseconds and nanoseconds time part of the last trade.
timeNanoPart | microseconds and nanoseconds time part of the last trade. |
|
inlinenoexcept |
Changes time of the last trade.
Time is measured in nanoseconds between the current time and midnight, January 1, 1970 UTC.
timeNanos | time of the last trade in nanoseconds. |
References setTime().
|
inlinenoexcept |
Changes time and sequence of last trade.
Do not use this method directly. Change time and/or sequence.
timeSequence | the time and sequence. |
|
staticconstexpr |
Maximum allowed sequence value.
Referenced by getSequence(), and setSequence().