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
Fields
_mostRecentlyRemoved
protected DoubleArray _mostRecentlyRemoved
Field Value
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
CurrentTime
Gets the current time of Current.
public long CurrentTime { get; protected set; }
Property Value
InputProperties
The number of properties of input argument of Update(long, DoubleArray) must have.
public int InputProperties { get; protected set; }
Property Value
IsReady
Gets a flag indicating when this updatable is ready and fully initialized
public bool IsReady { get; }
Property Value
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
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
OutputCount
The number of items Current will have.
public int OutputCount { get; protected set; }
Property Value
Properties
The number of properties Current will have.
public int Properties { get; protected set; }
Property Value
Samples
Gets the number of samples processed by this indicator
public long Samples { get; protected set; }
Property Value
Methods
OnUpdated(long, DoubleArray)
Event invocator for the Updated event
protected virtual void OnUpdated(long time, DoubleArray consolidated)
Parameters
timelongconsolidatedDoubleArrayThis 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
timelongThe timestamp represented in milliseconds-epoch-1970.
inputDoubleArrayThe value to use to update this updatable
Events
Resetted
Event handler that fires after this updatable is reset.
public event ResettedHandler Resetted
Event Type
Updated
Event handler that fires after this updatable is updated.
public event UpdatedHandler Updated