public enum CandlePrice extends Enum<CandlePrice> implements CandleSymbolAttribute<CandlePrice>
CandleSymbol
defines price that is used to build the candles.
MarketEventSymbols.getAttributeStringByKey
,
changeAttributeStringByKey
, and
removeAttributeStringByKey
methods.
The key to use with these methods is available via
ATTRIBUTE_KEY
constant.
The value that this key shall be set to is equal to
the corresponding CandlePrice.toString()
Enum Constant and Description |
---|
ASK
Quote ask price.
|
BID
Quote bid price.
|
LAST
Last trading price.
|
MARK
Market price defined as average between quote bid and ask prices.
|
SETTLEMENT
Official settlement price that is defined by exchange or last trading price otherwise.
|
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_KEY
The attribute key that is used to store the value of
CandlePrice in
a symbol string using methods of MarketEventSymbols class. |
static CandlePrice |
DEFAULT
Default price type is
LAST . |
Modifier and Type | Method and Description |
---|---|
String |
changeAttributeForSymbol(String symbol)
Returns candle event symbol string with this candle price type set.
|
void |
checkInAttributeImpl(CandleSymbol candleSymbol)
Internal method that initializes attribute in the candle symbol.
|
static CandlePrice |
getAttributeForSymbol(String symbol)
Returns candle price type of the given candle symbol string.
|
static String |
normalizeAttributeForSymbol(String symbol)
Returns candle symbol string with the normalized representation of the candle price type attribute.
|
static CandlePrice |
parse(String s)
Parses string representation of candle price type into object.
|
String |
toString()
Returns string representation of this candle price type.
|
static CandlePrice |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CandlePrice[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CandlePrice LAST
public static final CandlePrice BID
public static final CandlePrice ASK
public static final CandlePrice MARK
public static final CandlePrice SETTLEMENT
PriceType
values:
PriceType.INDICATIVE
, PriceType.PRELIMINARY
, and PriceType.FINAL
.public static final CandlePrice DEFAULT
LAST
.public static final String ATTRIBUTE_KEY
CandlePrice
in
a symbol string using methods of MarketEventSymbols
class.
The value of this constant is "price".
The value that this key shall be set to is equal to
the corresponding CandlePrice.toString()
public static CandlePrice[] values()
for (CandlePrice c : CandlePrice.values()) System.out.println(c);
public static CandlePrice 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 String changeAttributeForSymbol(String symbol)
changeAttributeForSymbol
in interface CandleSymbolAttribute<CandlePrice>
symbol
- original candle event symbol.public void checkInAttributeImpl(CandleSymbol candleSymbol)
checkInAttributeImpl
in interface CandleSymbolAttribute<CandlePrice>
candleSymbol
- candle symbol.IllegalStateException
- if used outside of internal initialization logic.public String toString()
name
. For example,
LAST
is represented as "last".toString
in class Enum<CandlePrice>
public static CandlePrice parse(String s)
toString()
can be parsed
and case is ignored for parsing.s
- string representation of candle price type.IllegalArgumentException
- if the string representation is invalid.public static CandlePrice getAttributeForSymbol(String symbol)
DEFAULT
if the symbol does not have candle price attribute.symbol
- candle symbol string.public static String normalizeAttributeForSymbol(String symbol)
symbol
- candle symbol string.Copyright © 2002–2023 Devexperts LLC. All rights reserved.