Struct TimeWindowIndicator<TInner, TSample, TValue, TTime>
Result of TimeWindow<TSelf, TSample, TValue, TTime>(IIndicator<TSelf, TSample, TValue>, Func<TSample, TTime>, Func<TTime, TTime, bool>). Maintains a duration-bounded window of the wrapped indicator's timestamped values.
public readonly struct TimeWindowIndicator<TInner, TSample, TValue, TTime> : IIndicator<TimeWindowIndicator<TInner, TSample, TValue, TTime>, TSample, ImmutableArray<TimestampedSample<TTime, TValue>>>, ISignal<ImmutableArray<TimestampedSample<TTime, TValue>>> where TInner : IIndicator<TInner, TSample, TValue> where TTime : IComparable<TTime>
Type Parameters
TInnerThe wrapped indicator's concrete type.
TSampleThe sample type consumed on each observation.
TValueThe wrapped indicator's value type.
TTimeThe sample time type.
- Implements
-
IIndicator<TimeWindowIndicator<TInner, TSample, TValue, TTime>, TSample, ImmutableArray<TimestampedSample<TTime, TValue>>>
- Inherited Members
- Extension Methods
Properties
Value
The current signal value.
public ImmutableArray<TimestampedSample<TTime, TValue>> Value { get; }
Property Value
- ImmutableArray<TimestampedSample<TTime, TValue>>
Remarks
Oldest first.
Methods
Add(TSample)
Fold one more sample in, returning the updated indicator.
public TimeWindowIndicator<TInner, TSample, TValue, TTime> Add(TSample sample)
Parameters
sampleTSampleThe new observation.
Returns
- TimeWindowIndicator<TInner, TSample, TValue, TTime>
A new indicator instance reflecting
sample.