public class CandlePriceLevel extends Object implements CandleSymbolAttribute<CandlePriceLevel>
CandleSymbol
defines how candles shall be aggregated in respect to
price interval. The negative or infinite values of price interval are treated as exceptional.
CandlePeriod
.
CandlePeriod
and price intervals.
This attribute is encoded in a symbol string with
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 CandlePriceLevel.toString()
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_KEY
The attribute key that is used to store the value of
CandlePriceLevel in
a symbol string using methods of MarketEventSymbols class. |
static CandlePriceLevel |
DEFAULT
Default price level corresponds to
Double.NaN |
Modifier and Type | Method and Description |
---|---|
String |
changeAttributeForSymbol(String symbol)
Returns candle event symbol string with this candle price level set.
|
void |
checkInAttributeImpl(CandleSymbol candleSymbol)
Internal method that initializes attribute in the candle symbol.
|
boolean |
equals(Object o)
Indicates whether this price level is the same as another one.
|
static CandlePriceLevel |
getAttributeForSymbol(String symbol)
Returns candle price level of the given candle symbol string.
|
double |
getValue()
Returns price level value.
|
int |
hashCode()
Returns hash code of this price level.
|
static String |
normalizeAttributeForSymbol(String symbol)
Returns candle symbol string with the normalized representation of the candle price level attribute.
|
static CandlePriceLevel |
parse(String s)
Parses string representation of candle price level into object.
|
String |
toString()
Returns string representation of this price level.
|
static CandlePriceLevel |
valueOf(double value)
Returns candle price level with the given value.
|
public static final CandlePriceLevel DEFAULT
Double.NaN
public static final String ATTRIBUTE_KEY
CandlePriceLevel
in
a symbol string using methods of MarketEventSymbols
class.
The value of this constant is "pl".
The value that this key shall be set to is equal to
the corresponding CandlePriceLevel.toString()
public double getValue()
1
represents [0;1), [1;2) and so on intervals
to build candles.public boolean equals(Object o)
value
.public int hashCode()
public String toString()
parse(String)
method.public String changeAttributeForSymbol(String symbol)
changeAttributeForSymbol
in interface CandleSymbolAttribute<CandlePriceLevel>
symbol
- original candle event symbol.public void checkInAttributeImpl(CandleSymbol candleSymbol)
checkInAttributeImpl
in interface CandleSymbolAttribute<CandlePriceLevel>
candleSymbol
- candle symbol.IllegalStateException
- if used outside of internal initialization logic.public static CandlePriceLevel parse(String s)
toString()
can be parsed
and case is ignored for parsing.s
- string representation of candle price level.IllegalArgumentException
- if the string representation is invalid.public static CandlePriceLevel valueOf(double value)
value
- candle price level value.public static CandlePriceLevel getAttributeForSymbol(String symbol)
DEFAULT
if the symbol does not have candle price level attribute.symbol
- candle symbol string.public static String normalizeAttributeForSymbol(String symbol)
symbol
- candle symbol string.Copyright © 2002–2023 Devexperts LLC. All rights reserved.