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::reference_wrapper< const CandleType > | parse (const dxfcpp::StringLikeWrapper &s) |
| 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 & CandleType::getName |
( |
| ) |
const & |
|
inlinenoexcept |
Returns a name of this candle type.
- Returns
- A name of this candle type
◆ getPeriodIntervalMillis()
std::int64_t CandleType::getPeriodIntervalMillis |
( |
| ) |
const |
|
inlinenoexcept |
◆ parse()
static std::reference_wrapper< const CandleType > CandleType::parse |
( |
const dxfcpp::StringLikeWrapper & | s | ) |
|
|
inlinestatic |
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.
- Exceptions
-
◆ toString()
const std::string & CandleType::toString |
( |
| ) |
const & |
|
inlinenoexcept |
◆ 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.