dxFeed .Net API  5.8.0
dxFeed .Net API library intended to provide market data access for DX clients
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | Private Member Functions | Private Attributes | Static Private Attributes
com.dxfeed.api.candle.CandleType Class Reference

Type of the candle aggregation period constitutes CandlePeriod type together its actual value. More...

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

Public Member Functions

long GetPeriodIntervalMillis ()
 Returns candle type period in milliseconds as closely as possible. Certain types like SECOND and DAY span a specific number of milliseconds. MONTH, OPTEXP and YEAR are approximate. Candle type period of TICK, VOLUME, PRICE, PRICE_MOMENTUM and PRICE_RENKO is not defined and this method returns 0. More...
 
override string ToString ()
 Returns string representation of this candle type. The string representation of candle type is the shortest unique prefix of the lower case string that corresponds to its type name. For example, TICK is represented as "t", while MONTH is represented as "mo" to distinguish it from MINUTE that is represented as "m". More...
 

Static Public Member Functions

static CandleType Parse (string s)
 Parses string representation of candle type into object. Any string that is a prefix of candle type name can be parsed (including the one that was returned by ToString()) and case is ignored for parsing. More...
 

Static Public Attributes

static readonly CandleType TICK = new CandleType(0, "t", 0)
 Certain number of ticks. More...
 
static readonly CandleType SECOND = new CandleType(1, "s", 1000L)
 Certain number of seconds. More...
 
static readonly CandleType MINUTE = new CandleType(2, "m", 60 * 1000L)
 Certain number of minutes. More...
 
static readonly CandleType HOUR = new CandleType(3, "h", 60 * 60 * 1000L)
 Certain number of hours. More...
 
static readonly CandleType DAY = new CandleType(4, "d", 24 * 60 * 60 * 1000L)
 Certain number of days. More...
 
static readonly CandleType WEEK = new CandleType(5, "w", 7 * 24 * 60 * 60 * 1000L)
 Certain number of weeks. More...
 
static readonly CandleType MONTH = new CandleType(6, "mo", 30 * 24 * 60 * 60 * 1000L)
 Certain number of months. More...
 
static readonly CandleType OPTEXP = new CandleType(7, "o", 30 * 24 * 60 * 60 * 1000L)
 Certain number of option expirations. More...
 
static readonly CandleType YEAR = new CandleType(8, "y", 365 * 24 * 60 * 60 * 1000L)
 Certain number of years. More...
 
static readonly CandleType VOLUME = new CandleType(9, "v", 0)
 Certain volume of trades. More...
 
static readonly CandleType PRICE = new CandleType(10, "p", 0)
 Certain price change, calculated according to the following rules: More...
 
static readonly CandleType PRICE_MOMENTUM = new CandleType(11, "pm", 0)
 Certain price change, calculated according to the following rules: More...
 
static readonly CandleType PRICE_RENKO = new CandleType(12, "pr", 0)
 Certain price change, calculated according to the following rules: More...
 

Properties

int Id [get]
 Get id of candle period type More...
 

Private Member Functions

 CandleType (int typeId, string typeStr, long periodIntervalMillis)
 

Private Attributes

readonly int typeId
 
readonly string typeStr
 
readonly long periodIntervalMillis
 

Static Private Attributes

static Dictionary< string, CandleTypeobjCash = new Dictionary<string, CandleType>()
 

Detailed Description

Type of the candle aggregation period constitutes CandlePeriod type together its actual value.

Constructor & Destructor Documentation

◆ CandleType()

com.dxfeed.api.candle.CandleType.CandleType ( int  typeId,
string  typeStr,
long  periodIntervalMillis 
)
inlineprivate

Member Function Documentation

◆ GetPeriodIntervalMillis()

long com.dxfeed.api.candle.CandleType.GetPeriodIntervalMillis ( )
inline

Returns candle type period in milliseconds as closely as possible. Certain types like SECOND and DAY span a specific number of milliseconds. MONTH, OPTEXP and YEAR are approximate. Candle type period of TICK, VOLUME, PRICE, PRICE_MOMENTUM and PRICE_RENKO is not defined and this method returns 0.

Returns
aggregation period in milliseconds.

◆ Parse()

static CandleType com.dxfeed.api.candle.CandleType.Parse ( string  s)
inlinestatic

Parses string representation of candle type into object. Any string that is a prefix of candle type name can be parsed (including the one that was returned by ToString()) and case is ignored for parsing.

