Table of Contents

Class HeatmapMboDataSnapshot

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

Immutable raw MBO store snapshot shared by all indicator instances. Records are detached from the provider before publication.

Added in ATAS 8.0.15.

public sealed class HeatmapMboDataSnapshot
Inheritance
object
HeatmapMboDataSnapshot
Extension Methods

Constructors

HeatmapMboDataSnapshot(long, IReadOnlyList<MboAnnotatedTrade>, IReadOnlyList<MboIcebergRecord>, HeatmapMboStatus, long, TimeSpan, Func<long, long>)

Creates a snapshot whose AnnotatedTradesVersion and IcebergsVersion are equal to epoch, with AnnotatedTradesChangeStartIndex and AnnotatedTradesGeneration set to 0. Snapshots are created by the platform; the constructors are public so that indicator code can be tested with synthetic data.

public HeatmapMboDataSnapshot(long epoch, IReadOnlyList<MboAnnotatedTrade> annotatedTrades, IReadOnlyList<MboIcebergRecord> icebergs, HeatmapMboStatus status, long liveEdgeNanos, TimeSpan displayTimeOffset, Func<long, long> timestampToTimelineNanos)

Parameters

epoch long

The value of Epoch.

annotatedTrades IReadOnlyList<MboAnnotatedTrade>

The value of AnnotatedTrades.

icebergs IReadOnlyList<MboIcebergRecord>

The value of Icebergs.

status HeatmapMboStatus

The value of Status.

liveEdgeNanos long

The value of LiveEdgeNanos.

displayTimeOffset TimeSpan

The value of DisplayTimeOffset.

timestampToTimelineNanos Func<long, long>

The conversion used by ToTimelineNanos(long), from UTC Unix milliseconds to heatmap timeline nanoseconds.

Exceptions

ArgumentNullException

annotatedTrades, icebergs or timestampToTimelineNanos is null.

HeatmapMboDataSnapshot(long, long, int, IReadOnlyList<MboAnnotatedTrade>, long, IReadOnlyList<MboIcebergRecord>, HeatmapMboStatus, long, TimeSpan, Func<long, long>)

Creates a snapshot with AnnotatedTradesGeneration set to 0 (lineage unknown).

public HeatmapMboDataSnapshot(long epoch, long annotatedTradesVersion, int annotatedTradesChangeStartIndex, IReadOnlyList<MboAnnotatedTrade> annotatedTrades, long icebergsVersion, IReadOnlyList<MboIcebergRecord> icebergs, HeatmapMboStatus status, long liveEdgeNanos, TimeSpan displayTimeOffset, Func<long, long> timestampToTimelineNanos)

Parameters

epoch long

The value of Epoch.

annotatedTradesVersion long

The value of AnnotatedTradesVersion.

annotatedTradesChangeStartIndex int

The value of AnnotatedTradesChangeStartIndex; clamped to 0..annotatedTrades.Count.

annotatedTrades IReadOnlyList<MboAnnotatedTrade>

The value of AnnotatedTrades.

icebergsVersion long

The value of IcebergsVersion.

icebergs IReadOnlyList<MboIcebergRecord>

The value of Icebergs.

status HeatmapMboStatus

The value of Status.

liveEdgeNanos long

The value of LiveEdgeNanos.

displayTimeOffset TimeSpan

The value of DisplayTimeOffset.

timestampToTimelineNanos Func<long, long>

The conversion used by ToTimelineNanos(long), from UTC Unix milliseconds to heatmap timeline nanoseconds.

Exceptions

ArgumentNullException

annotatedTrades, icebergs or timestampToTimelineNanos is null.

HeatmapMboDataSnapshot(long, long, int, long, IReadOnlyList<MboAnnotatedTrade>, long, IReadOnlyList<MboIcebergRecord>, HeatmapMboStatus, long, TimeSpan, Func<long, long>)

Creates a snapshot with all values specified.

public HeatmapMboDataSnapshot(long epoch, long annotatedTradesVersion, int annotatedTradesChangeStartIndex, long annotatedTradesGeneration, IReadOnlyList<MboAnnotatedTrade> annotatedTrades, long icebergsVersion, IReadOnlyList<MboIcebergRecord> icebergs, HeatmapMboStatus status, long liveEdgeNanos, TimeSpan displayTimeOffset, Func<long, long> timestampToTimelineNanos)

Parameters

epoch long

The value of Epoch.

