dxFeed .Net API  7.1.0
dxFeed .Net API library intended to provide market data access for DX clients
com.dxfeed.api.candle.CandleSymbol Class Reference

Symbol that should be used with DXFeedSubscription class to subscribe for IDxCandle events. DXFeedSubscription also accepts a string representation of the candle symbol for subscription. More...

Collaboration diagram for com.dxfeed.api.candle.CandleSymbol:
[legend]

Public Member Functions

override string ToString ()
 Returns string representation of this symbol. The string representation can be transformed back into symbol object using ValueOf(string) method. More...
 
override bool Equals (object obj)
 Indicates whether this symbol is the same as another one. More...
 
override int GetHashCode ()
 Returns hash code of this symbol. More...
 
string ToFullString ()
 Returns full string representation of this symbol. In this case default attributes are not ignored. More...
 
bool IsDefault ()
 Checks this candle symbol have all default attributes. More...
 

Static Public Member Functions

static CandleSymbol ValueOf (string symbol)
 Converts the given string symbol into the candle symbol object. More...
 
static CandleSymbol ValueOf (string symbol, ICandleSymbolAttribute attribute)
 Converts the given string symbol into the candle symbol object with the specified attribute set. More...
 
static CandleSymbol ValueOf (string symbol, ICandleSymbolAttribute attribute, params ICandleSymbolAttribute[] attributes)
 Converts the given string symbol into the candle symbol object with the specified attributes set. More...
 

Data Fields

string BaseSymbol => baseSymbol
 Returns base market symbol without attributes. More...
 
char ExchangeCode => exchange.GetExchangeCode()
 Returns exchange attribute of this symbol. More...
 
int PriceId => price.GetId()
 Returns price type attribute of this symbol. More...
 
int SessionId => session.GetId()
 Returns session attribute of this symbol. More...
 
int PeriodId => period.GetCandleType().Id
 Returns aggregation period of this symbol. More...
 
double PeriodValue => period.GetValue()
 Returns aggregation period value of this symbol. More...
 
int AlignmentId => alignment.GetId()
 Returns alignment attribute of this symbol. More...
 
double PriceLevel => priceLevel.GetValue()
 Returns price level attribute of this symbol. More...
 

Detailed Description

Symbol that should be used with DXFeedSubscription class to subscribe for IDxCandle events. DXFeedSubscription also accepts a string representation of the candle symbol for subscription.

String representation

The string representation of the candle symbol consist of a baseSymbol followed by an optional '&' with an exchange code letter and followed by a list of comma-separated key=value pairs in curly braces:

<baseSymbol> [ '&' <exchange> ] '{' <key1>=<value1> [ ',' <key2>=<value2> [ ',' ... ]] '}'

Properties of the candle symbol correspond to the keys in the string representation in the following way:

  • Empty key corresponds to period — aggregation period of this symbol. The period value is composed of an optional value which defaults to 1 when not specified, followed by a type string which is defined by one of the CandleType enum values and can be abbreviated to first letters. For example, a daily candle of "IBM" base symbol can be specified as "IBM{=d}" and 15 minute candle on it as "IBM{=15m}". The shortest possible abbreviation for CandleType.MONTH is "mo", so the monthly candle can be specified as "IBM{=mo}". When period is not specified, then the TICK aggregation period is assumed as default. Note, that tick aggregation may not be available on the demo system which is limited to a subset of symbols and aggregation periods.
  • "price" key corresponds to price — price type attribute of this symbol. The CandlePrice enum defines possible values with LAST being default. For legacy backwards-compatibility purposes, most of the price values cannot be abbreviated, so a one-minute candle of "EUR/USD" bid price shall be specified with "EUR/USD{=m,price=bid}" candle symbol string. However, the SETTLEMENT can be abbreviated to "s", so a daily candle on "/ES" futures settlement prices can be specified with "/ES{=d,price=s}" string.
  • "tho" key with a value of "true" corresponds to session set to CandleSession#REGULAR which limits the candle to trading hours only, so a 133 tick candles on "GOOG" base symbol collected over trading hours only can be specified with "GOOG{=133t,tho=true}" string. Note, that the default daily candles for US equities are special for historical reasons and correspond to the way US equity exchange report their daily summary data. The volume the US equity default daily candle corresponds to the total daily traded volume, while open, high, low, and close correspond to the regular trading hours only.
  • "a" key corresponds to alignment — alignment attribute of this symbol. The CandleAlignment enum defines possible values with MIDNIGHT being default. The alignment values can be abbreviated to the first letter. So, a 1 hour candle on a symbol "AAPL" that starts at the regular trading session at 9:30 am ET can be specified with "AAPL{=h,a=s,tho=true}". Contrast that to the "AAPL{=h,tho=true}" candle that is aligned at midnight and thus starts at 9:00 am.

