Class TimeSeries<T>
Template class for time series data. A TimeSeries object will allow limited access to the historical values of the series, by default 256 values back. TuringTrader makes extensive use of time series objects for the implementation of data sources and indicators.
Implements
Inherited Members
Namespace: TuringTrader.Simulator
Assembly: TuringTrader.Simulator.dll
Syntax
public class TimeSeries<T> : ITimeSeries<T>
Type Parameters
Name | Description |
---|---|
T | value type |
Constructors
| Improve this Doc View SourceTimeSeries(int)
Create and initialize time series. Typically, a time series is a cyclic buffer, allowing access to a limited range of data. However, if a non-positive value is passed for maxBarsBack, a list is created, allowing access to all previous values.
Declaration
public TimeSeries(int maxBarsBack = 256)
Parameters
Type | Name | Description |
---|---|---|
int | maxBarsBack | number of bars to hold |
Fields
| Improve this Doc View SourceMaxBarsBack
Maximum number of bars available.
Declaration
public readonly int MaxBarsBack
Field Value
Type | Description |
---|---|
int |
Properties
| Improve this Doc View SourceBarsAvailable
Number of valid bars available.
Declaration
public int BarsAvailable { get; }
Property Value
Type | Description |
---|---|
int |
this[int]
Read only access to historical bars
Declaration
public T this[int barsBack] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | barsBack | number of bars back, 0 for most recent |
Property Value
Type | Description |
---|---|
T | historical value |
Value
Write-only property to set current value, and shift the time series.
Declaration
public T Value { set; }
Property Value
Type | Description |
---|---|
T |
Methods
| Improve this Doc View SourceClear()
Clear contents of time series.
Declaration
public void Clear()