dxFeed Graal CXX API v4.2.0
|
Candle price level attribute of CandleSymbol defines how candles shall be aggregated in respect to price interval. More...
#include <CandlePriceLevel.hpp>
Public Member Functions | |
double | getValue () const noexcept |
Returns price level value. | |
std::string | toString () const |
Returns string representation of this price level. | |
std::string | changeAttributeForSymbol (const dxfcpp::StringLikeWrapper &symbol) const override |
Returns candle event symbol string with this candle price level set. | |
Static Public Member Functions | |
static CandlePriceLevel | parse (const dxfcpp::StringLikeWrapper &s) |
Parses string representation of candle price level into object. | |
static CandlePriceLevel | valueOf (double value) |
Returns candle price level with the given value. | |
static CandlePriceLevel | getAttributeForSymbol (const dxfcpp::StringLikeWrapper &symbol) |
Returns candle price level 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 price level attribute. | |
Static Public Attributes | |
static const CandlePriceLevel | DEFAULT {math::NaN} |
Default price level corresponds to NaN (std::numeric_limits<double>::quiet_NaN()) | |
static const std::string | ATTRIBUTE_KEY {"pl"} |
The attribute key that is used to store the value of CandlePriceLevel in a symbol string using methods of MarketEventSymbols class. | |
Candle price level attribute of CandleSymbol defines how candles shall be aggregated in respect to price interval.
The negative or infinite values of price interval are treated as exceptional.
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 CandlePriceLevel::ATTRIBUTE_KEY constant. The value that this key shall be set to is equal to the corresponding CandlePriceLevel::toString()
|
inlineoverridevirtual |
Returns candle event symbol string with this candle price level set.
symbol | original candle event symbol. |
Implements CandleSymbolAttribute.
References ATTRIBUTE_KEY, MarketEventSymbols::changeAttributeStringByKey(), DEFAULT, MarketEventSymbols::removeAttributeStringByKey(), and toString().
|
inlinestatic |
Returns candle price level of the given candle symbol string.
The result is CandlePriceLevel::DEFAULT if the symbol does not have candle price level attribute.
symbol | candle symbol string. |
References ATTRIBUTE_KEY, DEFAULT, and parse().
|
inlinenoexcept |
Returns price level value.
For example, the value of 1
represents [0;1), [1;2)
and so on intervals to build candles.
|
inlinestatic |
Returns candle symbol string with the normalized representation of the candle price level attribute.
symbol | candle symbol string. |
References ATTRIBUTE_KEY, MarketEventSymbols::changeAttributeStringByKey(), DEFAULT, parse(), and MarketEventSymbols::removeAttributeStringByKey().
|
inlinestatic |
Parses string representation of candle price level into object.
Any string that was returned by CandlePriceLevel::toString() can be parsed and case is ignored for parsing.
s | string representation of candle price level. |
References valueOf().
Referenced by getAttributeForSymbol(), and normalizeAttributeForSymbol().
|
inline |
Returns string representation of this price level.
The string representation is composed of value. This string representation can be converted back into object with CandlePriceLevel::parse() method.
Referenced by changeAttributeForSymbol().
|
inlinestatic |
Returns candle price level with the given value.
value | candle price level value. |
InvalidArgumentException | if value is incorrect |
References DEFAULT.
Referenced by parse().
|
static |
The attribute key that is used to store the value of CandlePriceLevel
in a symbol string using methods of MarketEventSymbols class.
The value of this constant is "pl". The value that this key shall be set to is equal to the corresponding CandlePriceLevel::toString()
Referenced by changeAttributeForSymbol(), getAttributeForSymbol(), and normalizeAttributeForSymbol().