Table of Contents

Class HeatmapCandleSeriesUpdate

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

One update of a candle series delivered to ProcessCandlesAsync(HeatmapCandleSeriesUpdate, CancellationToken). Immutable; the candles are copies that may be kept.

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

public sealed class HeatmapCandleSeriesUpdate
Inheritance
object
HeatmapCandleSeriesUpdate
Extension Methods

Properties

Candles

The candles, oldest first: the whole series for Reload, the replaced tail for Update (may be empty when candles were only removed), empty for Failed.

public IReadOnlyList<HeatmapCandle> Candles { get; }

Property Value

IReadOnlyList<HeatmapCandle>

Error

The user-facing reason for Failed; null otherwise.

public string? Error { get; }

Property Value

string

FirstIndex

Index in the previously delivered list from which Candles replace the list: the list becomes previous[0..FirstIndex) followed by Candles. 0 for Reload and Failed.

public int FirstIndex { get; }

Property Value

int

Kind

The kind of the update.

public HeatmapCandleUpdateKind Kind { get; }

Property Value

HeatmapCandleUpdateKind

Request

The request this update belongs to: the request object the receiving instance declared in GetRequiredCandleSeries().

public CandleSeriesRequest Request { get; }

Property Value

CandleSeriesRequest

Methods

ApplyTo(List<HeatmapCandle>)

Applies this update to a list that holds the candles delivered so far: a Reload replaces the list, an Update replaces its tail, a Failed clears it.

public bool ApplyTo(List<HeatmapCandle> candles)

Parameters

candles List<HeatmapCandle>

The list of the delivered candles.

Returns

bool

false when an Update does not fit the list (FirstIndex is beyond its end, e.g. the list was cleared after a state reset); the list is then left unchanged and the next Reload brings it back in sync.

Failed(CandleSeriesRequest, string)

Creates a Failed update.

public static HeatmapCandleSeriesUpdate Failed(CandleSeriesRequest request, string error)

Parameters

request CandleSeriesRequest

The request the series belongs to.

error string

The user-facing reason.

Returns

HeatmapCandleSeriesUpdate

The update.

Reload(CandleSeriesRequest, IReadOnlyList<HeatmapCandle>)

Creates a Reload update carrying the whole series.

public static HeatmapCandleSeriesUpdate Reload(CandleSeriesRequest request, IReadOnlyList<HeatmapCandle> candles)

Parameters

request CandleSeriesRequest

The request the series belongs to.

candles IReadOnlyList<HeatmapCandle>

Every candle of the series, oldest first. The list is kept by reference and must not be changed afterwards.

Returns

HeatmapCandleSeriesUpdate

The update.

ToString()

Returns a short description of the update for logs.

public override string ToString()

Returns

string

The description, e.g. Update ESZ6 M5 from 120 (2 candles).

Update(CandleSeriesRequest, int, IReadOnlyList<HeatmapCandle>)

Creates an Update that replaces the delivered list from firstIndex on.

public static HeatmapCandleSeriesUpdate Update(CandleSeriesRequest request, int firstIndex, IReadOnlyList<HeatmapCandle> candles)

Parameters

request CandleSeriesRequest

The request the series belongs to.

firstIndex int

Index from which the delivered list is replaced; not negative.

candles IReadOnlyList<HeatmapCandle>

The new tail, oldest first. The list is kept by reference and must not be changed afterwards.

Returns

HeatmapCandleSeriesUpdate

The update.