Type of the candle aggregation period constitutes CandlePeriod type together its actual value.
More...
#include <CandleType.hpp>
|
| std::int64_t | getPeriodIntervalMillis () const noexcept |
| | Returns a 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::reference_wrapper< const CandleType > | parse (const StringLike &s) |
| | Parses string representation of a candle type into an 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 & CandleType::getName |
( |
| ) |
const & |
|
noexcept |
Returns a name of this candle type.
- Returns
- A name of this candle type
◆ getPeriodIntervalMillis()
| std::int64_t CandleType::getPeriodIntervalMillis |
( |
| ) |
const |
|
noexcept |
◆ parse()
Parses string representation of a candle type into an object.
Any string that is a prefix of candle type CandleType::getName() can be parsed (including the one that was returned by CandleType::toString()) and a case is ignored for parsing.
- Parameters
-
| s | The string representation of a candle type. |
- Returns
- A candle type.
- Exceptions
-
Referenced by CandlePeriod::parse().
◆ toString()
| const std::string & CandleType::toString |
( |
| ) |
const & |
|
noexcept |
Returns string representation of this candle type.
The string representation of a 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.
- Exceptions
-
Referenced by CandlePeriod::parse().
◆ 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
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.