Class CandlePriceLevel
Candle price level attribute of CandleSymbol defines how candles shall be aggregated in respect to price interval. The negative or infinite values of price interval are treated as exceptional.
- Price interval may be equal to zero. It means every unique price creates a particular candle to aggregate all events with this price for the chosen CandlePeriod.
- Non-zero price level creates sequence of intervals starting from 0: ...,[-pl;0),[0;pl),[pl;2*pl),...,[n*pl,n*pl+pl). Events aggregated by chosen CandlePeriod and price intervals.
For more details see Javadoc.
public class CandlePriceLevel : ICandleSymbolProperty
- Inheritance
-
CandlePriceLevel
- Implements
- Inherited Members
Fields
AttributeKey
The attribute key that is used to store the value of 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 ToString().
public const string AttributeKey = "pl"
Field Value
Default
public static readonly CandlePriceLevel Default
Field Value
Properties
Value
Gets a price level value.
For example, the value of 1
represents [0;1), [1;2) and so on intervals to build candles.
public double Value { get; }
Property Value
Methods
ChangeAttributeForSymbol(string?)
Returns candle event symbol string with this candle price level set.
public string? ChangeAttributeForSymbol(string? symbol)
Parameters
symbol
stringThe original candle event symbol.
Returns
- string
The candle event symbol string with this candle price level set.
CheckInAttribute(CandleSymbol)
Internal method that initializes attribute in the candle symbol.
public void CheckInAttribute(CandleSymbol candleSymbol)
Parameters
candleSymbol
CandleSymbolThe candle symbol.
Exceptions
- InvalidOperationException
If used outside of internal initialization logic.
Equals(object?)
Determines whether the specified object is equal to the current object. The same price level has the same Value.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
- bool
true
if the specified object is equal to the current object; otherwise,false
.
GetAttributeForSymbol(string?)
Gets candle price level of the given candle symbol string. The result is Default if the symbol does not have candle price level attribute.
public static CandlePriceLevel GetAttributeForSymbol(string? symbol)
Parameters
symbol
stringThe candle symbol string.
Returns
- CandlePriceLevel
The candle price level of the given candle symbol string.
GetHashCode()
Returns a hash code value for this object.
public override int GetHashCode()
Returns
- int
A hash code value for this object.
NormalizeAttributeForSymbol(string?)
Normalizes candle symbol string with representation of the candle price level attribute.
public static string? NormalizeAttributeForSymbol(string? symbol)
Parameters
symbol
stringThe candle symbol string.
Returns
- string
Returns candle symbol string with the normalized representation of the candle price level attribute.
Parse(string)
Parses string representation of candle price level into object. Any string that was returned by ToString() can be parsed. and case is ignored for parsing.
public static CandlePriceLevel Parse(string s)
Parameters
s
stringThe string representation of candle candle price level attribute.
Returns
- CandlePriceLevel
The candle price level attribute.
ToFullString()
Returns full string representation of this candle price level attribute. It is contains attribute key and its value. For example, the full string representation of price level = 0.5 is "pl=0.5".
public string ToFullString()
Returns
- string
The full string representation of a candle price level attribute.
ToString()
Returns string representation of this candle price level attribute. The string representation is composed of value. This string representation can be converted back into object with Parse(string) method.
public override string ToString()
Returns
- string
The string representation.
ValueOf(double)
Returns candle price level object that corresponds to the specified value.
public static CandlePriceLevel ValueOf(double value)
Parameters
value
doubleThe candle price level value.
Returns
- CandlePriceLevel
The candle price level with the given value and type.