Period attribute of CandleSymbol defines aggregation period of the candles. Aggregation period is defined as pair of a GetValue() and type.
More...
Period attribute of CandleSymbol defines aggregation period of the candles. Aggregation period is defined as pair of a GetValue() and type.
Implementation details
This attribute is encoded in a symbol string with MarketEventSymbols.GetAttributeStringByKey, MarketEventSymbols.ChangeAttributeStringByKey, and MarketEventSymbols.RemoveAttributeStringByKey methods. The key to use with these methods is available via ATTRIBUTE_KEY constant. The value that this key shall be set to is equal to the corresponding CandlePeriod.ToString()
◆ ChangeAttributeForSymbol()
string com.dxfeed.api.candle.CandlePeriod.ChangeAttributeForSymbol |
( |
string |
symbol | ) |
|
|
inline |
Returns candle event symbol string with this aggregation period set.
- Parameters
-
symbol | original candle event symbol. |
- Returns
- candle event symbol string with this aggregation period set.
Implements com.dxfeed.api.candle.ICandleSymbolAttribute.
◆ CheckInAttributeImpl()
void com.dxfeed.api.candle.CandlePeriod.CheckInAttributeImpl |
( |
CandleSymbol |
candleSymbol | ) |
|
|
inline |
Internal method that initializes attribute in the candle symbol.
- Parameters
-
candleSymbol | candle symbol. |
- Exceptions
-
InvalidOperationException | if used outside of internal initialization logic. |
Implements com.dxfeed.api.candle.ICandleSymbolAttribute.
◆ Equals()
override bool com.dxfeed.api.candle.CandlePeriod.Equals |
( |
object |
o | ) |
|
|
inline |
Indicates whether this aggregation period is the same as another one. The same aggregation period has the same value and type.
- Parameters
-
- Returns
true
if this aggregation period is the same as another one.
◆ GetAttributeForSymbol()
static CandlePeriod com.dxfeed.api.candle.CandlePeriod.GetAttributeForSymbol |
( |
string |
symbol | ) |
|
|
inlinestatic |
Returns candle period of the given candle symbol string. The result is DEFAULT if the symbol does not have candle period attribute.
- Parameters
-
symbol | candle symbol string. |
- Returns
- candle period of the given candle symbol string.
- Exceptions
-
ArgumentNullException | if string representation is invalid. |
◆ GetCandleType()
CandleType com.dxfeed.api.candle.CandlePeriod.GetCandleType |
( |
| ) |
|
|
inline |
Returns aggregation period type.
- Returns
- aggregation period type.
◆ GetHashCode()
override int com.dxfeed.api.candle.CandlePeriod.GetHashCode |
( |
| ) |
|
|
inline |
Returns hash code of this aggregation period.
- Returns
- hash code of this aggregation period.
◆ GetPeriodIntervalMillis()
long com.dxfeed.api.candle.CandlePeriod.GetPeriodIntervalMillis |
( |
| ) |
|
|
inline |
◆ GetValue()
double com.dxfeed.api.candle.CandlePeriod.GetValue |
( |
| ) |
|
|
inline |
Returns aggregation period value. For example, the value of 5
with the candle type of MINUTE represents 5 minute aggregation period.
- Returns
- aggregation period value.
◆ NormalizeAttributeForSymbol()
static string com.dxfeed.api.candle.CandlePeriod.NormalizeAttributeForSymbol |
( |
string |
symbol | ) |
|
|
inlinestatic |
Returns candle symbol string with the normalized representation of the candle period attribute.
- Parameters
-
symbol | candle symbol string. |
- Returns
- candle symbol string with the normalized representation of the the candle period attribute.
◆ Parse()
static CandlePeriod com.dxfeed.api.candle.CandlePeriod.Parse |
( |
string |
s | ) |
|
|
inlinestatic |
Parses string representation of aggregation period into object. Any string that was returned by ToString() can be parsed. This method is flexible in the way candle types can be specified. See CandleType#Parse(string) for details.
- Parameters
-
s | string representation of aggregation period. |
- Returns
- aggregation period object.
- Exceptions
-
ArgumentNullException | s is null |
FormatException | s does not represent a number in a valid format. |
OverflowException | s represents a number that is less than System.Double.MinValue or greater than System.Double.MaxValue. |
◆ ToString()
override string com.dxfeed.api.candle.CandlePeriod.ToString |
( |
| ) |
|
|
inline |
Returns string representation of this aggregation period. The string representation is composed of value and type string. For example, 5 minute aggregation is represented as "5m"
. The value of 1
is omitted in the string representation, so DAY (one day) is represented as "d"
. This string representation can be converted back into object with Parse(string) method.
- Returns
- string representation of this aggregation period.
◆ ValueOf()
Returns candle period with the given value and type.
- Parameters
-
value | value candle period value. |
type | candle period type. |
- Returns
- candle period with the given value and type.
◆ ATTRIBUTE_KEY
readonly string com.dxfeed.api.candle.CandlePeriod.ATTRIBUTE_KEY = "" |
|
static |
The attribute key that is used to store the value of CandlePeriod
in a symbol string using methods of MarketEventSymbols class. The value of this constant is an empty string, because this is the main attribute that every CandleSymbol must have. The value that this key shall be set to is equal to the corresponding CandlePeriod.ToString()
◆ DAY
Day aggregation where each candle represents a day.
◆ DEFAULT
◆ TICK
Tick aggregation where each candle represents an individual tick.
The documentation for this class was generated from the following file:
- dxf_api/src/Candle/CandlePeriod.cs