dxFeed Graal CXX API
Loading...
Searching...
No Matches
dxfcpp::Underlying Class Referencefinal

Underlying event is a snapshot of computed values that are available for an option underlying symbol based on the option prices on the market. More...

#include <Underlying.hpp>

+ Inheritance diagram for dxfcpp::Underlying:

Public Types

using Ptr = std::shared_ptr<Underlying>
 The alias to a type of shared pointer to the Underlying object.
 
using Unique = std::unique_ptr<Underlying>
 The alias to a type of unique pointer to the Underlying object.
 
- 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::TimeSeriesEvent
using Ptr = std::shared_ptr<TimeSeriesEvent>
 The alias to a type of shared pointer to the TimeSeriesEvent 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.
 
- Public Types inherited from dxfcpp::LastingEvent
using Ptr = std::shared_ptr<LastingEvent>
 The alias to a type of shared pointer to the LastingEvent object.
 

Public Member Functions

voidtoGraal () const noexcept override
 Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
 
 Underlying () noexcept=default
 Creates new underlying event with default values.
 
 Underlying (std::string eventSymbol) noexcept
 Creates new underlying event with the specified event symbol.
 
const IndexedEventSourcegetSource () const &noexcept override
 Returns the source identifier for this event, which is always DEFAULT for time-series events.
 
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.
 
std::int64_t getIndex () const noexcept override
 Returns unique per-symbol index of this event.
 
void setIndex (std::int64_t index) noexcept override
 Changes unique per-symbol index of this event.
 
std::int64_t getTime () const noexcept override
 Returns timestamp of the event in milliseconds.
 
void setTime (std::int64_t time) noexcept
 Changes timestamp of the event in milliseconds.
 
std::int32_t getSequence () const noexcept
 Returns the sequence number of this event to distinguish events that have the same time.
 
void setSequence (int sequence) noexcept
 Changes sequence number of this event.
 
double getVolatility () const noexcept
 Returns 30-day implied volatility for this underlying based on VIX methodology.
 
void setVolatility (double volatility) noexcept
 Changes 30-day implied volatility for this underlying based on VIX methodology.
 
double getFrontVolatility () const noexcept
 Returns front month implied volatility for this underlying based on VIX methodology.
 
void setFrontVolatility (double frontVolatility) noexcept
 Changes front month implied volatility for this underlying based on VIX methodology.
 
double getBackVolatility () const noexcept
 Returns back month implied volatility for this underlying based on VIX methodology.
 
void setBackVolatility (double backVolatility) noexcept
 Changes back month implied volatility for this underlying based on VIX methodology.
 
double getCallVolume () const noexcept
 Returns call options traded volume for a day.
 
void setCallVolume (double callVolume) noexcept
 Changes call options traded volume for a day.
 
double getPutVolume () const noexcept
 Returns put options traded volume for a day.
 
void setPutVolume (double putVolume) noexcept
 Changes put options traded volume for a day.
 
double getOptionVolume () const noexcept
 Returns options traded volume for a day.
 
double getPutCallRatio () const noexcept
 Returns ratio of put options traded volume to call options traded volume for a day.
 
void setPutCallRatio (double putCallRatio) noexcept
 Changes ratio of put options traded volume to call options traded volume for a day.
 
std::string toString () const noexcept override
 Returns a string representation of the current object.
 
- 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::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.
 
- Public Member Functions inherited from dxfcpp::TimeSeriesEvent
virtual std::int64_t getEventId () const noexcept
 Returns unique per-symbol index of this event.
 

Static Public Member Functions

static void freeGraal (void *graalNative) noexcept
 Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
 

Static Public Attributes

static constexpr std::uint32_t MAX_SEQUENCE = (1U << 22U) - 1U
 Maximum allowed sequence value.
 
static const EventTypeEnumTYPE = EventTypeEnum::UNDERLYING
 Type identifier and additional information about the current event class.
 
- 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

- Protected Member Functions inherited from dxfcpp::MarketEvent
 MarketEvent (std::string eventSymbol) noexcept
 Protected constructor for concrete implementation classes that initializes eventSymbol property.
 

Detailed Description