Keys in the candle symbol are case-sensitive, while values are not. The ValueOf(string) method parses any valid string representation into a candle symbol object. The result of the candle symbol ToString() method is always normalized: keys are ordered lexicographically, values are in lower-case and are abbreviated to their shortest possible form.

Member Function Documentation

◆ Equals()

override bool com.dxfeed.api.candle.CandleSymbol.Equals ( object  obj)
inline

Indicates whether this symbol is the same as another one.

Parameters
obj
Returns
true if this symbol is the same as another one.

◆ GetHashCode()

override int com.dxfeed.api.candle.CandleSymbol.GetHashCode ( )
inline

Returns hash code of this symbol.

Returns
hash code of this symbol.

◆ IsDefault()

bool com.dxfeed.api.candle.CandleSymbol.IsDefault ( )
inline

Checks this candle symbol have all default attributes.

Returns
"true" if all attributes is default, otherwise returns false.

◆ ToFullString()

string com.dxfeed.api.candle.CandleSymbol.ToFullString ( )
inline

Returns full string representation of this symbol. In this case default attributes are not ignored.

Returns
String representation of this symbol.

◆ ToString()

override string com.dxfeed.api.candle.CandleSymbol.ToString ( )
inline

Returns string representation of this symbol. The string representation can be transformed back into symbol object using ValueOf(string) method.

Returns
string representation of this symbol.

◆ ValueOf() [1/3]

static CandleSymbol com.dxfeed.api.candle.CandleSymbol.ValueOf ( string  symbol)
inlinestatic

Converts the given string symbol into the candle symbol object.

Parameters
symbolthe string symbol.
Returns
the candle symbol object.

◆ ValueOf() [2/3]

static CandleSymbol com.dxfeed.api.candle.CandleSymbol.ValueOf ( string  symbol,
ICandleSymbolAttribute  attribute 
)
inlinestatic

Converts the given string symbol into the candle symbol object with the specified attribute set.

Parameters
symbolthe string symbol.
attributethe attribute to set.
Returns
the candle symbol object.

◆ ValueOf() [3/3]

static CandleSymbol com.dxfeed.api.candle.CandleSymbol.ValueOf ( string  symbol,
ICandleSymbolAttribute  attribute,
params ICandleSymbolAttribute []  attributes 
)
inlinestatic

Converts the given string symbol into the candle symbol object with the specified attributes set.

Parameters
symbolthe string symbol.
attributethe attribute to set.
attributesmore attributes to set.
Returns
the candle symbol object.

Field Documentation

◆ AlignmentId

int com.dxfeed.api.candle.CandleSymbol.AlignmentId => alignment.GetId()

Returns alignment attribute of this symbol.

◆ BaseSymbol

string com.dxfeed.api.candle.CandleSymbol.BaseSymbol => baseSymbol

Returns base market symbol without attributes.

◆ ExchangeCode

char com.dxfeed.api.candle.CandleSymbol.ExchangeCode => exchange.GetExchangeCode()

Returns exchange attribute of this symbol.

◆ PeriodId

int com.dxfeed.api.candle.CandleSymbol.PeriodId => period.GetCandleType().Id

Returns aggregation period of this symbol.

◆ PeriodValue

double com.dxfeed.api.candle.CandleSymbol.PeriodValue => period.GetValue()

Returns aggregation period value of this symbol.

◆ PriceId

int com.dxfeed.api.candle.CandleSymbol.PriceId => price.GetId()

Returns price type attribute of this symbol.

◆ PriceLevel

double com.dxfeed.api.candle.CandleSymbol.PriceLevel => priceLevel.GetValue()

Returns price level attribute of this symbol.

◆ SessionId

int com.dxfeed.api.candle.CandleSymbol.SessionId => session.GetId()

Returns session attribute of this symbol.


The documentation for this class was generated from the following file: