Table of Contents

Struct TakeIndicator<TInner, TSample, TValue>

Namespace
Virtufin.Core.Behavior
Assembly
Virtufin.Core.dll

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

TInner

The wrapped indicator's concrete type.

TSample

The sample type consumed on each observation.

TValue

The wrapped indicator's value type.

Implements
IIndicator<TakeIndicator<TInner, TSample, TValue>, TSample, 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

sample TSample

The new observation.

Returns

TakeIndicator<TInner, TSample, TValue>

A new indicator instance reflecting sample.