Parameters
sstring representation of candle type.
Returns
candle type.
Exceptions
ArgumentExceptionif the string representation is invalid.

◆ ToString()

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

Returns string representation of this candle type. The string representation of candle type is the shortest unique prefix of the lower case string that corresponds to its type name. For example, TICK is represented as "t", while MONTH is represented as "mo" to distinguish it from MINUTE that is represented as "m".

Returns
string representation of this candle price type.
Returns

Field Documentation

◆ DAY

readonly CandleType com.dxfeed.api.candle.CandleType.DAY = new CandleType(4, "d", 24 * 60 * 60 * 1000L)
static

Certain number of days.

◆ HOUR

readonly CandleType com.dxfeed.api.candle.CandleType.HOUR = new CandleType(3, "h", 60 * 60 * 1000L)
static

Certain number of hours.

◆ MINUTE

readonly CandleType com.dxfeed.api.candle.CandleType.MINUTE = new CandleType(2, "m", 60 * 1000L)
static

Certain number of minutes.

◆ MONTH

readonly CandleType com.dxfeed.api.candle.CandleType.MONTH = new CandleType(6, "mo", 30 * 24 * 60 * 60 * 1000L)
static

Certain number of months.

◆ objCash

Dictionary<string, CandleType> com.dxfeed.api.candle.CandleType.objCash = new Dictionary<string, CandleType>()
staticprivate

◆ OPTEXP

readonly CandleType com.dxfeed.api.candle.CandleType.OPTEXP = new CandleType(7, "o", 30 * 24 * 60 * 60 * 1000L)
static

Certain number of option expirations.

◆ periodIntervalMillis

readonly long com.dxfeed.api.candle.CandleType.periodIntervalMillis
private

◆ PRICE

readonly CandleType com.dxfeed.api.candle.CandleType.PRICE = new CandleType(10, "p", 0)
static

Certain price change, calculated according to the following rules:

  1. high(n) - low(n) = price range
  2. close(n) = high(n) or close(n) = low(n)
  3. open(n+1) = close(n) where n is the number of the bar.

◆ PRICE_MOMENTUM

readonly CandleType com.dxfeed.api.candle.CandleType.PRICE_MOMENTUM = new CandleType(11, "pm", 0)
static

Certain price change, calculated according to the following rules:

  1. high(n) - low(n) = price range
  2. close(n) = high(n) or close(n) = low(n)
  3. open(n+1) = close(n) + tick size, if close(n) = high(n)
  4. open(n+1) = close(n) - tick size, if close(n) = low(n) where n is the number of the bar.

◆ PRICE_RENKO

readonly CandleType com.dxfeed.api.candle.CandleType.PRICE_RENKO = new CandleType(12, "pr", 0)
static

Certain price change, calculated according to the following rules:

  1. high(n+1) - high(n) = price range or low(n) - low(n+1) = price range
  2. close(n) = high(n) or close(n) = low(n)
  3. open(n+1) = high(n), if high(n+1) - high(n) = price range
  4. open(n+1) = low(n), if low(n) - low(n+1) = price range where n is the number of the bar.

◆ SECOND

readonly CandleType com.dxfeed.api.candle.CandleType.SECOND = new CandleType(1, "s", 1000L)
static

Certain number of seconds.

◆ TICK

readonly CandleType com.dxfeed.api.candle.CandleType.TICK = new CandleType(0, "t", 0)
static

Certain number of ticks.

◆ typeId

readonly int com.dxfeed.api.candle.CandleType.typeId
private

◆ typeStr

readonly string com.dxfeed.api.candle.CandleType.typeStr
private

◆ VOLUME

readonly CandleType com.dxfeed.api.candle.CandleType.VOLUME = new CandleType(9, "v", 0)
static

Certain volume of trades.

◆ WEEK

readonly CandleType com.dxfeed.api.candle.CandleType.WEEK = new CandleType(5, "w", 7 * 24 * 60 * 60 * 1000L)
static

Certain number of weeks.

◆ YEAR

readonly CandleType com.dxfeed.api.candle.CandleType.YEAR = new CandleType(8, "y", 365 * 24 * 60 * 60 * 1000L)
static

Certain number of years.

Property Documentation

◆ Id

int com.dxfeed.api.candle.CandleType.Id
get

Get id of candle period type


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