Table of Contents

Interface ISeries

Namespace
Balsam
Assembly
Balsam.Common.dll

Defines common methods and properties that all time series must implement.

public interface ISeries
Extension Methods

Properties

Count

Gets the number of observations in the series.

int Count { get; }

Property Value

int

Dates

Gets the dates associated with the observations.

IEnumerable<DateTime> Dates { get; }

Property Value

IEnumerable<DateTime>

FirstDate

Gets the first date on which there is valid data available (i.e on MaxBarsBack).

DateTime FirstDate { get; }

Property Value

DateTime

Index

Gets the index of the current bar or -1 if Indexing property is Absolute.

int Index { get; }

Property Value

int

Indexing

Gets the indexing strategy. Absolute indexes from 0 to Count - 1. RelativeToCurrentBar operates as an offset to the current index.

IndexKind Indexing { get; }

Property Value

IndexKind

this[int]

Gets the current object according to the indexing strategy.

object this[int index] { get; }

Parameters

index int

Property Value

object

LastDate

Gets the late date of the series.

DateTime LastDate { get; }

Property Value

DateTime

MaxBarsBack

Gets/sets the number of bars needed to initialize a series to a valid state.

int MaxBarsBack { get; set; }

Property Value

int

Name

Gets/sets the name or description.

string Name { get; set; }

Property Value

string

Symbol

Gets/sets the symbol.

string Symbol { get; set; }

Property Value

string

Methods

Add(DateTime, object)

Adds a date/value observation to the series.

void Add(DateTime date, object value)

Parameters

date DateTime
value object

Clear()

Clears the series.

void Clear()

GetValue(int)

Returns the value in a series at the specified index.

object GetValue(int index)

Parameters

index int

Returns

object

Remove(DateTime)

Removes an observation at the specified date. Returns true if date found.

bool Remove(DateTime date)

Parameters

date DateTime

Returns

bool

Remove(int)

Removes an observation at the specified index.

void Remove(int index)

Parameters

index int

SetIndex(DateTime)

Sets the index using the specified date.

int SetIndex(DateTime date)

Parameters

date DateTime

Returns

int

SetIndex(int)

Sets the index to the specified value.

void SetIndex(int index)

Parameters

index int

SetValue(int, object)

Sets the value in a series at the specified index.

void SetValue(int index, object value)

Parameters

index int
value object

Sync(IEnumerable<DateTime>)

ISeries Sync(IEnumerable<DateTime> dates)

Parameters

dates IEnumerable<DateTime>

Returns

ISeries