Struct TakeIndicator<TInner, TSample, TValue>
Result of Take<TSelf, TSample, TValue>(IIndicator<TSelf, TSample, TValue>, int). Maintains a sliding last-N window of the wrapped indicator's values.
public readonly struct TakeIndicator<TInner, TSample, TValue> : IIndicator<TakeIndicator<TInner, TSample, TValue>, TSample, ImmutableArray<TValue>>, ISignal<ImmutableArray<TValue>> where TInner : IIndicator<TInner, TSample, TValue>
Type Parameters
TInnerThe wrapped indicator's concrete type.
TSampleThe sample type consumed on each observation.
TValueThe wrapped indicator's value type.
- Implements
-
ISignal<ImmutableArray<TValue>>
- Inherited Members
- Extension Methods
Properties
Value
The current signal value.
public ImmutableArray<TValue> Value { get; }
Property Value
- ImmutableArray<TValue>
Remarks
Oldest first. Shorter than the requested window size until enough samples have been added.
Methods
Add(TSample)
Fold one more sample in, returning the updated indicator.
public TakeIndicator<TInner, TSample, TValue> Add(TSample sample)
Parameters
sampleTSampleThe new observation.
Returns
- TakeIndicator<TInner, TSample, TValue>
A new indicator instance reflecting
sample.