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

Series event is a snapshot of computed values that are available for all option series for a given underlying symbol based on the option prices on the market. More...

#include <Series.hpp>

+ Inheritance diagram for dxfcpp::Series:

Public Types

using Ptr = std::shared_ptr<Series>
 The alias to a type of shared pointer to the Series object.
 
using Unique = std::unique_ptr<Series>
 The alias to a type of unique pointer to the Series 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::IndexedEvent
using Ptr = std::shared_ptr<IndexedEvent>
 The alias to a type of shared pointer to the IndexedEvent object.
 

Public Member Functions

voidtoGraal () const noexcept override
 Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
 
 Series () noexcept=default
 Creates new series event with default values.
 
 Series (std::string eventSymbol) noexcept
 Creates new series event with the specified event symbol.
 
virtual SerieswithEventSymbol (const std::string &eventSymbol) noexcept
 Changes event's symbol and returns the current series.
 
Series::Ptr withEventSymbolShared (const std::string &eventSymbol) noexcept
 Changes event's symbol and returns a shared pointer to the current series.
 
SerieswithEventTime (std::int64_t eventTime) noexcept
 Changes event's creation time and returns the current series.
 
Series::Ptr withEventTimeShared (std::int64_t eventTime) noexcept
 Changes event's creation time and returns a shared pointer to the current series.
 
const IndexedEventSourcegetSource () const &noexcept override
 Returns the 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.
 
SerieswithEventFlags (std::int32_t eventFlags) noexcept
 Changes transactional event flags and returns the current series.
 
Series::Ptr withEventFlagsShared (std::int32_t eventFlags) noexcept
 Changes transactional event flags and returns a shared pointer to the current series.
 
SerieswithEventFlags (const EventFlagsMask &eventFlags) noexcept
 Changes transactional event flags and returns the current series.
 
Series::Ptr withEventFlagsShared (const EventFlagsMask &eventFlags) noexcept
 Changes transactional event flags and returns a shared pointer to the current series.
 
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.
 
SerieswithIndex (std::int64_t index) noexcept
 Changes unique per-symbol index of this series and returns it.
 
Series::Ptr withIndexShared (std::int64_t index) noexcept
 Changes unique per-symbol index of this series and returns a shared pointer to it.
 
std::int64_t getTimeSequence () const noexcept
 Returns time and sequence of this event packaged into single long value.
 
void setTimeSequence (std::int64_t timeSequence) noexcept
 Changes time and sequence of this event.
 
std::int64_t getTime () const noexcept
 Returns time of this series event.
 
void setTime (std::int64_t time) noexcept
 Changes time of this series event.
 
SerieswithTime (std::int64_t time) noexcept
 Changes time of this series and returns it.
 
Series::Ptr withTimeShared (std::int64_t time) noexcept
 Changes time of this series and returns a shared pointer to it.
 
std::int32_t getSequence () const noexcept
 Returns sequence number of this series event to distinguish trades that have the same time.
 
void setSequence (std::int32_t sequence) noexcept
 Changes sequence number of this series event.
 
SerieswithSequence (std::int32_t sequence) noexcept
 Changes sequence number of this series.
 
Series::Ptr withSequenceShared (std::int32_t sequence) noexcept
 Changes sequence number of this series.
 
std::int32_t getExpiration () const noexcept
 Returns day id of expiration.
 
void setExpiration (std::int32_t expiration) noexcept
 Changes day id of expiration.
 
double getVolatility () const noexcept
 Returns implied volatility index for this series based on VIX methodology.
 
void setVolatility (double volatility) noexcept
 Changes implied volatility index for this series 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.
 
double getForwardPrice () const noexcept
 Returns implied forward price for this option series.
 
void setForwardPrice (double forwardPrice) noexcept
 Changes implied forward price for this option series.
 
double getDividend () const noexcept
 Returns implied simple dividend return of the corresponding option series.
 
void setDividend (double dividend) noexcept
 Changes implied simple dividend return of the corresponding option series.
 
double getInterest () const noexcept
 Returns implied simple interest return of the corresponding option series.
 
void setInterest (double interest) noexcept
 Changes implied simple interest return of the corresponding option series.
 
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.
 

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::SERIES
 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

Series event is a snapshot of computed values that are available for all option series for a given 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.

Series is an IndexedEvent with multiple instances of event available for each underlying symbol. Each series event instance corresponds to an OptionSeries of the corresponding underlying. The correspondence between a series event instance and an OptionSeries is established via expiration property. If case where there are multiple series at the same expiration day id, then series events are are ordered by their index in the same order as the corresponding OptionSeries are ordered by their attributes.

Event flags, transactions and snapshots

Series data source provides a consistent view of the set of known series. 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 series, thus source property is always DEFAULT.

IndexedEventModel class handles all the snapshot and transaction logic and conveniently represents a list current of events.

Implementation details

This event is implemented on top of QDS records Series.

Constructor & Destructor Documentation

◆ Series()

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

Creates new series event with the specified event symbol.

Parameters
eventSymbolThe event symbol.

Member Function Documentation

