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

Candle event with open, high, low, close prices and other information for a specific period. More...

#include <Candle.hpp>

+ Inheritance diagram for dxfcpp::Candle:

Public Types

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

void * toGraal () const noexcept override
 Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
 
 Candle () noexcept=default
 Creates new candle with default values.
 
 Candle (CandleSymbol eventSymbol) noexcept
 Creates new candle with the specified candle event symbol.
 
const CandleSymbolgetEventSymbol () const &noexcept override
 Returns symbol of this event.
 
const std::optional< CandleSymbol > & getEventSymbolOpt () const &noexcept override
 Returns symbol of this event.
 
void setEventSymbol (const CandleSymbol &eventSymbol) noexcept override
 Changes event symbol that identifies this event type in subscription.
 
CandlewithEventSymbol (const CandleSymbol &eventSymbol) noexcept
 Changes event's symbol and returns the current candle.
 
Candle::Ptr withEventSymbolShared (const CandleSymbol &eventSymbol) noexcept
 Changes event's symbol and returns a shared pointer to the current candle.
 
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.
 
CandlewithEventTime (std::int64_t eventTime) noexcept
 Changes event's creation time and returns the current candle.
 
Candle::Ptr withEventTimeShared (std::int64_t eventTime) noexcept
 Changes event's creation time and returns a shared pointer to the current candle.
 
std::string toString () const noexcept override
 Returns a string representation of the current object.
 
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.
 
CandlewithEventFlags (std::int32_t eventFlags) noexcept
 Changes transactional event flags and returns the current candle.
 
Candle::Ptr withEventFlagsShared (std::int32_t eventFlags) noexcept
 Changes transactional event flags and returns a shared pointer to the current candle.
 
void setEventFlags (const EventFlagsMask &eventFlags) noexcept override
 Changes transactional event flags.
 
CandlewithEventFlags (const EventFlagsMask &eventFlags) noexcept
 Changes transactional event flags and returns the current candle.
 
Candle::Ptr withEventFlagsShared (const EventFlagsMask &eventFlags) noexcept
 Changes transactional event flags and returns a shared pointer to the current candle.
 
void setIndex (std::int64_t index) noexcept override
 Changes unique per-symbol index of this event.
 
CandlewithIndex (std::int64_t index) noexcept
 Changes unique per-symbol index of this event.
 
Candle::Ptr withIndexShared (std::int64_t index) noexcept
 Changes unique per-symbol index of this event.
 
std::int64_t getIndex () const noexcept override
 Returns 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.
 
CandlewithTime (std::int64_t time) noexcept
 Changes timestamp of the event in milliseconds.
 
