Struct LagIndicator<TInner, TSample, TValue>
Result of Lag<TSelf, TSample, TValue>(IIndicator<TSelf, TSample, TValue>, int). Exposes the wrapped indicator's value from N samples back.
public readonly struct LagIndicator<TInner, TSample, TValue> : IIndicator<LagIndicator<TInner, TSample, TValue>, TSample, TValue>, ISignal<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
-
IIndicator<LagIndicator<TInner, TSample, TValue>, TSample, TValue>ISignal<TValue>
- Inherited Members
- Extension Methods
Properties
Value
The current signal value.
public TValue Value { get; }
Property Value
- TValue
Exceptions
- InvalidOperationException
Fewer than
n + 1samples have been added yet.
Methods
Add(TSample)
Fold one more sample in, returning the updated indicator.
public LagIndicator<TInner, TSample, TValue> Add(TSample sample)
Parameters
sampleTSampleThe new observation.
Returns
- LagIndicator<TInner, TSample, TValue>
A new indicator instance reflecting
sample.