Class CandleType
Type of the candle aggregation period constitutes CandlePeriod type together its actual Value. For more details see Javadoc.
public class CandleType
- Inheritance
-
CandleType
- Inherited Members
Fields
Day
Certain number of days.
public static readonly CandleType Day
Field Value
Hour
Certain number of hours.
public static readonly CandleType Hour
Field Value
Minute
Certain number of minutes.
public static readonly CandleType Minute
Field Value
Month
Certain number of months.
public static readonly CandleType Month
Field Value
OptExp
Certain number of option expirations.
public static readonly CandleType OptExp
Field Value
Price
Certain price change, calculated according to the following rules:
- high(n) - low(n) = price range
- close(n) = high(n) or close(n) = low(n)
- open(n+1) = close(n)
public static readonly CandleType Price
Field Value
PriceMomentum
Certain price change, calculated according to the following rules:
- high(n) - low(n) = price range
- close(n) = high(n) or close(n) = low(n)
- open(n+1) = close(n) + tick size, if close(n) = high(n)
- open(n+1) = close(n) - tick size, if close(n) = low(n)
public static readonly CandleType PriceMomentum
Field Value
PriceRenko
Certain price change, calculated according to the following rules:
- high(n+1) - high(n) = price range or low(n) - low(n+1) = price range
- close(n) = high(n) or close(n) = low(n)
- open(n+1) = high(n), if high(n+1) - high(n) = price range
- open(n+1) = low(n), if low(n) - low(n+1) = price range
public static readonly CandleType PriceRenko
Field Value
Second
Certain number of seconds.
public static readonly CandleType Second
Field Value
Tick
Certain number of ticks.
public static readonly CandleType Tick
Field Value
Volume
Certain volume of trades.
public static readonly CandleType Volume
Field Value
Week
Certain number of weeks.
public static readonly CandleType Week
Field Value
Year
Certain number of years.
public static readonly CandleType Year
Field Value
Properties
Id
Gets CandleType.CandleTypeId associated with this instance.
public CandleType.CandleTypeId Id { get; }
Property Value
Name
Gets full name this CandleType instance.
For example,
Tick (Value == "t"
) returns "Tick"
,
Month (Value == "mo"
) returns "Month"
.
public string Name { get; }
Property Value
PeriodIntervalMillis
Gets candle type period in milliseconds (aggregation period) 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,
PriceMomentum and PriceRenko
is not defined and this method returns 0
.
public long PeriodIntervalMillis { get; }
Property Value
Value
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 Name. For example,
Tick is represented as "t"
, while Month is represented as
"mo"
to distinguish it from Minute that is represented as "m"
.
public string Value { get; }
Property Value
- string
The string representation.
Methods
GetById(CandleTypeId)
Gets CandleType associated with the specified CandleType.CandleTypeId.
public static CandleType GetById(CandleType.CandleTypeId id)
Parameters
id
CandleType.CandleTypeIdThe candle type id.
Returns
- CandleType
The candle type.
Exceptions
- ArgumentException
If candle type id not exist.
Parse(string)
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.
public static CandleType Parse(string s)
Parameters
s
stringThe string representation of candle type.
Returns
- CandleType
The candle type.
Exceptions
- ArgumentException
If the string representation is invalid.
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 Name. For example,
Tick is represented as "t"
, while Month is represented as
"mo"
to distinguish it from Minute that is represented as "m"
.
public override string ToString()
Returns
- string
The string representation.