Table of Contents

Class DividendCollection

Namespace
Balsam
Assembly
Balsam.Backtester.dll

Encapsulates a collection of dividends.

public class DividendCollection : ICollection<Dividend>, IEnumerable<Dividend>, IEnumerable
Inheritance
DividendCollection
Implements
Inherited Members
Extension Methods

Constructors

DividendCollection()

Initializes a new empty DividendCollection.

public DividendCollection()

DividendCollection(IEnumerable<Dividend>)

Initializes a new DividendCollection using the specified dividends.

public DividendCollection(IEnumerable<Dividend> dividends)

Parameters

dividends IEnumerable<Dividend>

Properties

Count

Gets the number of dividends in the collection.

public int Count { get; }

Property Value

int

FirstDate

Gets the date of the first available dividend in the collection.

public DateTime FirstDate { get; }

Property Value

DateTime

IsReadOnly

Returns false.

protected bool IsReadOnly { get; }

Property Value

bool

this[int]

Gets a dividend based on the specified index.

public Dividend this[int index] { get; }

Parameters

index int

Property Value

Dividend

LastDate

Gets the date of the last available dividend in the collection.

public DateTime LastDate { get; }

Property Value

DateTime

Methods

Add(Dividend)

Adds the specified dividend to the collection.

public void Add(Dividend dividend)

Parameters

dividend Dividend

Add(IEnumerable<Dividend>)

Adds an enumerable of dividends to the end of the collection.

public void Add(IEnumerable<Dividend> dividends)

Parameters

dividends IEnumerable<Dividend>

Clear()

Removes all items from the collection.

public void Clear()

Contains(Dividend)

Returns true if the collection contains the specified dividend.

public bool Contains(Dividend dividend)

Parameters

dividend Dividend

Returns

bool

Contains(DateTime)

Returns true if the collection contains the specified ex-date.

public bool Contains(DateTime exDate)

Parameters

exDate DateTime

Returns

bool

Contains(string)

Returns true if the collection contains the specified symbol.

public bool Contains(string symbol)

Parameters

symbol string

Returns

bool

CopyTo(Dividend[], int)

Copies the collection to an array.

protected void CopyTo(Dividend[] array, int arrayIndex)

Parameters

array Dividend[]
arrayIndex int

GetEnumerator()

Returns an enumerator that iterates through the collection of dividends.

public IEnumerator<Dividend> GetEnumerator()

Returns

IEnumerator<Dividend>

Remove(Dividend)

Removes the specified dividend.

public bool Remove(Dividend dividend)

Parameters

dividend Dividend

Returns

bool

ToString()

Returns a string representation of this object.

public override string ToString()

Returns

string