Show / Hide Table of Contents

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.

Inheritance
object
TimeSeries<T>
Instrument
Implements
ITimeSeries<T>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TuringTrader.Simulator
Assembly: TuringTrader.Simulator.dll
Syntax
public class TimeSeries<T> : ITimeSeries<T>
Type Parameters
Name Description
T

value type

Constructors

| Edit this page View Source

TimeSeries(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

| Edit this page View Source

MaxBarsBack

Maximum number of bars available.

Declaration
public readonly int MaxBarsBack
Field Value
Type Description
int

Properties

| Edit this page View Source

BarsAvailable

Number of valid bars available.

Declaration
public int BarsAvailable { get; }
Property Value
Type Description
int
| Edit this page View Source

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

| Edit this page View Source

Value

Write-only property to set current value, and shift the time series.

Declaration
public T Value { set; }
Property Value
Type Description
T

Methods

| Edit this page View Source

Clear()

Clear contents of time series.

Declaration
public void Clear()

Implements

ITimeSeries<T>
  • Edit this page
  • View Source
In this article
Back to top Copyright © 2011-2023, Bertram Enterprises LLC dba TuringTrader.com