dxFeed Graal CXX API
Loading...
Searching...
No Matches
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 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 EventTypeWithSymbol< CandleSymbol >
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 TimeSeriesEvent
using Ptr = std::shared_ptr<TimeSeriesEvent>
 The alias to a type of shared pointer to the TimeSeriesEvent 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 Types inherited from 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 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.
 
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.
 
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.
 
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.
 
void setIndex (std::int64_t index) override
 Changes unique per-symbol index of this event.
 
CandlewithIndex (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.
 
std::int32_t getSequence () const noexcept
 Returns the sequence number of this event to distinguish events that have the same time.
 
void setSequence (std::int32_t sequence)
 Changes sequence number of this event.
 
CandlewithSequence (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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
double getImpVolatility () const noexcept
 Returns the implied volatility.
 
void setImpVolatility (double impVolatility)
 Changes the implied volatility.
 
CandlewithImpVolatility (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.
 
std::string toString () const noexcept override
 Returns a string representation of the current object.
 
- Public Member Functions inherited from EventType
std::string toString () const noexcept override
 Returns a string representation of the current object.
 
- Public Member Functions inherited from SharedEntity
template<typename T >
bool is () const noexcept
 Checks that pointer to the current type could be converted to type T* In other words: whether type T belongs to the type hierarchy in which the current type resides.
 
template<typename T >
std::shared_ptr< T > sharedAs () noexcept
 Returns a pointer to the current object wrapped in a smart pointer to type T.
 
template<typename T >
std::shared_ptr< T > sharedAs () const noexcept
 Returns a pointer to the current object wrapped in a smart pointer to type T.
 
- Public Member Functions inherited from Entity
virtual ~Entity () noexcept=default
 The default virtual d-tor.
 
- Public Member Functions inherited from 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 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::CANDLE
 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.
 

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

Candle::Candle ( CandleSymbol eventSymbol)
inlineexplicitnoexcept

Creates new candle with the specified candle event symbol.

Parameters
eventSymbolcandle event symbol.

Member Function Documentation

◆ freeGraal()

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

◆ getAskVolume()

double Candle::getAskVolume ( ) const
inlinenoexcept

Returns ask volume in this candle.

Returns
Ask volume in this candle.

◆ getBidVolume()

double Candle::getBidVolume ( ) const
inlinenoexcept

Returns bid volume in this candle.

Returns
Bid volume in this candle.

◆ getClose()

double Candle::getClose ( ) const
inlinenoexcept

Returns the last (close) price of this candle.

Returns
The last (close) price of this candle.

◆ getCount()

std::int64_t 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 Candle::getEventFlags ( ) const
inlineoverridevirtualnoexcept

Returns transactional event flags.

See EventFlag "Event Flags" section.

Returns
The transactional event flags.

Implements IndexedEvent.

◆ getEventFlagsMask()

EventFlagsMask Candle::getEventFlagsMask ( ) const
inlineoverridevirtualnoexcept

Returns transactional event flags.

See EventFlag "Event Flags" section.

Returns
The transactional event flags' mask.

Implements IndexedEvent.

◆ getEventSymbol()

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

Returns symbol of this event.

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

Implements EventTypeWithSymbol< CandleSymbol >.

◆ getEventSymbolOpt()

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

Returns symbol of this event.

Returns
symbol of this event or std::nullopt.

Implements EventTypeWithSymbol< CandleSymbol >.

◆ getEventTime()

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

◆ getHigh()

double Candle::getHigh ( ) const
inlinenoexcept

Returns the maximal (high) price of this candle.

Returns
The maximal (high) price of this candle.

◆ getImpVolatility()

double Candle::getImpVolatility ( ) const
inlinenoexcept

Returns the implied volatility.

Returns
The implied volatility.

◆ getIndex()

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

Returns unique per-symbol index of this event.

Returns
unique per-symbol index of this event.

Implements IndexedEvent.

◆ getLow()

double Candle::getLow ( ) const
inlinenoexcept

Returns the minimal (low) price of this candle.

Returns
The minimal (low) price of this candle.

◆ getOpen()

double Candle::getOpen ( ) const
inlinenoexcept

Returns the first (open) price of this candle.

Returns
The first (open) price of this candle.

◆ getOpenInterest()

double Candle::getOpenInterest ( ) const
inlinenoexcept

Returns the open interest.

Returns
The open interest.

◆ getSequence()

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

References MAX_SEQUENCE.

Referenced by setTime().

◆ getTime()

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

Returns timestamp of the event in milliseconds.

Returns
timestamp of the event in milliseconds

Implements TimeSeriesEvent.

◆ getVolume()

double Candle::getVolume ( ) const
inlinenoexcept

Returns total volume in this candle.

Returns
Total volume in this candle.

◆ getVWAP()

double 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 Candle::setAskVolume ( double askVolume)
inlinenoexcept

Changes ask volume in this candle.

Parameters
askVolumeAsk volume in this candle.

Referenced by withAskVolume().

◆ setBidVolume()

void Candle::setBidVolume ( double bidVolume)
inlinenoexcept

Changes bid volume in this candle.

Parameters
bidVolumeBid volume in this candle.

Referenced by withBidVolume().

◆ setClose()

void Candle::setClose ( double close)
inlinenoexcept

Changes the last (close) price of this candle.

Parameters
closeThe last (close) price of this candle.

Referenced by withClose().

◆ setCount()

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

Referenced by withCount().

◆ setEventFlags() [1/2]

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

Changes transactional event flags.

See EventFlag "Event Flags" section.

Parameters
eventFlagstransactional event flags.

Implements IndexedEvent.

Referenced by withEventFlags().

◆ setEventSymbol()

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

Changes event symbol that identifies this event type in subscription.

Parameters
eventSymbolevent symbol.

Implements EventTypeWithSymbol< CandleSymbol >.

Referenced by withEventSymbol().

◆ setEventTime()

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

Referenced by withEventTime().

◆ setHigh()

void Candle::setHigh ( double high)
inlinenoexcept

Changes the maximal (high) price of this candle.

Parameters
highThe maximal (high) price of this candle.

Referenced by withHigh().

◆ setImpVolatility()

void Candle::setImpVolatility ( double impVolatility)
inline

Changes the implied volatility.

Parameters
impVolatilityThe implied volatility.

Referenced by withImpVolatility().

◆ setIndex()

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

Changes unique per-symbol index of this event.

Parameters
indexunique per-symbol index of this event.

Implements IndexedEvent.

Referenced by withIndex().

◆ setLow()

void Candle::setLow ( double low)
inlinenoexcept

Changes the minimal (low) price of this candle.

Parameters
lowThe minimal (low) price of this candle.

Referenced by withLow().

◆ setOpen()

void Candle::setOpen ( double open)
inlinenoexcept

Changes the first (open) price of this candle.

Parameters
openThe first (open) price of this candle.

Referenced by withOpen().

◆ setOpenInterest()

void Candle::setOpenInterest ( double openInterest)
inlinenoexcept

Changes the open interest.

Parameters
openInterestThe open interest.

Referenced by withOpenInterest().

◆ setSequence()

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

Changes sequence number of this event.

Parameters
sequencethe sequence.
See also
Candle::getSequence()
Exceptions
std::invalid_argumentif sequence is below zero or above MAX_SEQUENCE.

References MAX_SEQUENCE.

Referenced by withSequence().

◆ setTime()

void 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()

References getSequence().

Referenced by withTime().

◆ setVolume()

void Candle::setVolume ( double volume)
inlinenoexcept

Changes total volume in this candle.

Parameters
volumeTotal volume in this candle.

Referenced by withVolume().

◆ setVWAP()

void Candle::setVWAP ( double vwap)
inlinenoexcept

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

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

Referenced by withVWAP().

◆ toGraal()

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

References toString().

◆ toString()

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

Returns a string representation of the current object.

Returns
a string representation

Reimplemented from SharedEntity.

Referenced by toGraal().

◆ withAskVolume()

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

References setAskVolume().

◆ withBidVolume()

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

References setBidVolume().

◆ withClose()

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

References setClose().

◆ withCount()

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

References setCount().

◆ withEventFlags() [1/2]

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

References setEventFlags().

◆ withEventFlags() [2/2]

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

References setEventFlags().

◆ withEventSymbol()

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

References setEventSymbol().

◆ withEventTime()

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

References setEventTime().

◆ withHigh()

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

References setHigh().

◆ withImpVolatility()

Candle & Candle::withImpVolatility ( double impVolatility)
inlinenoexcept

Changes implied volatility.

Returns the current candle.

Parameters
impVolatilityThe implied volatility.
Returns
The current candle.

References setImpVolatility().

◆ withIndex()

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

References setIndex().

◆ withLow()

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

References setLow().

◆ withOpen()

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

References setOpen().

◆ withOpenInterest()

Candle & Candle::withOpenInterest ( double openInterest)
inlinenoexcept

Changes the open interest.

Returns the current candle.

Parameters
openInterestThe open interest.
Returns
The current candle.

References setOpenInterest().

◆ withSequence()

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

References setSequence().

◆ withTime()

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

References setTime().

◆ withVolume()

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

References setVolume().

◆ withVWAP()

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

References setVWAP().

Member Data Documentation

◆ MAX_SEQUENCE

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

Maximum allowed sequence value.

See also
Candle::setSequence()

Referenced by getSequence(), and setSequence().