public enum CandleType extends Enum<CandleType>
CandlePeriod
type together
its actual value
.Enum Constant and Description |
---|
DAY
Certain number of days.
|
HOUR
Certain number of hours.
|
MINUTE
Certain number of minutes.
|
MONTH
Certain number of months.
|
OPTEXP
Certain number of option expirations.
|
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.
|
SECOND
Certain number of seconds.
|
TICK
Certain number of ticks.
|
VOLUME
Certain volume of trades.
|
WEEK
Certain number of weeks.
|
YEAR
Certain number of years.
|
Modifier and Type | Method and Description |
---|---|
long |
getPeriodIntervalMillis()
Returns candle type period in milliseconds as closely as possible.
|
static CandleType |
parse(String s)
Parses string representation of candle type into object.
|
String |
toString()
Returns string representation of this candle type.
|
static CandleType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CandleType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CandleType TICK
public static final CandleType SECOND
public static final CandleType MINUTE
public static final CandleType HOUR
public static final CandleType DAY
public static final CandleType WEEK
public static final CandleType MONTH
public static final CandleType OPTEXP
public static final CandleType YEAR
public static final CandleType VOLUME
public static final CandleType PRICE
public static final CandleType PRICE_MOMENTUM
public static final CandleType PRICE_RENKO
public static CandleType[] values()
for (CandleType c : CandleType.values()) System.out.println(c);
public static CandleType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic long getPeriodIntervalMillis()
SECOND
and
DAY
span a specific number of milliseconds.
MONTH
, OPTEXP
and YEAR
are approximate. Candle type period of
TICK
, VOLUME
, PRICE
,
PRICE_MOMENTUM
and PRICE_RENKO
is not defined and this method returns 0
.public String toString()
name
. For example,
TICK
is represented as "t"
, while MONTH
is represented as
"mo"
to distinguish it from MINUTE
that is represented as "m"
.toString
in class Enum<CandleType>
public static CandleType parse(String s)
Enum.name()
can be parsed
(including the one that was returned by toString()
)
and case is ignored for parsing.s
- string representation of candle type.IllegalArgumentException
- if the string representation is invalid.Copyright © 2002–2023 Devexperts LLC. All rights reserved.