dxFeed Graal CXX API v4.0.0
|
Candle alignment attribute of CandleSymbol defines how candle are aligned with respect to time. More...
#include <CandleAlignment.hpp>
Public Member Functions | |
std::string | changeAttributeForSymbol (const dxfcpp::StringLikeWrapper &symbol) const override |
Returns candle event symbol string with this candle alignment set. | |
std::string | toString () const |
Returns string representation of this candle alignment. | |
Public Member Functions inherited from CandleSymbolAttribute |
Static Public Member Functions | |
static std::reference_wrapper< const CandleAlignment > | parse (const dxfcpp::StringLikeWrapper &s) |
Parses string representation of candle alignment into object. | |
static std::reference_wrapper< const CandleAlignment > | getAttributeForSymbol (const dxfcpp::StringLikeWrapper &symbol) |
Returns candle alignment of the given candle symbol string. | |
static std::string | normalizeAttributeForSymbol (const dxfcpp::StringLikeWrapper &symbol) |
Returns candle symbol string with the normalized representation of the candle alignment attribute. | |
Static Public Attributes | |
static const CandleAlignment | MIDNIGHT {"m"} |
Align candles on midnight. | |
static const CandleAlignment | SESSION {"s"} |
Align candles on trading sessions. | |
static const CandleAlignment | DEFAULT = MIDNIGHT |
Default alignment is CandleAlignment::MIDNIGHT. | |
static const std::string | ATTRIBUTE_KEY {"a"} |
The attribute key that is used to store the value of CandleAlignment in a symbol string using methods of MarketEventSymbols class. | |
Candle alignment attribute of CandleSymbol defines how candle are aligned with respect to time.
This attribute is encoded in a symbol string with MarketEventSymbols.getAttributeStringByKey, changeAttributeStringByKey, and removeAttributeStringByKey methods. The key to use with these methods is available via CandleAlignment::ATTRIBUTE_KEY constant. The value that this key shall be set to is equal to the corresponding CandleAlignment::toString()
|
overridevirtual |
Returns candle event symbol string with this candle alignment set.
symbol | The original candle event symbol. |
Implements CandleSymbolAttribute.
References ATTRIBUTE_KEY, MarketEventSymbols::changeAttributeStringByKey(), DEFAULT, MarketEventSymbols::removeAttributeStringByKey(), and toString().
|
static |
Returns candle alignment of the given candle symbol string.
The result is CandleAlignment::DEFAULT if the symbol does not have candle alignment attribute.
symbol | The candle symbol string. |
|
static |
Returns candle symbol string with the normalized representation of the candle alignment attribute.
symbol | The candle symbol string. |
References ATTRIBUTE_KEY, and MarketEventSymbols::removeAttributeStringByKey().
|
static |
Parses string representation of candle alignment into object.
Any string that was returned by CandleAlignment::toString() can be parsed and case is ignored for parsing.
s | The string representation of candle alignment. |
InvalidArgumentException | if the string representation is invalid. |
References toString().
std::string CandleAlignment::toString | ( | ) | const |
Returns string representation of this candle alignment.
The string representation of candle alignment "m" for CandleAlignment::MIDNIGHT and "s" for CandleAlignment::SESSION.
Referenced by changeAttributeForSymbol(), and parse().
|
static |
The attribute key that is used to store the value of CandleAlignment in a symbol string using methods of MarketEventSymbols class.
The value of this constant is "a". The value that this key shall be set to is equal to the corresponding CandleAlignment::toString()
Referenced by changeAttributeForSymbol(), and normalizeAttributeForSymbol().