Candle alignment attribute of CandleSymbol defines how candle are aligned with respect to time.
More...
#include <CandleAlignment.hpp>
|
std::string | changeAttributeForSymbol (const dxfcpp::StringLikeWrapper &symbol) const override |
| Returns candle event symbol string with this candle alignment set.
|
|
std::string | toString () const noexcept |
| Returns string representation of this candle alignment.
|
|
|
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.
|
|
Candle alignment attribute of CandleSymbol defines how candle are aligned with respect to time.
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 CandleAlignment::ATTRIBUTE_KEY constant. The value that this key shall be set to is equal to the corresponding CandleAlignment::toString()
◆ changeAttributeForSymbol()
std::string CandleAlignment::changeAttributeForSymbol |
( |
const dxfcpp::StringLikeWrapper & | symbol | ) |
const |
|
inlineoverridevirtual |
Returns candle event symbol string with this candle alignment set.
- Parameters
-
symbol | The original candle event symbol. |
- Returns
- candle event symbol string with this candle alignment set.
Implements CandleSymbolAttribute.
◆ getAttributeForSymbol()
static std::reference_wrapper< const CandleAlignment > CandleAlignment::getAttributeForSymbol |
( |
const dxfcpp::StringLikeWrapper & | symbol | ) |
|
|
inlinestatic |
Returns candle alignment of the given candle symbol string.
The result is CandleAlignment::DEFAULT if the symbol does not have candle alignment attribute.
- Parameters
-
symbol | The candle symbol string. |
- Returns
- candle alignment of the given candle symbol string.
◆ normalizeAttributeForSymbol()
static std::string CandleAlignment::normalizeAttributeForSymbol |
( |
const dxfcpp::StringLikeWrapper & | symbol | ) |
|
|
inlinestatic |
Returns candle symbol string with the normalized representation of the candle alignment attribute.
- Parameters
-
symbol | The candle symbol string. |
- Returns
- candle symbol string with the normalized representation of the the candle alignment attribute.
◆ parse()
static std::reference_wrapper< const CandleAlignment > CandleAlignment::parse |
( |
const dxfcpp::StringLikeWrapper & | s | ) |
|
|
inlinestatic |
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.
- Parameters
-
s | The string representation of candle alignment. |
- Returns
- The candle alignment (reference)
- Exceptions
-
std::invalid_argument | if the string representation is invalid. |
◆ toString()
std::string CandleAlignment::toString |
( |
| ) |
const |
|
inlinenoexcept |
◆ ATTRIBUTE_KEY
const std::string CandleAlignment::ATTRIBUTE_KEY {"a"} |
|
static |