Underlying event is a snapshot of computed values that are available for an option underlying symbol based on the option prices on the market.

It represents the most recent information that is available about the corresponding values on the market at any given moment of time.

Event flags, transactions and snapshots

Some Underlying sources provide a consistent view of the set of known Underlying events. The corresponding information is carried in eventFlags property. The logic behind this property is detailed in IndexedEvent class documentation. Multiple event sources for the same symbol are not supported for Underlying, thus source property is always DEFAULT.

TimeSeriesEventModel class handles all the snapshot and transaction logic and conveniently represents a list current of time-series events order by their time.

Publishing Underlying

Publishing of Underlying events follows the general rules explained in TimeSeriesEvent class documentation.

Implementation details

This event is implemented on top of QDS record Underlying.

Constructor & Destructor Documentation

◆ Underlying()

dxfcpp::Underlying::Underlying ( std::string eventSymbol)
inlineexplicitnoexcept

Creates new underlying event with the specified event symbol.

Parameters
eventSymbolThe event symbol.

Member Function Documentation

◆ freeGraal()

void dxfcpp::Underlying::freeGraal ( void * graalNative)
staticnoexcept

Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.

◆ getBackVolatility()

double dxfcpp::Underlying::getBackVolatility ( ) const
inlinenoexcept

Returns back month implied volatility for this underlying based on VIX methodology.

Returns
back month implied volatility for this underlying based on VIX methodology.

◆ getCallVolume()

double dxfcpp::Underlying::getCallVolume ( ) const
inlinenoexcept

Returns call options traded volume for a day.

Returns
call options traded volume for a day.

◆ getEventFlags()

std::int32_t dxfcpp::Underlying::getEventFlags ( ) const
inlineoverridevirtualnoexcept

Returns transactional event flags.

See EventFlag "Event Flags" section.

Returns
The transactional event flags.

Implements dxfcpp::IndexedEvent.

◆ getEventFlagsMask()

EventFlagsMask dxfcpp::Underlying::getEventFlagsMask ( ) const
inlineoverridevirtualnoexcept

Returns transactional event flags.

See EventFlag "Event Flags" section.

Returns
The transactional event flags' mask.

Implements dxfcpp::IndexedEvent.

◆ getFrontVolatility()

double dxfcpp::Underlying::getFrontVolatility ( ) const
inlinenoexcept

Returns front month implied volatility for this underlying based on VIX methodology.

Returns
front month implied volatility for this underlying based on VIX methodology.

◆ getIndex()

std::int64_t dxfcpp::Underlying::getIndex ( ) const
inlineoverridevirtualnoexcept

Returns unique per-symbol index of this event.

The index is composed of time and sequence. Changing either time or sequence changes event index.

Returns
unique index of this event.

Reimplemented from dxfcpp::TimeSeriesEvent.

◆ getOptionVolume()

double dxfcpp::Underlying::getOptionVolume ( ) const
inlinenoexcept

Returns options traded volume for a day.

Returns
options traded volume for a day.

◆ getPutCallRatio()

double dxfcpp::Underlying::getPutCallRatio ( ) const
inlinenoexcept

Returns ratio of put options traded volume to call options traded volume for a day.

Returns
ratio of put options traded volume to call options traded volume for a day.

◆ getPutVolume()

double dxfcpp::Underlying::getPutVolume ( ) const
inlinenoexcept

Returns put options traded volume for a day.

Returns
put options traded volume for a day.

◆ getSequence()

std::int32_t dxfcpp::Underlying::getSequence ( ) const
inlinenoexcept

Returns the sequence number of this event to distinguish events 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 MAX_SEQUENCE.

Returns
The sequence number of this event

◆ getSource()

const IndexedEventSource & dxfcpp::Underlying::getSource ( ) const &
inlineoverridevirtualnoexcept

Returns the source identifier for this event, which is always DEFAULT for time-series events.

Returns
The source identifier for this event, which is always DEFAULT for time-series events.

Reimplemented from dxfcpp::TimeSeriesEvent.

◆ getTime()

std::int64_t dxfcpp::Underlying::getTime ( ) const
inlineoverridevirtualnoexcept

Returns timestamp of the event in milliseconds.

Returns
timestamp of the event in milliseconds

