Class HeatmapIndicatorFallbackReWarmGuard
- Namespace
- ATAS.Indicators.Heatmap
- Assembly
- ATAS.Indicators.dll
State holder for indicators whose calculation is anchored at the real data
start (e.g. CVD FromDataStart, VWAP FromDataStart) and may
receive a fallback-range warm-up before the host knows the real data start.
Encapsulates the latch protocol so the indicator does not have to track
three flags and an inline check by hand.
Usage:
- Construct once per instance, typically as a readonly field.
- Call Reset() from
ResetAsync. - Call OnWarmedUp(HeatmapIndicatorWarmupRequest) from
WarmUpAsyncwith the incoming request — the guard captures IsFallbackRange and re-arms the latch. - Call ShouldRequestReWarm(HeatmapTickBatch) from
ProcessTicksAsyncafter processing the batch; if it returnstrue, await RequestReWarmAsync(string, CancellationToken).
The guard latches per warm-up cycle: ShouldRequestReWarm(HeatmapTickBatch)
returns true at most once between two OnWarmedUp(HeatmapIndicatorWarmupRequest) calls,
so repeated tick batches do not re-trigger. A fresh warm-up re-arms the
latch for the next fallback episode.
Threading: per-instance, lock-free. The platform serialises calls on a single indicator instance, which is also the only valid caller of this guard.
Added in ATAS 8.0.15.
public sealed class HeatmapIndicatorFallbackReWarmGuard
- Inheritance
-
objectHeatmapIndicatorFallbackReWarmGuard
- Extension Methods
Constructors
HeatmapIndicatorFallbackReWarmGuard()
public HeatmapIndicatorFallbackReWarmGuard()
Methods
OnWarmedUp(HeatmapIndicatorWarmupRequest)
Records a completed warm-up and re-arms the latch: remembers whether the warm-up used a fallback range (IsFallbackRange) and clears any re-warm already requested.
public void OnWarmedUp(HeatmapIndicatorWarmupRequest request)
Parameters
requestHeatmapIndicatorWarmupRequestThe request passed to WarmUpAsync(HeatmapIndicatorWarmupRequest, IHeatmapIndicatorDataSources, CancellationToken).
Reset()
Clears the guard: forgets the last warm-up range and any re-warm already requested. Call it when the indicator resets its own state, for example from OnStateResetCoreAsync(IHeatmapIndicatorContext, IHeatmapIndicatorRuntime, CancellationToken).
public void Reset()
ShouldRequestReWarm(HeatmapTickBatch)
Tells whether the indicator should now call RequestReWarmAsync(string, CancellationToken): returns true once after a fallback-range warm-up, on the first batch that contains a tick with a positive timestamp, and false otherwise until the next OnWarmedUp(HeatmapIndicatorWarmupRequest).
public bool ShouldRequestReWarm(HeatmapTickBatch ticks)
Parameters
ticksHeatmapTickBatchThe batch passed to ProcessTicksAsync(HeatmapTickBatch, CancellationToken).