Method ToTimeSpan
- Namespace
- WhalesSecret.TradeScriptLib.Entities.MarketData
- Assembly
- WhalesSecret.TradeScriptLib.dll
ToTimeSpan(CandleWidth, out TimeSpan?)
Converts CandleWidth to TimeSpan.
public static bool ToTimeSpan(this CandleWidth candleWidth, out TimeSpan? timeSpan)
Parameters
candleWidth
CandleWidthCandle width to convert.
timeSpan
TimeSpan?If the function succeeds, this is filled with the time span that corresponds to the input candle width. All candle widths have their precise corresponding time span except for Month1, which is defined as 31 days long time span. This is to make sure that the returned time span is the longest possible time span for the input candle width.