Implements dxfcpp::TimeSeriesEvent.

◆ getVolatility()

double dxfcpp::Underlying::getVolatility ( ) const
inlinenoexcept

Returns 30-day implied volatility for this underlying based on VIX methodology.

Returns
30-day implied volatility for this underlying based on VIX methodology.

◆ setBackVolatility()

void dxfcpp::Underlying::setBackVolatility ( double backVolatility)
inlinenoexcept

Changes back month implied volatility for this underlying based on VIX methodology.

Parameters
backVolatilityback month implied volatility for this underlying based on VIX methodology.

◆ setCallVolume()

void dxfcpp::Underlying::setCallVolume ( double callVolume)
inlinenoexcept

Changes call options traded volume for a day.

Parameters
callVolumecall options traded volume for a day.

◆ setEventFlags() [1/2]

void dxfcpp::Underlying::setEventFlags ( const EventFlagsMask & eventFlags)
inlineoverridevirtualnoexcept

Changes transactional event flags.

See EventFlag "Event Flags" section.

Parameters
eventFlagstransactional event flags' mask.

Implements dxfcpp::IndexedEvent.

◆ setEventFlags() [2/2]

void dxfcpp::Underlying::setEventFlags ( std::int32_t eventFlags)
inlineoverridevirtualnoexcept

Changes transactional event flags.

See EventFlag "Event Flags" section.

Parameters
eventFlagstransactional event flags.

Implements dxfcpp::IndexedEvent.

◆ setFrontVolatility()

void dxfcpp::Underlying::setFrontVolatility ( double frontVolatility)
inlinenoexcept

Changes front month implied volatility for this underlying based on VIX methodology.

Parameters
frontVolatilityfront month implied volatility for this underlying based on VIX methodology.

◆ setIndex()

void dxfcpp::Underlying::setIndex ( std::int64_t index)
inlineoverridevirtualnoexcept

Changes unique per-symbol index of this event.

The index is composed of time and sequence and invocation of this method changes time and sequence. Do not use this method directly. Change time and/or sequence.

Parameters
indexthe event index.
See also
getIndex()

Implements dxfcpp::IndexedEvent.

◆ setPutCallRatio()

void dxfcpp::Underlying::setPutCallRatio ( double putCallRatio)
inlinenoexcept

Changes ratio of put options traded volume to call options traded volume for a day.

Parameters
putCallRatioratio of put options traded volume to call options traded volume for a day.

◆ setPutVolume()

void dxfcpp::Underlying::setPutVolume ( double putVolume)
inlinenoexcept

Changes put options traded volume for a day.

Parameters
putVolumeput options traded volume for a day.

◆ setSequence()

void dxfcpp::Underlying::setSequence ( int sequence)
inlinenoexcept

Changes sequence number of this event.

Parameters
sequencethe sequence.
See also
getSequence()

◆ setTime()

void dxfcpp::Underlying::setTime ( std::int64_t time)
inlinenoexcept

Changes timestamp of the event in milliseconds.

Parameters
timetimestamp of the event in milliseconds.
See also
getTime()

◆ setVolatility()

void dxfcpp::Underlying::setVolatility ( double volatility)
inlinenoexcept

Changes 30-day implied volatility for this underlying based on VIX methodology.

Parameters
volatility30-day implied volatility for this underlying based on VIX methodology.

◆ toGraal()

void * dxfcpp::Underlying::toGraal ( ) const
overridevirtualnoexcept

Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).

Fills the dxFeed Graal SDK structure's fields by the data of the current entity (recursively if necessary). Returns the pointer to the filled structure.

Returns
The pointer to the filled dxFeed Graal SDK structure

Implements dxfcpp::EventType.

◆ toString()

std::string dxfcpp::Underlying::toString ( ) const
overridevirtualnoexcept

Returns a string representation of the current object.

Returns
a string representation

Reimplemented from dxfcpp::EventType.

Member Data Documentation

◆ MAX_SEQUENCE

constexpr std::uint32_t dxfcpp::Underlying::MAX_SEQUENCE = (1U << 22U) - 1U
staticconstexpr

Maximum allowed sequence value.

See also
setSequence()