public enum CandleAlignment extends Enum<CandleAlignment> implements CandleSymbolAttribute<CandleAlignment>
CandleSymbol
defines how candle are aligned with respect to time.
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 CandleAlignment.toString()
Enum Constant and Description |
---|
MIDNIGHT
Align candles on midnight.
|
SESSION
Align candles on trading sessions.
|
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_KEY
The attribute key that is used to store the value of
CandleAlignment in
a symbol string using methods of MarketEventSymbols class. |
static CandleAlignment |
DEFAULT
Default alignment is
MIDNIGHT . |
Modifier and Type | Method and Description |
---|---|
String |
changeAttributeForSymbol(String symbol)
Returns candle event symbol string with this candle alignment set.
|
void |
checkInAttributeImpl(CandleSymbol candleSymbol)
Internal method that initializes attribute in the candle symbol.
|
static CandleAlignment |
getAttributeForSymbol(String symbol)
Returns candle alignment of the given candle symbol string.
|
static String |
normalizeAttributeForSymbol(String symbol)
Returns candle symbol string with the normalized representation of the candle alignment attribute.
|
static CandleAlignment |
parse(String s)
Parses string representation of candle alignment into object.
|
String |
toString()
Returns string representation of this candle alignment.
|
static CandleAlignment |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CandleAlignment[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CandleAlignment MIDNIGHT
public static final CandleAlignment SESSION
public static final CandleAlignment DEFAULT
MIDNIGHT
.public static final String ATTRIBUTE_KEY
CandleAlignment
in
a symbol string using methods of MarketEventSymbols
class.
The value of this constant is "a".
The value that this key shall be set to is equal to
the corresponding CandleAlignment.toString()
public static CandleAlignment[] values()
for (CandleAlignment c : CandleAlignment.values()) System.out.println(c);
public static CandleAlignment 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<CandleAlignment>
symbol
- original candle event symbol.public void checkInAttributeImpl(CandleSymbol candleSymbol)
checkInAttributeImpl
in interface CandleSymbolAttribute<CandleAlignment>
candleSymbol
- candle symbol.IllegalStateException
- if used outside of internal initialization logic.public String toString()
MIDNIGHT
and "s" for SESSION
.toString
in class Enum<CandleAlignment>
public static CandleAlignment parse(String s)
toString()
can be parsed
and case is ignored for parsing.s
- string representation of candle alignment.IllegalArgumentException
- if the string representation is invalid.public static CandleAlignment getAttributeForSymbol(String symbol)
DEFAULT
if the symbol does not have candle alignment attribute.symbol
- candle symbol string.public static String normalizeAttributeForSymbol(String symbol)
symbol
- candle symbol string.Copyright © 2002–2023 Devexperts LLC. All rights reserved.