Table of Contents

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

CandleSeriesTimeFrame

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

CandleSeriesPeriodType

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

delta int

The absolute delta at which a candle closes; must be positive.

Returns

CandleSeriesTimeFrame

The timeframe.

Exceptions

ArgumentOutOfRangeException

delta is zero or negative.

Equals(CandleSeriesTimeFrame)

public bool Equals(CandleSeriesTimeFrame other)

Parameters

other CandleSeriesTimeFrame

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

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

hours int

The candle duration in hours; must be positive.

Returns

CandleSeriesTimeFrame

The timeframe.

Exceptions

ArgumentOutOfRangeException

hours is 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

minutes int

The candle duration in minutes; must be positive.

Returns

CandleSeriesTimeFrame

The timeframe.

Exceptions

ArgumentOutOfRangeException

minutes is zero or negative.

Range(int)

Creates a Range timeframe.

public static CandleSeriesTimeFrame Range(int ticks)

Parameters

ticks int

The candle range in ticks; must be positive.

Returns

CandleSeriesTimeFrame

The timeframe.

Exceptions

ArgumentOutOfRangeException

ticks is zero or negative.

Renko(int)

Creates a Renko timeframe.

public static CandleSeriesTimeFrame Renko(int ticks)

Parameters

ticks int

The Renko period in ticks; must be positive.

Returns

CandleSeriesTimeFrame

The timeframe.

Exceptions

ArgumentOutOfRangeException

ticks is zero or negative.

Seconds(int)

Creates a Seconds timeframe.

public static CandleSeriesTimeFrame Seconds(int seconds)

Parameters

seconds int

The candle duration in seconds; must be positive.

Returns

CandleSeriesTimeFrame

The timeframe.

Exceptions

ArgumentOutOfRangeException

seconds is zero or negative.

Ticks(int)

Creates a Ticks timeframe.

public static CandleSeriesTimeFrame Ticks(int ticks)

Parameters

ticks int

The number of trades per candle; must be positive.

Returns

CandleSeriesTimeFrame

The timeframe.

Exceptions

ArgumentOutOfRangeException

ticks is zero or negative.

ToString()

Returns a short display name of the timeframe.

public override string ToString()

Returns

string

Chart for 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

volume int

The traded volume at which a candle closes; must be positive.

Returns

CandleSeriesTimeFrame

The timeframe.

Exceptions

ArgumentOutOfRangeException

volume is 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

left CandleSeriesTimeFrame
right CandleSeriesTimeFrame

Returns

bool

operator !=(CandleSeriesTimeFrame, CandleSeriesTimeFrame)

public static bool operator !=(CandleSeriesTimeFrame left, CandleSeriesTimeFrame right)

Parameters

left CandleSeriesTimeFrame
right CandleSeriesTimeFrame

Returns

bool