Candle::Ptr withTimeShared (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.
 
CandlewithSequence (std::int32_t sequence) noexcept
 Changes sequence number of this event.
 
Candle::Ptr withSequenceShared (std::int32_t sequence) noexcept
 Changes sequence number of this event.
 
std::int64_t getCount () const noexcept
 Returns total number of original trade (or quote) events in this candle.
 
void setCount (std::int64_t count) noexcept
 Changes total number of original trade (or quote) events in this candle.
 
CandlewithCount (std::int64_t count) noexcept
 Changes total number of original trade (or quote) events in this candle.
 
Candle::Ptr withCountShared (std::int64_t count) noexcept
 Changes total number of original trade (or quote) events in this candle.
 
double getOpen () const noexcept
 Returns the first (open) price of this candle.
 
void setOpen (double open) noexcept
 Changes the first (open) price of this candle.
 
CandlewithOpen (double open) noexcept
 Changes the first (open) price of this candle.
 
Candle::Ptr withOpenShared (double open) noexcept
 Changes the first (open) price of this candle.
 
double getHigh () const noexcept
 Returns the maximal (high) price of this candle.
 
void setHigh (double high) noexcept
 Changes the maximal (high) price of this candle.
 
CandlewithHigh (double high) noexcept
 Changes the maximal (high) price of this candle.
 
Candle::Ptr withHighShared (double high) noexcept
 Changes the maximal (high) price of this candle.
 
double getLow () const noexcept
 Returns the minimal (low) price of this candle.
 
void setLow (double low) noexcept
 Changes the minimal (low) price of this candle.
 
CandlewithLow (double low) noexcept
 Changes the minimal (low) price of this candle.
 
Candle::Ptr withLowShared (double low) noexcept
 Changes the minimal (low) price of this candle.
 
double getClose () const noexcept
 Returns the last (close) price of this candle.
 
void setClose (double close) noexcept
 Changes the last (close) price of this candle.
 
CandlewithClose (double close) noexcept
 Changes the last (close) price of this candle.
 
Candle::Ptr withCloseShared (double close) noexcept
 Changes the last (close) price of this candle.
 
double getVolume () const noexcept
 Returns total volume in this candle.
 
void setVolume (double volume) noexcept
 Changes total volume in this candle.
 
CandlewithVolume (double volume) noexcept
 Changes total volume in this candle.
 
Candle::Ptr withVolumeShared (double volume) noexcept
 Changes total volume in this candle.
 
double getVWAP () const noexcept
 Returns volume-weighted average price (VWAP) in this candle.
 
void setVWAP (double vwap) noexcept
 Changes volume-weighted average price (VWAP) in this candle.
 
CandlewithVWAP (double vwap) noexcept
 Changes volume-weighted average price (VWAP) in this candle.
 
Candle::Ptr withVWAPShared (double vwap) noexcept
 Changes volume-weighted average price (VWAP) in this candle.
 
double getBidVolume () const noexcept
 Returns bid volume in this candle.
 
void setBidVolume (double bidVolume) noexcept
 Changes bid volume in this candle.
 
CandlewithBidVolume (double bidVolume) noexcept
 Changes bid volume in this candle.
 
Candle::Ptr withBidVolumeShared (double bidVolume) noexcept
 Changes bid volume in this candle.
 
double getAskVolume () const noexcept
 Returns ask volume in this candle.
 
void setAskVolume (double askVolume) noexcept
 Changes ask volume in this candle.
 
CandlewithAskVolume (double askVolume) noexcept
 Changes ask volume in this candle.
 
Candle::Ptr withAskVolumeShared (double askVolume) noexcept
 Changes ask volume in this candle.
 
double getImpVolatility () const noexcept
 Returns the implied volatility.
 
void setImpVolatility (double impVolatility)
 Changes the implied volatility.
 
CandlewithImpVolatility (double impVolatility) noexcept
 Changes implied volatility.
 
Candle::Ptr withImpVolatilityShared (double impVolatility) noexcept
 Changes implied volatility.
 
double getOpenInterest () const noexcept
 Returns the open interest.
 
void setOpenInterest (double openInterest) noexcept
 Changes the open interest.
 
CandlewithOpenInterest (double openInterest) noexcept
 Changes the open interest.
 
Candle::Ptr withOpenInterestShared (double openInterest) noexcept
 Changes the open interest.
 
- Public Member Functions inherited from dxfcpp::EventType
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.
 
- Public Member Functions inherited from dxfcpp::TimeSeriesEvent
const IndexedEventSourcegetSource () const &noexcept override
 Returns the source identifier for this event, which is always DEFAULT for time-series events.
 
std::int64_t getIndex () const noexcept override
 Returns unique per-symbol index of this event.
 
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::CANDLE
 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.
 

Detailed Description

Candle event with open, high, low, close prices and other information for a specific period.

Candles are build with a specified CandlePeriod using a specified CandlePrice type with a data taken from the specified CandleExchange from the specified CandleSession with further details of aggregation provided by CandleAlignment.

Event symbol of the candle is represented with CandleSymbol class. Since the `Candle is a time-series event, it is typically subscribed to using DXFeedTimeSeriesSubscription class that handles the necessarily wrapping of the symbol into TimeSeriesSubscriptionSymbol to specify a subscription time range.

Event flags, transactions and snapshots

Some candle sources provide a consistent view of the set of known candles. 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 candles, 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. It relies on the code of AbstractIndexedEventModel to handle this logic. Use the source code of AbstractIndexedEventModel for clarification on transactions and snapshot logic.

Publishing Candles

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

Implementation details

This event is implemented on top of QDS record TradeHistory for tick candles with CandlePeriod::TICK, records Trade.<period> for a certain set of popular periods, and QDS record Candle for arbitrary custom periods, with a set of Candle{<attributes>} records for a popular combinations of custom candle symbol attributes like CandlePrice for an efficient support of bid-ask charting.

Constructor & Destructor Documentation

◆ Candle()

dxfcpp::Candle::Candle ( CandleSymbol eventSymbol)
inlineexplicitnoexcept

Creates new candle with the specified candle event symbol.

Parameters
eventSymbolcandle event symbol.

Member Function Documentation

◆ freeGraal()

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

◆ getAskVolume()

double dxfcpp::Candle::getAskVolume ( ) const
inlinenoexcept

Returns ask volume in this candle.

Returns
Ask volume in this candle.

◆ getBidVolume()

double dxfcpp::Candle::getBidVolume ( ) const
inlinenoexcept

Returns bid volume in this candle.

Returns
Bid volume in this candle.

◆ getClose()

double dxfcpp::Candle::getClose ( ) const
inlinenoexcept

Returns the last (close) price of this candle.

Returns
The last (close) price of this candle.

◆ getCount()

std::int64_t dxfcpp::Candle::getCount ( ) const
inlinenoexcept

Returns total number of original trade (or quote) events in this candle.

Returns
Total number of original trade (or quote) events in this candle.

◆ getEventFlags()

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

Returns transactional event flags.

See EventFlag "Event Flags" section.

Returns
The transactional event flags.

Implements dxfcpp::IndexedEvent.

◆ getEventFlagsMask()

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

Returns transactional event flags.

See EventFlag "Event Flags" section.

Returns
The transactional event flags' mask.

Implements dxfcpp::IndexedEvent.

◆ getEventSymbol()

const CandleSymbol & dxfcpp::Candle::getEventSymbol ( ) const &
inlineoverridevirtualnoexcept

Returns symbol of this event.

Returns
symbol of this event or dxfcpp::CandleSymbol::NUL (dxfcpp::CandleSymbol{"<null>"})

Implements dxfcpp::EventTypeWithSymbol< CandleSymbol >.

◆ getEventSymbolOpt()

const std::optional< CandleSymbol > & dxfcpp::Candle::getEventSymbolOpt ( ) const &
inlineoverridevirtualnoexcept

Returns symbol of this event.

Returns
symbol of this event or std::nullopt.

Implements dxfcpp::EventTypeWithSymbol< CandleSymbol >.

◆ getEventTime()

std::int64_t dxfcpp::Candle::getEventTime ( ) const
inlineoverridevirtualnoexcept

Returns time when event was created or zero when time is not available.

This event time is available only when the corresponding DXEndpoint is created with DXENDPOINT_EVENT_TIME_PROPERTY and the data source has embedded event times. This is typically true only for data events that are read from historical tape files and from OnDemandService. Events that are coming from a network connections do not have an embedded event time information and this method will return zero for them, meaning that event was received just now.

Default implementation returns 0.

Returns
The difference, measured in milliseconds, between the event creation time and midnight, January 1, 1970 UTC or zero when time is not available.

Reimplemented from dxfcpp::EventType.

◆ getHigh()

double dxfcpp::Candle::getHigh ( ) const
inlinenoexcept

Returns the maximal (high) price of this candle.

Returns
The maximal (high) price of this candle.

◆ getImpVolatility()

double dxfcpp::Candle::getImpVolatility ( ) const
inlinenoexcept

Returns the implied volatility.

Returns
The implied volatility.

◆ getIndex()

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

Returns unique per-symbol index of this event.

Returns
unique per-symbol index of this event.

Implements dxfcpp::IndexedEvent.

◆ getLow()

double dxfcpp::Candle::getLow ( ) const
inlinenoexcept

Returns the minimal (low) price of this candle.

Returns
The minimal (low) price of this candle.

◆ getOpen()

double dxfcpp::Candle::getOpen ( ) const
inlinenoexcept

Returns the first (open) price of this candle.

Returns
The first (open) price of this candle.

◆ getOpenInterest()

double dxfcpp::Candle::getOpenInterest ( ) const
inlinenoexcept

Returns the open interest.

Returns
The open interest.

◆ getSequence()

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

Returns
The sequence number of this event

◆ getTime()

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

Returns timestamp of the event in milliseconds.

Returns
timestamp of the event in milliseconds

Implements dxfcpp::TimeSeriesEvent.

◆ getVolume()

double dxfcpp::Candle::getVolume ( ) const
inlinenoexcept

Returns total volume in this candle.

Returns
Total volume in this candle.

◆ getVWAP()

double dxfcpp::Candle::getVWAP ( ) const
inlinenoexcept

Returns volume-weighted average price (VWAP) in this candle.

Total turnover in this candle can be computed with getVWAP() * getVolume().

Returns
Volume-weighted average price (VWAP) in this candle.

◆ setAskVolume()

void dxfcpp::Candle::setAskVolume ( double askVolume)
inlinenoexcept

Changes ask volume in this candle.

Parameters
askVolumeAsk volume in this candle.

◆ setBidVolume()

void dxfcpp::Candle::setBidVolume ( double bidVolume)
inlinenoexcept

Changes bid volume in this candle.

Parameters
bidVolumeBid volume in this candle.

◆ setClose()

void dxfcpp::Candle::setClose ( double close)
inlinenoexcept

Changes the last (close) price of this candle.

Parameters
closeThe last (close) price of this candle.

◆ setCount()

void dxfcpp::Candle::setCount ( std::int64_t count)
inlinenoexcept

Changes total number of original trade (or quote) events in this candle.

Parameters
countTotal number of original trade (or quote) events in this candle.

◆ setEventFlags() [1/2]

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

Changes transactional event flags.

See EventFlag "Event Flags" section.

Parameters
eventFlagstransactional event flags.

Implements dxfcpp::IndexedEvent.

◆ setEventSymbol()

void dxfcpp::Candle::setEventSymbol ( const CandleSymbol & eventSymbol)
inlineoverridevirtualnoexcept

Changes event symbol that identifies this event type in subscription.

Parameters
eventSymbolevent symbol.

Implements dxfcpp::EventTypeWithSymbol< CandleSymbol >.

◆ setEventTime()

void dxfcpp::Candle::setEventTime ( std::int64_t )
inlineoverridevirtualnoexcept

Changes event creation time.

Default implementation does nothing.

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

Reimplemented from dxfcpp::EventType.

◆ setHigh()

void dxfcpp::Candle::setHigh ( double high)
inlinenoexcept

Changes the maximal (high) price of this candle.

Parameters
highThe maximal (high) price of this candle.

◆ setImpVolatility()

void dxfcpp::Candle::setImpVolatility ( double impVolatility)
inline

Changes the implied volatility.

Parameters
impVolatilityThe implied volatility.

◆ setIndex()

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

Changes unique per-symbol index of this event.

Parameters
indexunique per-symbol index of this event.

Implements dxfcpp::IndexedEvent.

◆ setLow()

void dxfcpp::Candle::setLow ( double low)
inlinenoexcept

Changes the minimal (low) price of this candle.

Parameters
lowThe minimal (low) price of this candle.

◆ setOpen()

void dxfcpp::Candle::setOpen ( double open)
inlinenoexcept

Changes the first (open) price of this candle.

Parameters
openThe first (open) price of this candle.

◆ setOpenInterest()

void dxfcpp::Candle::setOpenInterest ( double openInterest)
inlinenoexcept

Changes the open interest.

Parameters
openInterestThe open interest.

◆ setSequence()

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

Changes sequence number of this event.

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

◆ setTime()

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

Changes timestamp of the event in milliseconds.

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

◆ setVolume()

void dxfcpp::Candle::setVolume ( double volume)
inlinenoexcept

Changes total volume in this candle.

Parameters
volumeTotal volume in this candle.

◆ setVWAP()

void dxfcpp::Candle::setVWAP ( double vwap)
inlinenoexcept

Changes volume-weighted average price (VWAP) in this candle.

Parameters
vwapVolume-weighted average price (VWAP) in this candle.

◆ toGraal()

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

Returns a string representation of the current object.

Returns
a string representation

Reimplemented from dxfcpp::SharedEntity.

◆ withAskVolume()

Candle & dxfcpp::Candle::withAskVolume ( double askVolume)
inlinenoexcept

Changes ask volume in this candle.

Returns the current candle.

Parameters
askVolumeAsk volume in this candle.
Returns
The current candle.

◆ withAskVolumeShared()

Candle::Ptr dxfcpp::Candle::withAskVolumeShared ( double askVolume)
inlinenoexcept

Changes ask volume in this candle.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
askVolumeAsk volume in this candle.
Returns
A shared pointer to the current candle.

◆ withBidVolume()

Candle & dxfcpp::Candle::withBidVolume ( double bidVolume)
inlinenoexcept

Changes bid volume in this candle.

Returns the current candle.

Parameters
bidVolumeBid volume in this candle.
Returns
The current candle.

◆ withBidVolumeShared()

Candle::Ptr dxfcpp::Candle::withBidVolumeShared ( double bidVolume)
inlinenoexcept

Changes bid volume in this candle.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
bidVolumeBid volume in this candle.
Returns
A shared pointer to the current candle.

◆ withClose()

Candle & dxfcpp::Candle::withClose ( double close)
inlinenoexcept

Changes the last (close) price of this candle.

Returns the current candle.

Parameters
closeThe last (close) price of this candle.
Returns
The current candle.

◆ withCloseShared()

Candle::Ptr dxfcpp::Candle::withCloseShared ( double close)
inlinenoexcept

Changes the last (close) price of this candle.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
closeThe last (close) price of this candle.
Returns
A shared pointer to the current candle.

◆ withCount()

Candle & dxfcpp::Candle::withCount ( std::int64_t count)
inlinenoexcept

Changes total number of original trade (or quote) events in this candle.

Returns the current candle.

Parameters
countTotal number of original trade (or quote) events in this candle.
Returns
The current candle.

◆ withCountShared()

Candle::Ptr dxfcpp::Candle::withCountShared ( std::int64_t count)
inlinenoexcept

Changes total number of original trade (or quote) events in this candle.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
countTotal number of original trade (or quote) events in this candle.
Returns
A shared pointer to the current candle.

◆ withEventFlags() [1/2]

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

Changes transactional event flags and returns the current candle.

See EventFlag "Event Flags" section.

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

◆ withEventFlags() [2/2]

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

Changes transactional event flags and returns the current candle.

See EventFlag "Event Flags" section.

Parameters
eventFlagstransactional event flags.
Returns
The current candle.

◆ withEventFlagsShared() [1/2]

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

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

See EventFlag "Event Flags" section.

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

◆ withEventFlagsShared() [2/2]

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

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

See EventFlag "Event Flags" section.

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

◆ withEventSymbol()

Candle & dxfcpp::Candle::withEventSymbol ( const CandleSymbol & eventSymbol)
inlinenoexcept

Changes event's symbol and returns the current candle.

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

◆ withEventSymbolShared()

Candle::Ptr dxfcpp::Candle::withEventSymbolShared ( const CandleSymbol & eventSymbol)
inlinenoexcept

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

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

◆ withEventTime()

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

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

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

◆ withEventTimeShared()

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

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

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

◆ withHigh()

Candle & dxfcpp::Candle::withHigh ( double high)
inlinenoexcept

Changes the maximal (high) price of this candle.

Returns the current candle.

Parameters
highThe maximal (high) price of this candle.
Returns
The current candle.

◆ withHighShared()

Candle::Ptr dxfcpp::Candle::withHighShared ( double high)
inlinenoexcept

Changes the maximal (high) price of this candle.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
highThe maximal (high) price of this candle.
Returns
A shared pointer to the current candle.

◆ withImpVolatility()

Candle & dxfcpp::Candle::withImpVolatility ( double impVolatility)
inlinenoexcept

Changes implied volatility.

Returns the current candle.

Parameters
impVolatilityThe implied volatility.
Returns
The current candle.

◆ withImpVolatilityShared()

Candle::Ptr dxfcpp::Candle::withImpVolatilityShared ( double impVolatility)
inlinenoexcept

Changes implied volatility.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
impVolatilityThe implied volatility.
Returns
A shared pointer to the current candle.

◆ withIndex()

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

Changes unique per-symbol index of this event.

Returns the current candle.

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

◆ withIndexShared()

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

Changes unique per-symbol index of this event.

Returns a shared pointer to the current candle.

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

◆ withLow()

Candle & dxfcpp::Candle::withLow ( double low)
inlinenoexcept

Changes the minimal (low) price of this candle.

Returns the current candle.

Parameters
lowThe minimal (low) price of this candle.
Returns
The current candle.

◆ withLowShared()

Candle::Ptr dxfcpp::Candle::withLowShared ( double low)
inlinenoexcept

Changes the minimal (low) price of this candle.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
lowThe minimal (low) price of this candle.
Returns
A shared pointer to the current candle.

◆ withOpen()

Candle & dxfcpp::Candle::withOpen ( double open)
inlinenoexcept

Changes the first (open) price of this candle.

Returns the current candle.

Parameters
openThe first (open) price of this candle.
Returns
The current candle.

◆ withOpenInterest()

Candle & dxfcpp::Candle::withOpenInterest ( double openInterest)
inlinenoexcept

Changes the open interest.

Returns the current candle.

Parameters
openInterestThe open interest.
Returns
The current candle.

◆ withOpenInterestShared()

Candle::Ptr dxfcpp::Candle::withOpenInterestShared ( double openInterest)
inlinenoexcept

Changes the open interest.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
openInterestThe open interest.
Returns
A shared pointer to the current candle.

◆ withOpenShared()

Candle::Ptr dxfcpp::Candle::withOpenShared ( double open)
inlinenoexcept

Changes the first (open) price of this candle.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
openThe first (open) price of this candle.
Returns
A shared pointer to the current candle.

◆ withSequence()

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

Changes sequence number of this event.

Returns the current candle.

Parameters
sequencethe sequence.
Returns
The current candle.
See also
Candle::getSequence()

◆ withSequenceShared()

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

Changes sequence number of this event.

Returns a shared pointer to the current candle.

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

◆ withTime()

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

Changes timestamp of the event in milliseconds.

Returns the current candle.

Parameters
timetimestamp of the event in milliseconds.
Returns
The current candle.

◆ withTimeShared()

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

Changes timestamp of the event in milliseconds.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
timetimestamp of the event in milliseconds.
Returns
A shared pointer to the current candle.

◆ withVolume()

Candle & dxfcpp::Candle::withVolume ( double volume)
inlinenoexcept

Changes total volume in this candle.

Returns the current candle.

Parameters
volumeTotal volume in this candle.
Returns
The current candle.

◆ withVolumeShared()

Candle::Ptr dxfcpp::Candle::withVolumeShared ( double volume)
inlinenoexcept

Changes total volume in this candle.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
volumeTotal volume in this candle.
Returns
A shared pointer to the current candle.

◆ withVWAP()

Candle & dxfcpp::Candle::withVWAP ( double vwap)
inlinenoexcept

Changes volume-weighted average price (VWAP) in this candle.

Returns the current candle.

Parameters
vwapVolume-weighted average price (VWAP) in this candle.
Returns
The current candle.

◆ withVWAPShared()

Candle::Ptr dxfcpp::Candle::withVWAPShared ( double vwap)
inlinenoexcept

Changes volume-weighted average price (VWAP) in this candle.

Returns a shared pointer to the current candle.

Warning
Please do not use this method unless the object was created with std::shared_ptr<Candle>(new Candle(...)) or std::make_shared<Candle>(...)
Parameters
vwapVolume-weighted average price (VWAP) in this candle.
Returns
A shared pointer to the current candle.

Member Data Documentation

◆ MAX_SEQUENCE

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

Maximum allowed sequence value.

See also
Candle::setSequence()