Struct CandleSeriesTimeFrame
- Namespace
- ATAS.Indicators
- Assembly
- ATAS.Indicators.dll
A candle series timeframe: aggregation type plus its numeric parameter (minutes, seconds, ticks, lots or price-range ticks depending on the type). Create instances via the factory methods.
Added in ATAS 8.0.15.
public readonly struct CandleSeriesTimeFrame
- Extension Methods
Properties
Chart
The "same as chart" sentinel used by CalculationTimeFrame: the indicator calculates on the chart's own series (default behavior).
public static CandleSeriesTimeFrame Chart { get; }
Property Value
IsChart
True for the "same as chart" sentinel (Chart, the default value): no fixed timeframe of its own, the consumer substitutes the chart's series.
[Browsable(false)]
public bool IsChart { get; }
Property Value
- bool
PeriodType
The aggregation type.
[Browsable(false)]
public CandleSeriesPeriodType PeriodType { get; }
Property Value
TimeBasedDuration
The bar duration for time-based aggregation types (Minutes, Seconds, Daily, Weekly); null for the Chart sentinel and for event-based types (ticks, volume, delta, range, renko), whose bar duration is not fixed.
[Browsable(false)]
public TimeSpan? TimeBasedDuration { get; }
Property Value
- TimeSpan?
Value
The aggregation parameter: minutes, seconds, ticks, lots or range/renko ticks. 1 for Daily and Weekly.
[Browsable(false)]
public int Value { get; }
Property Value
- int
Methods
Daily()
Creates the Daily timeframe.
public static CandleSeriesTimeFrame Daily()
Returns
- CandleSeriesTimeFrame
The timeframe.
Delta(int)
Creates a Delta timeframe.
public static CandleSeriesTimeFrame Delta(int delta)
Parameters
deltaintThe absolute delta at which a candle closes; must be positive.
Returns
- CandleSeriesTimeFrame
The timeframe.
Exceptions
- ArgumentOutOfRangeException
deltais zero or negative.
Equals(CandleSeriesTimeFrame)
public bool Equals(CandleSeriesTimeFrame other)
Parameters
otherCandleSeriesTimeFrame
Returns
- bool
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
- bool
GetHashCode()
public override int GetHashCode()
Returns
- int
Hours(int)
Creates an hourly timeframe, stored as Minutes with hours * 60 minutes.
public static CandleSeriesTimeFrame Hours(int hours)
Parameters
hoursintThe candle duration in hours; must be positive.
Returns
- CandleSeriesTimeFrame
The timeframe.
Exceptions
- ArgumentOutOfRangeException
hoursis zero or negative.- OverflowException
The number of minutes does not fit in int.
Minutes(int)
Creates a Minutes timeframe.
public static CandleSeriesTimeFrame Minutes(int minutes)
Parameters
minutesintThe candle duration in minutes; must be positive.
Returns
- CandleSeriesTimeFrame
The timeframe.
Exceptions
- ArgumentOutOfRangeException
minutesis zero or negative.
Range(int)
Creates a Range timeframe.
public static CandleSeriesTimeFrame Range(int ticks)
Parameters
ticksintThe candle range in ticks; must be positive.
Returns
- CandleSeriesTimeFrame
The timeframe.
Exceptions
- ArgumentOutOfRangeException
ticksis zero or negative.
Renko(int)
Creates a Renko timeframe.
public static CandleSeriesTimeFrame Renko(int ticks)
Parameters
ticksintThe Renko period in ticks; must be positive.
Returns
- CandleSeriesTimeFrame
The timeframe.
Exceptions
- ArgumentOutOfRangeException
ticksis zero or negative.
Seconds(int)
Creates a Seconds timeframe.
public static CandleSeriesTimeFrame Seconds(int seconds)
Parameters
secondsintThe candle duration in seconds; must be positive.
Returns
- CandleSeriesTimeFrame
The timeframe.
Exceptions
- ArgumentOutOfRangeException
secondsis zero or negative.
Ticks(int)
Creates a Ticks timeframe.
public static CandleSeriesTimeFrame Ticks(int ticks)
Parameters
ticksintThe number of trades per candle; must be positive.
Returns
- CandleSeriesTimeFrame
The timeframe.
Exceptions
- ArgumentOutOfRangeException
ticksis zero or negative.
ToString()
Returns a short display name of the timeframe.
public override string ToString()
Returns
- string
Chartfor the Chart sentinel; otherwise e.g.M5,S30,100T,Vol 500,Delta 200,Range 10,Renko 4,Daily,Weekly.
Volume(int)
Creates a Volume timeframe.
public static CandleSeriesTimeFrame Volume(int volume)
Parameters
volumeintThe traded volume at which a candle closes; must be positive.
Returns
- CandleSeriesTimeFrame
The timeframe.
Exceptions
- ArgumentOutOfRangeException
volumeis zero or negative.
Weekly()
Creates the Weekly timeframe.
public static CandleSeriesTimeFrame Weekly()
Returns
- CandleSeriesTimeFrame
The timeframe.
Operators
operator ==(CandleSeriesTimeFrame, CandleSeriesTimeFrame)
public static bool operator ==(CandleSeriesTimeFrame left, CandleSeriesTimeFrame right)
Parameters
leftCandleSeriesTimeFramerightCandleSeriesTimeFrame
Returns
- bool
operator !=(CandleSeriesTimeFrame, CandleSeriesTimeFrame)
public static bool operator !=(CandleSeriesTimeFrame left, CandleSeriesTimeFrame right)
Parameters
leftCandleSeriesTimeFramerightCandleSeriesTimeFrame
Returns
- bool