dxFeed Graal CXX API v5.0.0
Loading...
Searching...
No Matches
CandleExchange Struct Reference

Exchange attribute of CandleSymbol defines the exchange identifier where data is taken from to build the candles. More...

#include <CandleExchange.hpp>

+ Inheritance diagram for CandleExchange:

Public Member Functions

char getExchangeCode () const noexcept
 Returns exchange code.
 
std::string changeAttributeForSymbol (const StringLike &symbol) const override
 Returns candle event symbol string with this exchange set.
 
std::string toString () const
 Returns string representation of this exchange.
 

Static Public Member Functions

static CandleExchange valueOf (char exchangeCode) noexcept
 Returns an exchange attribute object that corresponds to the specified exchange code character.
 
static CandleExchange getAttributeForSymbol (const StringLike &symbol)
 Returns exchange an attribute object of the given candle symbol string.
 

Static Public Attributes

static const CandleExchange COMPOSITE {'\0'}
 Composite exchange where data is taken from all exchanges.
 
static const CandleExchange DEFAULT = COMPOSITE
 Default exchange is CandleExchange::COMPOSITE.
 

Detailed Description

Exchange attribute of CandleSymbol defines the exchange identifier where data is taken from to build the candles.

Implementation details

This attribute is encoded in a symbol string with MarketEventSymbols.getExchangeCode and changeExchangeCode methods.

Member Function Documentation

◆ changeAttributeForSymbol()

std::string CandleExchange::changeAttributeForSymbol ( const StringLike & symbol) const
overridevirtual

Returns candle event symbol string with this exchange set.

Parameters
symbolThe original candle event symbol.
Returns
candle event symbol string with this exchange set.

Implements CandleSymbolAttribute.

◆ getAttributeForSymbol()

CandleExchange CandleExchange::getAttributeForSymbol ( const StringLike & symbol)
static

Returns exchange an attribute object of the given candle symbol string.

The result is CandleExchange::DEFAULT if the symbol does not have an exchange attribute.

Parameters
symbolcandle symbol string.
Returns
exchange attribute object of the given candle symbol string.

References MarketEventSymbols::getExchangeCode(), and valueOf().

◆ getExchangeCode()

char CandleExchange::getExchangeCode ( ) const
noexcept

Returns exchange code.

It is ‘’\0'` for CandleExchange::COMPOSITE exchange.

Returns
exchange code.

◆ toString()

std::string CandleExchange::toString ( ) const

Returns string representation of this exchange.

It is the string "COMPOSITE" for CandleExchange::COMPOSITE exchange or exchange character otherwise.

Returns
string representation of this exchange.

◆ valueOf()

CandleExchange CandleExchange::valueOf ( char exchangeCode)
staticnoexcept

Returns an exchange attribute object that corresponds to the specified exchange code character.

Parameters
exchangeCodeThe exchange code character.
Returns
exchange attribute object.

References COMPOSITE.

Referenced by getAttributeForSymbol().