◆ freeGraal()

void dxfcpp::Series::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.

◆ getCallVolume()

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

Returns call options traded volume for a day.

Returns
call options traded volume for a day.

◆ getDividend()

double dxfcpp::Series::getDividend ( ) const
inlinenoexcept

Returns implied simple dividend return of the corresponding option series.

Returns
implied simple dividend return of the corresponding option series.

◆ getEventFlags()

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

Returns transactional event flags.

See EventFlag "Event Flags" section.

Returns
The transactional event flags.

Implements dxfcpp::IndexedEvent.

◆ getEventFlagsMask()

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

Returns transactional event flags.

See EventFlag "Event Flags" section.

Returns
The transactional event flags' mask.

Implements dxfcpp::IndexedEvent.

◆ getExpiration()

std::int32_t dxfcpp::Series::getExpiration ( ) const
inlinenoexcept

Returns day id of expiration.

Example: day_util::#getDayIdByYearMonthDay() "dxfcpp::day_util::getDayIdByYearMonthDay"(20090117).

Returns
day id of expiration.

◆ getForwardPrice()

double dxfcpp::Series::getForwardPrice ( ) const
inlinenoexcept

Returns implied forward price for this option series.

Returns
implied forward price for this option series.

◆ getIndex()

std::int64_t dxfcpp::Series::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.

Implements dxfcpp::IndexedEvent.

◆ getInterest()

double dxfcpp::Series::getInterest ( ) const
inlinenoexcept

Returns implied simple interest return of the corresponding option series.

Returns
implied simple interest return of the corresponding option series.

◆ getOptionVolume()

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

Returns options traded volume for a day.

Returns
options traded volume for a day.

◆ getPutCallRatio()

double dxfcpp::Series::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::Series::getPutVolume ( ) const
inlinenoexcept

Returns put options traded volume for a day.

Returns
put options traded volume for a day.

◆ getSequence()

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

Returns sequence number of this series event 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 MAX_SEQUENCE.

Returns
sequence of this series event.

◆ getSource()

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

Returns the source of this event.

Returns
The source of this event.

Implements dxfcpp::IndexedEvent.

◆ getTime()

std::int64_t dxfcpp::Series::getTime ( ) const
inlinenoexcept

Returns time of this series event.

Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Returns
time of this series event.

◆ getTimeSequence()

std::int64_t dxfcpp::Series::getTimeSequence ( ) const
inlinenoexcept

Returns time and sequence of this event packaged into single long value.

Returns
time and sequence of this event.

◆ getVolatility()

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

Returns implied volatility index for this series based on VIX methodology.

Returns
implied volatility index for this series based on VIX methodology.

◆ setCallVolume()

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

Changes call options traded volume for a day.

Parameters
callVolumecall options traded volume for a day.

◆ setDividend()

void dxfcpp::Series::setDividend ( double dividend)
inlinenoexcept

Changes implied simple dividend return of the corresponding option series.

Parameters
dividendimplied simple dividend return of the corresponding option series.

◆ setEventFlags() [1/2]

void dxfcpp::Series::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::Series::setEventFlags ( std::int32_t eventFlags)
inlineoverridevirtualnoexcept

Changes transactional event flags.

See EventFlag "Event Flags" section.

Parameters
eventFlagstransactional event flags.

Implements dxfcpp::IndexedEvent.

◆ setExpiration()

void dxfcpp::Series::setExpiration ( std::int32_t expiration)
inlinenoexcept

Changes day id of expiration.

Parameters
expirationday id of expiration.

◆ setForwardPrice()

void dxfcpp::Series::setForwardPrice ( double forwardPrice)
inlinenoexcept

Changes implied forward price for this option series.

Parameters
forwardPriceimplied forward price for this option series.

◆ setIndex()

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

Changes unique per-symbol index of this event.

Parameters
indexthe event index.
See also
Series::getIndex()

Implements dxfcpp::IndexedEvent.

◆ setInterest()

void dxfcpp::Series::setInterest ( double interest)
inlinenoexcept

Changes implied simple interest return of the corresponding option series.

Parameters
interestimplied simple interest return of the corresponding option series.

◆ setPutCallRatio()

void dxfcpp::Series::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::Series::setPutVolume ( double putVolume)
inlinenoexcept

Changes put options traded volume for a day.

Parameters
putVolumeput options traded volume for a day.

◆ setSequence()

void dxfcpp::Series::setSequence ( std::int32_t sequence)
inlinenoexcept

Changes sequence number of this series event.

Parameters
sequencethe sequence.
See also
Series::getSequence()

◆ setTime()

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

Changes time of this series event.

Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Parameters
timetime of this series event.

◆ setTimeSequence()

void dxfcpp::Series::setTimeSequence ( std::int64_t timeSequence)
inlinenoexcept

Changes time and sequence of this event.

Do not use this method directly. Change time and/or sequence.

Parameters
timeSequencethe time and sequence.
See also
getTimeSequence()

◆ setVolatility()

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

Changes implied volatility index for this series based on VIX methodology.

