Table of Contents

Interface IHeatmapTradingCalendar

Namespace
ATAS.Indicators.Heatmap
Assembly
ATAS.Indicators.dll

Trading-session calendar of the heatmap instrument (its default trading session), exposed through TradingCalendar. It lets a heatmap indicator that processes candles (IHeatmapCandleConsumer) detect period boundaries exactly like a chart indicator does with IsNewSession(bar) / IsNewWeek(bar) / IsNewMonth(bar).

Time base. The methods take candle times as the chart stores them — Time (Time, the candle open time) without any conversion and without TimeZoneOffset. The chart's IsNewSession(bar) compares the Time of bar bar - 1 and of bar bar, so IsNewSession(previous.Time, current.Time) gives the same answer for the same candles of the instrument's default session.

Thread-safe; the members may be called from any callback.

Not in ATAS 8.0.15 yet: available from the next version.

public interface IHeatmapTradingCalendar
Extension Methods

Properties

TimeZoneOffset

The time zone offset the user set for the instrument in the platform: the value chart indicators of the instrument read from TimeZoneOffset. Read it at the time of use — the user can change it while the heatmap is open.

TimeSpan TimeZoneOffset { get; }

Property Value

TimeSpan

Methods

GetCustomStartTime(DateTime, TimeSpan)

The open time of the timeFrame period that contains time; same semantics and time base as GetCustomStartTime(DateTime, TimeSpan) on a chart with the instrument's default session. Intraday periods are counted from the session start, like the chart's time-frame candles.

DateTime GetCustomStartTime(DateTime time, TimeSpan timeFrame)

Parameters

time DateTime

A candle time.

timeFrame TimeSpan

The period length, for example four hours.

Returns

DateTime

The open time of the period.

IsNewMonth(DateTime, DateTime)

Whether a new trading month starts between two candles; same semantics and time base as IsNewMonth(DateTime, DateTime).

bool IsNewMonth(DateTime prevTime, DateTime newTime)

Parameters

prevTime DateTime

The open time of the previous candle.

newTime DateTime

The open time of the current candle.

Returns

bool

true when the current candle opens a new month.

IsNewSession(DateTime, DateTime)

Whether a new trading session starts between two candles; same semantics and time base as IsNewSession(DateTime, DateTime) on a chart with the instrument's default session.

bool IsNewSession(DateTime prevTime, DateTime newTime)

Parameters

prevTime DateTime

The open time of the previous candle.

newTime DateTime

The open time of the current candle.

Returns

bool

true when the current candle opens a new session.

IsNewWeek(DateTime, DateTime)

Whether a new trading week starts between two candles; same semantics and time base as IsNewWeek(DateTime, DateTime).

bool IsNewWeek(DateTime prevTime, DateTime newTime)

Parameters

prevTime DateTime

The open time of the previous candle.

newTime DateTime

The open time of the current candle.

Returns

bool

true when the current candle opens a new week.

ToTimelineNanos(DateTime)

Converts a candle time (Time or LastTime) to a timestamp on the heatmap timeline, in nanoseconds — the time base of trade ticks, series samples and the viewport.

long ToTimelineNanos(DateTime candleTime)

Parameters

candleTime DateTime

The candle time as delivered.

Returns

long

The timeline timestamp in nanoseconds; 0 for default(System.DateTime).