Type of the candle aggregation period constitutes CandlePeriod type together its actual value.
More...
#include <CandleType.hpp>
|
std::int64_t | getPeriodIntervalMillis () const noexcept |
| Returns candle type period in milliseconds as closely as possible.
|
|
const std::string & | getName () const &noexcept |
| Returns a name of this candle type.
|
|
const std::string & | toString () const &noexcept |
| Returns string representation of this candle type.
|
|
|
static std::optional< std::reference_wrapper< const CandleType > > | parse (const std::string &s) noexcept |
| Parses string representation of candle type into object.
|
|
|
static const CandleType | TICK {"TICK", "t", 0LL} |
| Certain number of ticks.
|
|
static const CandleType | SECOND {"SECOND", "s", 1000LL} |
| Certain number of seconds.
|
|
static const CandleType | MINUTE {"MINUTE", "m", 60LL * 1000LL} |
| Certain number of minutes.
|
|
static const CandleType | HOUR {"HOUR", "h", 60LL * 60LL * 1000L} |
| Certain number of hours.
|
|
static const CandleType | DAY {"DAY", "d", 24LL * 60LL * 60LL * 1000L} |
| Certain number of days.
|
|
static const CandleType | WEEK {"WEEK", "w", 7LL * 24LL * 60LL * 60LL * 1000LL} |
| Certain number of weeks.
|
|
static const CandleType | MONTH |
| Certain number of months.
|
|
static const CandleType | OPTEXP |
| Certain number of option expirations.
|
|
static const CandleType | YEAR |
| Certain number of years.
|
|
static const CandleType | VOLUME |
| Certain volume of trades.
|
|
static const CandleType | PRICE |
| Certain price change, calculated according to the following rules:
|
|
static const CandleType | PRICE_MOMENTUM |
| Certain price change, calculated according to the following rules:
|
|
static const CandleType | PRICE_RENKO |
| Certain price change, calculated according to the following rules:
|
|
Type of the candle aggregation period constitutes CandlePeriod type together its actual value.
◆ getName()
const std::string & dxfcpp::CandleType::getName |
( |
| ) |
const & |
|
inlinenoexcept |
Returns a name of this candle type.
- Returns
- A name of this candle type
◆ getPeriodIntervalMillis()
std::int64_t dxfcpp::CandleType::getPeriodIntervalMillis |
( |
| ) |
const |
|
inlinenoexcept |
◆ parse()
static std::optional< std::reference_wrapper< const CandleType > > dxfcpp::CandleType::parse |
( |
const std::string & | s | ) |
|
|
inlinestaticnoexcept |
Parses string representation of candle type into object.
Any string that that is a prefix of candle type CandleType::getName() can be parsed (including the one that was returned by CandleType::toString()) and case is ignored for parsing.
- Parameters
-
s | The string representation of candle type. |
- Returns
- A candle type or std::nullopt if the string representation is invalid.
◆ toString()
const std::string & dxfcpp::CandleType::toString |
( |
| ) |
const & |
|
inlinenoexcept |
Returns string representation of this candle type.
The string representation of candle type is the shortest unique prefix of the lower case string that corresponds to its name. For example, CandleType::TICK is represented as "t"
, while CandleType::MONTH is represented as "mo"
to distinguish it from CandleType::MINUTE that is represented as "m"
.
- Returns
- string representation of this candle price type.
◆ PRICE
Certain price change, calculated according to the following rules:
-
high(n) - low(n) = price range
-
close(n) = high(n) or close(n) = low(n)
-
open(n+1) = close(n)
where n is the number of the bar.
◆ PRICE_MOMENTUM
const CandleType dxfcpp::CandleType::PRICE_MOMENTUM |
|
static |
Certain price change, calculated according to the following rules:
-
high(n) - low(n) = price range
-
close(n) = high(n) or close(n) = low(n)
-
open(n+1) = close(n) + tick size, if close(n) = high(n)
-
open(n+1) = close(n) - tick size, if close(n) = low(n)
where n is the number of the bar.
◆ PRICE_RENKO
Certain price change, calculated according to the following rules:
-
high(n+1) - high(n) = price range or low(n) - low(n+1) = price range
-
close(n) = high(n) or close(n) = low(n)
-
open(n+1) = high(n), if high(n+1) - high(n) = price range
-
open(n+1) = low(n), if low(n) - low(n+1) = price range
where n is the number of the bar.