Class CandleSession
Session attribute of CandleSymbol defines trading that is used to build the candles.
For more details see Javadoc.
public class CandleSession : ICandleSymbolProperty
- Inheritance
-
CandleSession
- Implements
- Inherited Members
Fields
Any
All trading sessions are used to build candles.
public static readonly CandleSession Any
Field Value
AttributeKey
The attribute key that is used to store the value of CandleSession in a symbol string using methods of MarketEventSymbols class. 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 ToString().
public const string AttributeKey = "tho"
Field Value
Default
Default trading session is Any.
public static readonly CandleSession Default
Field Value
Regular
Only regular trading session data is used to build candles.
public static readonly CandleSession Regular
Field Value
Properties
Id
Gets CandleSession.CandleSessionId associated with this instance.
public CandleSession.CandleSessionId Id { get; }
Property Value
Name
Gets full name this CandleSession instance.
For example,
Any returns "Any"
,
Regular returns "Regular"
.
public string Name { get; }
Property Value
Value
Returns string representation of this candle session attribute. The string representation of candle session attribute is a lower case string that corresponds to its type name. For example, Any is represented as "false".
public string Value { get; }
Property Value
- string
The string representation.
Methods
ChangeAttributeForSymbol(string?)
Returns candle event symbol string with this session attribute set.
public string? ChangeAttributeForSymbol(string? symbol)
Parameters
symbol
stringThe original candle event symbol.
Returns
- string
The candle event symbol string with this session attribute 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 session of the given candle symbol string. The result is Default if the symbol does not have candle session attribute.
public static CandleSession GetAttributeForSymbol(string? symbol)
Parameters
symbol
stringThe candle symbol string.
Returns
- CandleSession
The candle session attribute of the given candle symbol string.
NormalizeAttributeForSymbol(string?)
Normalizes candle symbol string with representation of the candle session 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 session attribute.
Parse(string)
Parses string representation of candle session attribute into object. Any string that was returned by ToString() can be parsed and case is ignored for parsing.
public static CandleSession Parse(string s)
Parameters
s
stringThe string representation of candle price.
Returns
- CandleSession
Returns instance of CandleSession.
Exceptions
- ArgumentException
If the string representation is invalid.
ToFullString()
Returns full string representation of this candle session attribute. It is contains attribute key and its value. For example, the full string representation of Any is "tho=false".
public string ToFullString()
Returns
- string
The string representation.
ToString()
Returns string representation of this candle session attribute. The string representation of candle session attribute is a lower case string that corresponds to its type name. For example, Any is represented as "false".
public override string ToString()
Returns
- string
The string representation.