Parameters
volatilityimplied volatility index for this series based on VIX methodology.

◆ toGraal()

void * dxfcpp::Series::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::Series::toString ( ) const
overridevirtualnoexcept

Returns a string representation of the current object.

Returns
a string representation

Reimplemented from dxfcpp::EventType.

◆ withEventFlags() [1/2]

Series & dxfcpp::Series::withEventFlags ( const EventFlagsMask & eventFlags)
inlinenoexcept

Changes transactional event flags and returns the current series.

See EventFlag "Event Flags" section.

Parameters
eventFlagstransactional event flags' mask.
Returns
The current series.

◆ withEventFlags() [2/2]

Series & dxfcpp::Series::withEventFlags ( std::int32_t eventFlags)
inlinenoexcept

Changes transactional event flags and returns the current series.

See EventFlag "Event Flags" section.

Parameters
eventFlagstransactional event flags.
Returns
The current series.

◆ withEventFlagsShared() [1/2]

Series::Ptr dxfcpp::Series::withEventFlagsShared ( const EventFlagsMask & eventFlags)
inlinenoexcept

Changes transactional event flags and returns a shared pointer to the current series.

See EventFlag "Event Flags" section.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Series>(new Series(...)) or std::make_shared<Series>(...)
Parameters
eventFlagstransactional event flags' mask.
Returns
A shared pointer to the current series.

◆ withEventFlagsShared() [2/2]

Series::Ptr dxfcpp::Series::withEventFlagsShared ( std::int32_t eventFlags)
inlinenoexcept

Changes transactional event flags and returns a shared pointer to the current series.

See EventFlag "Event Flags" section.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Series>(new Series(...)) or std::make_shared<Series>(...)
Parameters
eventFlagstransactional event flags.
Returns
A shared pointer to the current series.

◆ withEventSymbol()

virtual Series & dxfcpp::Series::withEventSymbol ( const std::string & eventSymbol)
inlinevirtualnoexcept

Changes event's symbol and returns the current series.

Parameters
eventSymbolThe symbol of this event.
Returns
The current series.

◆ withEventSymbolShared()

Series::Ptr dxfcpp::Series::withEventSymbolShared ( const std::string & eventSymbol)
inlinenoexcept

Changes event's symbol and returns a shared pointer to the current series.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Series>(new Series(...)) or std::make_shared<Series>(...)
Parameters
eventSymbolThe symbol of this event.
Returns
A shared pointer to the current series.

◆ withEventTime()

Series & dxfcpp::Series::withEventTime ( std::int64_t eventTime)
inlinenoexcept

Changes event's creation time and returns the current series.

Parameters
eventTimethe difference, measured in milliseconds, between the event creation time and midnight, January 1, 1970 UTC.
Returns
The current series.

◆ withEventTimeShared()

Series::Ptr dxfcpp::Series::withEventTimeShared ( std::int64_t eventTime)
inlinenoexcept

Changes event's creation time and returns a shared pointer to the current series.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Series>(new Series(...)) or std::make_shared<Series>(...)
Parameters
eventTimethe difference, measured in milliseconds, between the event creation time and midnight, January 1, 1970 UTC.
Returns
A shared pointer to the current series.

◆ withIndex()

Series & dxfcpp::Series::withIndex ( std::int64_t index)
inlinenoexcept

Changes unique per-symbol index of this series and returns it.

Parameters
indexunique per-symbol index of this series.
Returns
The current series.

◆ withIndexShared()

Series::Ptr dxfcpp::Series::withIndexShared ( std::int64_t index)
inlinenoexcept

Changes unique per-symbol index of this series and returns a shared pointer to it.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Series>(new Series(...)) or std::make_shared<Series>(...)
Parameters
indexunique per-symbol index of this order.
Returns
A shared pointer to the current series.

◆ withSequence()

Series & dxfcpp::Series::withSequence ( std::int32_t sequence)
inlinenoexcept

Changes sequence number of this series.

Returns the current order.

Parameters
sequencethe sequence.
Returns
The current series.
See also
Series::getSequence()

◆ withSequenceShared()

Series::Ptr dxfcpp::Series::withSequenceShared ( std::int32_t sequence)
inlinenoexcept

Changes sequence number of this series.

Returns a shared pointer to the current series.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Series>(new Series(...)) or std::make_shared<Series>(...)
Parameters
sequencethe sequence.
Returns
A shared pointer to the current series.
See also
Series::getSequence()

◆ withTime()

Series & dxfcpp::Series::withTime ( std::int64_t time)
inlinenoexcept

Changes time of this series and returns it.

Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Parameters
timetime of this series.
Returns
The current series.

◆ withTimeShared()

Series::Ptr dxfcpp::Series::withTimeShared ( std::int64_t time)
inlinenoexcept

Changes time of this series and returns a shared pointer to it.

Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Series>(new Series(...)) or std::make_shared<Series>(...)
Parameters
timetime of this series.
Returns
A shared pointer to the current series.

Member Data Documentation

◆ MAX_SEQUENCE

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

Maximum allowed sequence value.

See also
setSequence()