Table of Contents

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 CandleWidth

Candle 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.

Returns

bool

true if the conversion is possible, false otherwise. The only case when false is returned is when the input candle width is set to Other.