Class Observation<T>
- Namespace
- Balsam
- Assembly
- Balsam.Backtester.dll
Encapsulates multiple values associated with a particular date.
[JsonObject(MemberSerialization = MemberSerialization.OptIn, ItemNullValueHandling = NullValueHandling.Ignore)]
public abstract class Observation<T> : IEnumerable<T>, IEnumerable
Type Parameters
T
- Inheritance
-
Observation<T>
- Implements
-
IEnumerable<T>
- Derived
- Inherited Members
- Extension Methods
Constructors
Observation()
To support some serialization formats.
protected Observation()
Observation(DateTime, DateTime?, params T[])
Instantiates a new observation using the specified date, timestamp and values.
protected Observation(DateTime date, DateTime? timestamp, params T[] values)
Parameters
Exceptions
Observation(DateTime, params T[])
Instantiates a new observation using the specified date and values.
protected Observation(DateTime date, params T[] values)
Parameters
date
DateTimevalues
T[]
Properties
Count
Gets the number of data points associated with this observation.
public int Count { get; }
Property Value
Date
Gets the date of the observation.
public DateTime Date { get; }
Property Value
this[int]
Gets the value at the specified index.
public T this[int index] { get; }
Parameters
index
int
Property Value
- T
Timestamp
Gets the timestamp of the observation, typically when the observation was released or otherwise known.
public DateTime? Timestamp { get; }
Property Value
Methods
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<T> GetEnumerator()
Returns
- IEnumerator<T>
ToString()
Returns a string representation of this object.
public override string ToString()