dxFeed Graal CXX API
Loading...
Searching...
No Matches
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 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 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 IndexedEvent
using Ptr = std::shared_ptr<IndexedEvent>
 The alias to a type of shared pointer to the IndexedEvent object.
 

Public Member Functions

void * toGraal () const 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.
 
SerieswithEventSymbol (const std::string &eventSymbol) noexcept
 Changes event's symbol and returns the current series.
 
SerieswithEventTime (std::int64_t eventTime) noexcept
 Changes event's creation time and returns 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.
 
SerieswithEventFlags (const EventFlagsMask &eventFlags) noexcept
 Changes transactional event flags and returns the current series.
 
std::int64_t getIndex () const noexcept override
 Returns unique per-symbol index of this event.
 
void setIndex (std::int64_t index) 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.
 
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.
 
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)
 Changes sequence number of this series event.
 
SerieswithSequence (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 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 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 Member Functions

static Ptr fromGraal (void *graalNative)
 Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
 
static void freeGraal (void *graalNative)
 Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
 

Static Public Attributes

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

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

Creates new series event with the specified event symbol.

Parameters
eventSymbolThe event symbol.

Member Function Documentation

◆ freeGraal()

void Series::freeGraal ( void * graalNative)
static

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

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.

◆ fromGraal()

std::shared_ptr< Series > Series::fromGraal ( void * graalNative)
static

Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.
Returns
The object of current type.
Exceptions
std::invalid_argument

◆ getCallVolume()

double Series::getCallVolume ( ) const
inlinenoexcept

Returns call options traded volume for a day.

Returns
call options traded volume for a day.

◆ getDividend()

double 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 Series::getEventFlags ( ) const
inlineoverridevirtualnoexcept

Returns transactional event flags.

See EventFlag "Event Flags" section.

Returns
The transactional event flags.

Implements IndexedEvent.

◆ getEventFlagsMask()

EventFlagsMask Series::getEventFlagsMask ( ) const
inlineoverridevirtualnoexcept

Returns transactional event flags.

See EventFlag "Event Flags" section.

Returns
The transactional event flags' mask.

Implements IndexedEvent.

◆ getExpiration()

std::int32_t 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 Series::getForwardPrice ( ) const
inlinenoexcept

Returns implied forward price for this option series.

Returns
implied forward price for this option series.

◆ getIndex()

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

◆ getInterest()

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

Returns options traded volume for a day.

Returns
options traded volume for a day.

◆ getPutCallRatio()

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

Returns put options traded volume for a day.

Returns
put options traded volume for a day.

◆ getSequence()

std::int32_t 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.

References MAX_SEQUENCE.

Referenced by setTime().

◆ getSource()

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

Returns the source of this event.

Returns
The source of this event.

Implements IndexedEvent.

References IndexedEventSource::DEFAULT.

◆ getTime()

std::int64_t 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 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 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 Series::setCallVolume ( double callVolume)
inlinenoexcept

Changes call options traded volume for a day.

Parameters
callVolumecall options traded volume for a day.

◆ setDividend()

void 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 Series::setEventFlags ( const EventFlagsMask & eventFlags)
inlineoverridevirtualnoexcept

Changes transactional event flags.

See EventFlag "Event Flags" section.

Parameters
eventFlagstransactional event flags' mask.

Implements IndexedEvent.

References EventFlagsMask::getMask().

Referenced by withEventFlags().

◆ setEventFlags() [2/2]

void Series::setEventFlags ( std::int32_t eventFlags)
inlineoverridevirtualnoexcept

Changes transactional event flags.

See EventFlag "Event Flags" section.

Parameters
eventFlagstransactional event flags.

Implements IndexedEvent.

Referenced by withEventFlags().

◆ setExpiration()

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

Changes day id of expiration.

Parameters
expirationday id of expiration.

◆ setForwardPrice()

void Series::setForwardPrice ( double forwardPrice)
inlinenoexcept

Changes implied forward price for this option series.

Parameters
forwardPriceimplied forward price for this option series.

◆ setIndex()

void Series::setIndex ( std::int64_t index)
inlineoverridevirtual

Changes unique per-symbol index of this event.

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

Implements IndexedEvent.

Referenced by withIndex().

◆ setInterest()

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

Changes put options traded volume for a day.

Parameters
putVolumeput options traded volume for a day.

◆ setSequence()

void Series::setSequence ( std::int32_t sequence)
inline

Changes sequence number of this series event.

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

References MAX_SEQUENCE.

Referenced by withSequence().

◆ setTime()

void 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.

References getSequence().

Referenced by withTime().

◆ setTimeSequence()

void 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 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 * Series::toGraal ( ) const
overridevirtual

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 EventType.

◆ toString()

std::string Series::toString ( ) const
overridevirtualnoexcept

Returns a string representation of the current object.

Returns
a string representation

Reimplemented from EventType.

◆ withEventFlags() [1/2]

Series & 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.

References setEventFlags().

◆ withEventFlags() [2/2]

Series & 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.

References setEventFlags().

◆ withEventSymbol()

Series & Series::withEventSymbol ( const std::string & eventSymbol)
inlinenoexcept

Changes event's symbol and returns the current series.

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

References MarketEvent::setEventSymbol().

◆ withEventTime()

Series & 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.

References MarketEvent::setEventTime().

◆ withIndex()

Series & 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.

References setIndex().

◆ withSequence()

Series & 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()

References setSequence().

◆ withTime()

Series & 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.

References setTime().

Member Data Documentation

◆ MAX_SEQUENCE

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

Maximum allowed sequence value.

See also
setSequence()

Referenced by getSequence(), and setSequence().