Table of Contents

Class ArrayRollingWindow

Namespace
FinanceSharp
Assembly
FinanceSharp.dll

Serves a similar purpose to RollingWindow<T> but the data is rolled inside Current (a DoubleArray).

public class ArrayRollingWindow : IIndicator, IUpdatable
Inheritance
ArrayRollingWindow
Implements
Inherited Members
Extension Methods

Constructors

ArrayRollingWindow(int, int, string)

Initializes a new instance of the object class.

public ArrayRollingWindow(int outputCount, int properties, string name = null)

Parameters

outputCount int
properties int
name string

Fields

_mostRecentlyRemoved

protected DoubleArray _mostRecentlyRemoved

Field Value

DoubleArray

Properties

Current

Gets the current state of this updatable. If the state has not been updated then the value will be null.

public DoubleArray Current { get; protected set; }

Property Value

DoubleArray

CurrentTime

Gets the current time of Current.

public long CurrentTime { get; protected set; }

Property Value

long

InputProperties

The number of properties of input argument of Update(long, DoubleArray) must have.

public int InputProperties { get; protected set; }

Property Value

int

IsReady

Gets a flag indicating when this updatable is ready and fully initialized

public bool IsReady { get; }

Property Value

bool

MostRecentlyRemoved

Gets the most recently removed item from the window. This is the piece of data that just 'fell off' as a result of the most recent add. If no items have been removed, this will throw an exception.

public DoubleArray MostRecentlyRemoved { get; protected set; }

Property Value

DoubleArray

Exceptions

InvalidOperationException

When unable to return MostRecentlyRemoved item because this indicator was not updated yet.

Name

Gets a name for this indicator

public string Name { get; protected set; }

Property Value

string

OutputCount

The number of items Current will have.

public int OutputCount { get; protected set; }

Property Value

int

Properties

The number of properties Current will have.

public int Properties { get; protected set; }

Property Value

int

Samples

Gets the number of samples processed by this indicator

public long Samples { get; protected set; }

Property Value

long

Methods

OnUpdated(long, DoubleArray)

Event invocator for the Updated event

protected virtual void OnUpdated(long time, DoubleArray consolidated)

Parameters

time long
consolidated DoubleArray

This is the new piece of data produced by this indicator

Reset()

Resets this updatable to its initial state

public void Reset()

ToDetailedString()

Provides a more detailed string of this indicator in the form of {Name} - {Value}

public string ToDetailedString()

Returns

string

A detailed string of this indicator's current state

Update(long, DoubleArray)

Updates the state of this updatable with the given value and returns true if this updatable is ready, false otherwise

public void Update(long time, DoubleArray input)

Parameters

time long

The timestamp represented in milliseconds-epoch-1970.

input DoubleArray

The value to use to update this updatable

Events

Resetted

Event handler that fires after this updatable is reset.

public event ResettedHandler Resetted

Event Type

ResettedHandler

Updated

Event handler that fires after this updatable is updated.

public event UpdatedHandler Updated

Event Type

UpdatedHandler