annotatedTradesVersion long

The value of AnnotatedTradesVersion.

annotatedTradesChangeStartIndex int

The value of AnnotatedTradesChangeStartIndex; clamped to 0..annotatedTrades.Count.

annotatedTradesGeneration long

The value of AnnotatedTradesGeneration; 0 means the lineage is unknown.

annotatedTrades IReadOnlyList<MboAnnotatedTrade>

The value of AnnotatedTrades.

icebergsVersion long

The value of IcebergsVersion.

icebergs IReadOnlyList<MboIcebergRecord>

The value of Icebergs.

status HeatmapMboStatus

The value of Status.

liveEdgeNanos long

The value of LiveEdgeNanos.

displayTimeOffset TimeSpan

The value of DisplayTimeOffset.

timestampToTimelineNanos Func<long, long>

The conversion used by ToTimelineNanos(long), from UTC Unix milliseconds to heatmap timeline nanoseconds.

Exceptions

ArgumentNullException

annotatedTrades, icebergs or timestampToTimelineNanos is null.

Properties

AnnotatedTrades

Gets the annotated trades currently retained by the platform, ordered by event time. Never null.

public IReadOnlyList<MboAnnotatedTrade> AnnotatedTrades { get; }

Property Value

IReadOnlyList<MboAnnotatedTrade>

AnnotatedTradesChangeStartIndex

Gets the index of the first item of AnnotatedTrades that changed compared with the previous published snapshot: the previous count when trades were only appended, 0 when the list was rebuilt, and AnnotatedTrades.Count when nothing changed. Always within 0..AnnotatedTrades.Count.

public int AnnotatedTradesChangeStartIndex { get; }

Property Value

int

AnnotatedTradesGeneration

Identifies the lineage of AnnotatedTrades. Snapshots that share a non-zero generation only ever append: the list of the one with fewer items is an unchanged prefix of the other. A consumer that missed intermediate snapshots can therefore continue from its own processed count instead of rebuilding. Zero means the lineage is unknown.

public long AnnotatedTradesGeneration { get; }

Property Value

long

AnnotatedTradesVersion

Gets the version of AnnotatedTrades. The platform increments it each time the list changes; an unchanged value means the list is the same as in the previous snapshot.

public long AnnotatedTradesVersion { get; }

Property Value

long

DisplayTimeOffset

Gets the time-zone offset of the instrument. Add it to a UTC time of an MBO record to show that time to the user.

public TimeSpan DisplayTimeOffset { get; }

Property Value

TimeSpan

Empty

Gets a snapshot with no data: no annotated trades or icebergs, status Unavailable, and zero epoch, versions and live edge.

public static HeatmapMboDataSnapshot Empty { get; }

Property Value

HeatmapMboDataSnapshot

Epoch

Gets the content version of the snapshot. The platform increments it when the annotated trades or the icebergs change; snapshots that only update Status or LiveEdgeNanos keep the previous epoch.

public long Epoch { get; }

Property Value

long

Icebergs

Gets the tracked icebergs currently retained by the platform, ordered by their first-seen time and order id. Never null.

public IReadOnlyList<MboIcebergRecord> Icebergs { get; }

Property Value

IReadOnlyList<MboIcebergRecord>

IcebergsVersion

Gets the version of Icebergs. The platform increments it each time the list changes; an unchanged value means the list is the same as in the previous snapshot.

public long IcebergsVersion { get; }

Property Value

long

LiveEdgeNanos

Gets the current time on the heatmap timeline when the snapshot was created, in nanoseconds; the same time base as the timestamps of the indicator's series.

public long LiveEdgeNanos { get; }

Property Value

long

Status

Gets the state of the MBO data for the instrument, for example Ok, LoadingHistory or Unavailable (for example, when MBO is not provided for this instrument or connection). Check its kind before using the data.

public HeatmapMboStatus Status { get; }

Property Value

HeatmapMboStatus

Methods

ToTimelineNanos(long)

Converts a UTC Unix timestamp in milliseconds, as used by the MBO records of this snapshot (for example, the first and last times of an iceberg), to the heatmap timeline in nanoseconds, the time base of LiveEdgeNanos and of the indicator's series.

public long ToTimelineNanos(long unixMilliseconds)

Parameters

unixMilliseconds long

UTC time in milliseconds since the Unix epoch.

Returns

long

The same moment on the heatmap timeline, in nanoseconds.