Class CandlePrice
Price type attribute of CandleSymbol defines price that is used to build the candles.
For more details see Javadoc.
public class CandlePrice : ICandleSymbolProperty
- Inheritance
-
CandlePrice
- Implements
- Inherited Members
Fields
Ask
Quote ask price.
public static readonly CandlePrice Ask
Field Value
AttributeKey
The attribute key that is used to store the value of 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 ToString().
public const string AttributeKey = "price"
Field Value
Bid
Quote bid price.
public static readonly CandlePrice Bid
Field Value
Default
Default price type is Last.
public static readonly CandlePrice Default
Field Value
Last
Last trading price.
public static readonly CandlePrice Last
Field Value
Mark
Market price defined as average between quote bid and ask prices.
public static readonly CandlePrice Mark
Field Value
Settlement
Official settlement price that is defined by exchange or last trading price otherwise. It updates based on all PriceType values: PriceType.Indicative, PriceType.Preliminary, and PriceType.Final.
public static readonly CandlePrice Settlement
Field Value
Properties
Id
Gets CandlePrice.CandlePriceId associated with this instance.
public CandlePrice.CandlePriceId Id { get; }
Property Value
Name
Gets full name this CandlePrice instance.
For example,
Last returns "Last"
,
Bid returns "Bid"
.
public string Name { get; }
Property Value
Value
Returns string representation of this candle price type. The string representation of candle price type is a lower case string that corresponds to its name. For example, Last is represented as "last".
public string Value { get; }
Property Value
- string
The string representation.
Methods
ChangeAttributeForSymbol(string?)
Returns candle event symbol string with this candle price type set.
public string? ChangeAttributeForSymbol(string? symbol)
Parameters
symbol
stringThe original candle event symbol.
Returns
- string
The candle event symbol string with this candle price type 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.
GetAttributeForSymbol(string?)
Gets candle price type of the given candle symbol string. The result is Default if the symbol does not have candle price type attribute.
public static CandlePrice GetAttributeForSymbol(string? symbol)
Parameters
symbol
stringThe candle symbol string.
Returns
- CandlePrice
The candle price of the given candle symbol string.
GetById(CandlePriceId)
Gets CandlePrice associated with the specified CandlePrice.CandlePriceId.
public static CandlePrice GetById(CandlePrice.CandlePriceId id)
Parameters
id
CandlePrice.CandlePriceIdThe candle price type id.
Returns
- CandlePrice
The price type type.
Exceptions
- ArgumentException
If candle type id not exist.
NormalizeAttributeForSymbol(string?)
Normalizes candle symbol string with representation of the candle price type 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 type attribute.
Parse(string)
Parses string representation of candle price type into object. Any string that was returned by ToString() can be parsed and case is ignored for parsing.
public static CandlePrice Parse(string s)
Parameters
s
stringThe string representation of candle price.
Returns
- CandlePrice
The candle price.
Exceptions
- ArgumentException
If the string representation is invalid.
ToFullString()
Returns full string representation of this candle price type. It is contains attribute key and its value. For example, the full string representation of Last is "price=last".
public string ToFullString()
Returns
- string
The string representation.
ToString()
Returns string representation of this candle price type. The string representation of candle price type is a lower case string that corresponds to its name. For example, Last is represented as "last".
public override string ToString()
Returns
- string
The string representation.