Table of Contents

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

date DateTime
timestamp DateTime?
values T[]

Exceptions

ArgumentNullException

Observation(DateTime, params T[])

Instantiates a new observation using the specified date and values.

protected Observation(DateTime date, params T[] values)

Parameters

date DateTime
values T[]

Properties

Count

Gets the number of data points associated with this observation.

public int Count { get; }

Property Value

int

Date

Gets the date of the observation.

public DateTime Date { get; }

Property Value

DateTime

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

DateTime?

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

Returns

string