Table of Contents

Struct TimeWindowSumIndicator<TInner, TSample, TValue, TTime>

Namespace
Virtufin.Core.Behavior
Assembly
Virtufin.Core.dll
public readonly struct TimeWindowSumIndicator<TInner, TSample, TValue, TTime> : IIndicator<TimeWindowSumIndicator<TInner, TSample, TValue, TTime>, TSample, (TValue Sum, int Count)>, ISignal<(TValue Sum, int Count)> where TInner : IIndicator<TInner, TSample, TValue> where TValue : IAdditionOperators<TValue, TValue, TValue>, ISubtractionOperators<TValue, TValue, TValue> where TTime : IComparable<TTime>

Type Parameters

TInner

The wrapped indicator's concrete type.

TSample

The sample type consumed on each observation.

TValue

The wrapped indicator's value type.

TTime

The sample time type.

Implements
IIndicator<TimeWindowSumIndicator<TInner, TSample, TValue, TTime>, TSample, (TValue Sum, int Count)>
ISignal<(TValue Sum, int Count)>
Inherited Members
Extension Methods

Properties

Value

The current signal value.

public (TValue Sum, int Count) Value { get; }

Property Value

(TValue Sum, int Count)

Remarks

Count is the live in-window count, which varies over time under duration-based eviction — needed by any caller dividing the sum into an average (e.g. SimpleMovingAverage).

Methods

Add(TSample)

Fold one more sample in, returning the updated indicator.

public TimeWindowSumIndicator<TInner, TSample, TValue, TTime> Add(TSample sample)

Parameters

sample TSample

The new observation.

Returns

TimeWindowSumIndicator<TInner, TSample, TValue, TTime>

A new indicator instance reflecting sample.