public enum CandleSession extends Enum<CandleSession> implements CandleSymbolAttribute<CandleSession>
CandleSymbol
defines trading that is used to build the candles.
MarketEventSymbols.getAttributeStringByKey
,
changeAttributeStringByKey
, and
removeAttributeStringByKey
methods.
ANY
session is a default.
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 CandleSession.toString()
Enum Constant and Description |
---|
ANY
All trading sessions are used to build candles.
|
REGULAR
Only regular trading session data is used to build candles.
|
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_KEY
The attribute key that is used to store the value of
CandleSession in
a symbol string using methods of MarketEventSymbols class. |
static CandleSession |
DEFAULT
Default trading session is
ANY . |
Modifier and Type | Method and Description |
---|---|
String |
changeAttributeForSymbol(String symbol)
Returns candle event symbol string with this session attribute set.
|
void |
checkInAttributeImpl(CandleSymbol candleSymbol)
Internal method that initializes attribute in the candle symbol.
|
static CandleSession |
getAttributeForSymbol(String symbol)
Returns candle session attribute of the given candle symbol string.
|
SessionFilter |
getSessionFilter()
Returns session filter that corresponds to this session attribute.
|
static String |
normalizeAttributeForSymbol(String symbol)
Returns candle symbol string with the normalized representation of the candle session attribute.
|
static CandleSession |
parse(String s)
Parses string representation of candle session attribute into object.
|
String |
toString()
Returns string representation of this candle session attribute.
|
static CandleSession |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CandleSession[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CandleSession ANY
public static final CandleSession REGULAR
public static final CandleSession DEFAULT
ANY
.public static final String ATTRIBUTE_KEY
CandleSession
in
a symbol string using methods of MarketEventSymbols
class.
The value of this constant is "tho", which is an abbreviation for "trading hours only".
The value that this key shall be set to is equal to
the corresponding CandleSession.toString()
public static CandleSession[] values()
for (CandleSession c : CandleSession.values()) System.out.println(c);
public static CandleSession 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 SessionFilter getSessionFilter()
public String changeAttributeForSymbol(String symbol)
changeAttributeForSymbol
in interface CandleSymbolAttribute<CandleSession>
symbol
- original candle event symbol.public void checkInAttributeImpl(CandleSymbol candleSymbol)
checkInAttributeImpl
in interface CandleSymbolAttribute<CandleSession>
candleSymbol
- candle symbol.IllegalStateException
- if used outside of internal initialization logic.public String toString()
name
. For example,
ANY
is represented as "any".toString
in class Enum<CandleSession>
public static CandleSession parse(String s)
toString()
can be parsed
and case is ignored for parsing.s
- string representation of candle candle session attribute.IllegalArgumentException
- if the string representation is invalid.public static CandleSession getAttributeForSymbol(String symbol)
DEFAULT
if the symbol does not have candle session attribute.symbol
- candle symbol string.public static String normalizeAttributeForSymbol(String symbol)
symbol
- candle symbol string.Copyright © 2002–2023 Devexperts LLC. All rights reserved.