Class HeatmapIndicator<TSettings>
- Namespace
- ATAS.Indicators.Heatmap
- Assembly
- ATAS.Indicators.dll
Strongly typed base for indicator authors. Bridges to the non-generic IHeatmapIndicator with a single explicit cast, so derived classes work against typed settings.
Added in ATAS 8.0.15.
public abstract class HeatmapIndicator<TSettings> : IHeatmapIndicator where TSettings : class, new()
Type Parameters
TSettings
- Inheritance
-
objectHeatmapIndicator<TSettings>
- Implements
- Extension Methods
Constructors
HeatmapIndicator()
protected HeatmapIndicator()
Properties
Context
Most recent context handed in by the platform via OnStateResetNotificationAsync(IHeatmapIndicatorContext, IHeatmapIndicatorRuntime, CancellationToken). Null only before the very first reset notification — the platform always emits a reset before any data callback, so by the time ProcessTicksAsync(HeatmapTickBatch, CancellationToken) / WarmUpAsync(HeatmapIndicatorWarmupRequest, IHeatmapIndicatorDataSources, CancellationToken) / ProcessProfileAsync(HeatmapMarketProfileSnapshot, CancellationToken) fires this is non-null.
protected IHeatmapIndicatorContext? Context { get; }
Property Value
Descriptor
Static type-level metadata. Identifies the indicator type, declares its placement (overlay vs sub-panel), visual roles, and series shape. Must not change between calls.
public abstract HeatmapIndicatorDescriptor Descriptor { get; }
Property Value
Runtime
Most recent runtime handed in by the platform via OnStateResetNotificationAsync(IHeatmapIndicatorContext, IHeatmapIndicatorRuntime, CancellationToken). Use to call RequestReWarmAsync(string, CancellationToken) / RequestStateResetAsync(string, CancellationToken). The reference is rebound on every reset, so do not cache it across reset boundaries — read this property each time.
protected IHeatmapIndicatorRuntime? Runtime { get; }
Property Value
Settings
Most recent settings DTO applied through ConfigureAsync(TSettings, CancellationToken).
The base class assigns this property before invoking the typed
ConfigureAsync(TSettings, CancellationToken) override, so
derived indicators can read the current settings directly without
caching them into a private field. Defaults to a fresh
TSettings instance until the platform calls
ConfigureAsync(TSettings, CancellationToken) for the first time.
protected TSettings Settings { get; }
Property Value
- TSettings
SettingsType
Gets the CLR type of the settings DTO: always TSettings.
public Type SettingsType { get; }
Property Value
- Type
State
Persistent visual state. Lazily created on first access from the indicator's own Descriptor; the platform may pre-create it via State at instance construction time so the reference is stable from the first lifecycle callback onward.
public IHeatmapVisualState State { get; }
Property Value
Methods
ClearSeries<TValue>(params HeatmapIndicatorSeriesHandle<TValue>[])
Clear a homogeneous set of series under a short-lived state lease.
protected void ClearSeries<TValue>(params HeatmapIndicatorSeriesHandle<TValue>[] series)
Parameters
seriesHeatmapIndicatorSeriesHandle<TValue>[]
Type Parameters
TValue
ClearSeries<TValue>(IHeatmapVisualLease, params HeatmapIndicatorSeriesHandle<TValue>[])
Clear a homogeneous set of series inside an existing visual lease. Useful for rebuilds that clear and refill multiple related series in one commit.
protected static void ClearSeries<TValue>(IHeatmapVisualLease visualLease, params HeatmapIndicatorSeriesHandle<TValue>[] series)
Parameters
visualLeaseIHeatmapVisualLeaseseriesHeatmapIndicatorSeriesHandle<TValue>[]
Type Parameters
TValue
ConfigureAsync(TSettings, CancellationToken)
Apply user-edited settings. The base class has already stored
settings in the inherited Settings
property by the time this runs, so the default implementation does
nothing. Override only when the indicator needs to react to a
settings change — e.g. invalidate an accumulator, request a state
reset on calc-mode change, or rebuild visual presentation under a
lease. Implementations do not need to assign the supplied settings
to a private field; read them via Settings.
public virtual ValueTask ConfigureAsync(TSettings settings, CancellationToken cancellationToken)
Parameters
settingsTSettingscancellationTokenCancellationToken
Returns
- ValueTask
Describe<TSelf>(string?)
Begin describing the indicator using metadata from the HeatmapIndicatorAttribute
applied to TSelf. Authors call this from the static
constructor of the deriving type, which keeps the type id declared exactly
once (in the attribute) and removes the typo-mismatch risk between
discovery metadata and the descriptor.
protected static HeatmapIndicatorDescriptorBuilder Describe<TSelf>(string? labelOverride = null) where TSelf : IHeatmapIndicator
Parameters
labelOverridestringWhen non-null, used as the descriptor label instead of the attribute's DisplayName.
Returns
Type Parameters
TSelf
HasValidBuySellVolume(HeatmapTradeTick)
Common filter for buy/sell volume indicators: timestamp and volume must be positive and direction must be buy or sell.
protected static bool HasValidBuySellVolume(HeatmapTradeTick tick)
Parameters
tickHeatmapTradeTick
Returns
- bool
HasValidTimestampPriceVolume(HeatmapTradeTick)
Common filter for price/volume indicators: timestamp, price, and volume must all be positive.
protected static bool HasValidTimestampPriceVolume(HeatmapTradeTick tick)
Parameters
tickHeatmapTradeTick
Returns
- bool
OnStateResetCoreAsync(IHeatmapIndicatorContext, IHeatmapIndicatorRuntime, CancellationToken)
Override to react to a state-reset notification. The base class has
already saved context and runtime
into Context / Runtime by the time this
runs, so most overrides only need to clear their own indicator-internal
accumulators (fields, dictionaries, etc.) and don't need either
argument. The arguments are still surfaced for indicators that want
to drive a re-warm or capture context-derived state synchronously.
protected virtual ValueTask OnStateResetCoreAsync(IHeatmapIndicatorContext context, IHeatmapIndicatorRuntime runtime, CancellationToken cancellationToken)
Parameters
contextIHeatmapIndicatorContextruntimeIHeatmapIndicatorRuntimecancellationTokenCancellationToken
Returns
- ValueTask
OrderedTicks(HeatmapTickBatch)
Return eligible ticks from a pooled batch ordered by timestamp. The returned list is detached from the batch and may be kept after the callback returns.
protected static List<HeatmapTradeTick> OrderedTicks(HeatmapTickBatch ticks)
Parameters
ticksHeatmapTickBatch
Returns
- List<HeatmapTradeTick>
OrderedTicks(HeatmapTickBatch, Predicate<HeatmapTradeTick>)
Return eligible ticks from a pooled batch ordered by timestamp. The returned list is detached from the batch and may be kept after the callback returns.
protected static List<HeatmapTradeTick> OrderedTicks(HeatmapTickBatch ticks, Predicate<HeatmapTradeTick> predicate)
Parameters
ticksHeatmapTickBatchpredicatePredicate<HeatmapTradeTick>
Returns
- List<HeatmapTradeTick>
OrderedTicks(IEnumerable<HeatmapTradeTick>)
Return eligible ticks from an enumerable ordered by timestamp.
protected static List<HeatmapTradeTick> OrderedTicks(IEnumerable<HeatmapTradeTick> ticks)
Parameters
ticksIEnumerable<HeatmapTradeTick>
Returns
- List<HeatmapTradeTick>
OrderedTicks(IEnumerable<HeatmapTradeTick>, Predicate<HeatmapTradeTick>)
Return eligible ticks from an enumerable ordered by timestamp.
protected static List<HeatmapTradeTick> OrderedTicks(IEnumerable<HeatmapTradeTick> ticks, Predicate<HeatmapTradeTick> predicate)
Parameters
ticksIEnumerable<HeatmapTradeTick>predicatePredicate<HeatmapTradeTick>
Returns
- List<HeatmapTradeTick>
UpdateSeries<TValue>(HeatmapIndicatorSeriesHandle<TValue>, Action<IHeatmapSeriesLease<TValue>>)
Mutate one series under a short-lived state lease. Use this for simple append/clear/trim operations where the visual style and presentation do not need to change in the same transaction.
protected void UpdateSeries<TValue>(HeatmapIndicatorSeriesHandle<TValue> series, Action<IHeatmapSeriesLease<TValue>> update)
Parameters
seriesHeatmapIndicatorSeriesHandle<TValue>updateAction<IHeatmapSeriesLease<TValue>>
Type Parameters
TValue
UpdateVisual(HeatmapIndicatorVisualHandle, Action<IHeatmapVisualLease>)
Mutate one visual under a short-lived state lease. Use this for style/presentation-only updates or when a callback needs one visual lease and no cross-visual coordination.
protected void UpdateVisual(HeatmapIndicatorVisualHandle visual, Action<IHeatmapVisualLease> update)
Parameters
visualHeatmapIndicatorVisualHandleupdateAction<IHeatmapVisualLease>