Price type attribute of CandleSymbol defines the price used to build the candles.
More...
#include <CandlePrice.hpp>
|
| std::string | changeAttributeForSymbol (const StringLike &symbol) const override |
| | Returns candle event symbol string with this candle price type set.
|
| |
| const std::string & | toString () const &noexcept |
| | Returns string representation of this candle price type.
|
| |
Price type attribute of CandleSymbol defines the price used to build the candles.
Implementation details
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 CandlePrice::ATTRIBUTE_KEY constant. The value that this key shall be set to is equal to the corresponding CandlePrice::toString()
◆ changeAttributeForSymbol()
| std::string CandlePrice::changeAttributeForSymbol |
( |
const StringLike & | symbol | ) |
const |
|
overridevirtual |
Returns candle event symbol string with this candle price type set.
- Parameters
-
| symbol | original candle event symbol. |
- Returns
- candle event symbol string with this candle price type set.
Implements CandleSymbolAttribute.
References DEFAULT, and toString().
◆ getAttributeForSymbol()
| std::reference_wrapper< const CandlePrice > CandlePrice::getAttributeForSymbol |
( |
const StringLike & | symbol | ) |
|
|
staticnoexcept |
Returns the candle price type of the given candle symbol string.
The result is CandlePrice::DEFAULT if the symbol does not have a candle price type attribute.
- Parameters
-
| symbol | The candle symbol string. |
- Returns
- candle price type of the given candle symbol string.
References DEFAULT.
◆ normalizeAttributeForSymbol()
| std::string CandlePrice::normalizeAttributeForSymbol |
( |
const StringLike & | symbol | ) |
|
|
static |
Returns candle symbol string with the normalized representation of the candle price type attribute.
- Parameters
-
| symbol | candle symbol string. |
- Returns
- candle symbol string with the normalized representation of the candle price type attribute.
References DEFAULT.
◆ parse()
Parses string representation of a candle price type into an object.
Any string returned by CandlePrice::toString() can be parsed, and a case is ignored for parsing.
- Parameters
-
| s | The string representation of a candle price type. |
- Returns
- The candle price type (reference).
- Exceptions
-
◆ toString()
| const std::string & CandlePrice::toString |
( |
| ) |
const & |
|
noexcept |
Returns string representation of this candle price type.
The string representation of a candle price type is a lower case string that corresponds to its name. For example, CandlePrice::LAST is represented as "last".
- Returns
- string representation of this candle price type.
Referenced by changeAttributeForSymbol().
◆ ATTRIBUTE_KEY
| const std::string CandlePrice::ATTRIBUTE_KEY {"price"} |
|
static |
◆ SETTLEMENT