Table of Contents

Class DateRangeCollection

Namespace
Balsam
Assembly
Balsam.Backtester.dll

Encapsulates a collection of date ranges.

public class DateRangeCollection : IEnumerable<DateRange>, IEnumerable
Inheritance
DateRangeCollection
Implements
Inherited Members
Extension Methods

Properties

Count

Gets the count of date ranges in the collection.

public int Count { get; }

Property Value

int

FirstDate

Gets the first date in the collection of date ranges.

public DateTime FirstDate { get; }

Property Value

DateTime

LastDate

Gets the last date in the collection of date ranges.

public DateTime LastDate { get; }

Property Value

DateTime

USBearMarkets

Returns a selection of major US equity bear markets.

public static DateRangeCollection USBearMarkets { get; }

Property Value

DateRangeCollection

USBullMarkets

Returns a selection of major US equity bull markets.

public static DateRangeCollection USBullMarkets { get; }

Property Value

DateRangeCollection

Methods

Add(DateRange)

Adds the specified date range.

public void Add(DateRange range)

Parameters

range DateRange

Exceptions

ArgumentNullException

Contains(DateTime)

Returns true if the specified date is contained within any of the date ranges.

public bool Contains(DateTime date)

Parameters

date DateTime

Returns

bool

GetEnumerator()

Returns an enumerator to iterate through the collection.

public IEnumerator<DateRange> GetEnumerator()

Returns

IEnumerator<DateRange>

Load(string)

Returns a DateRangeCollection from the specified xml file.

public static DateRangeCollection Load(string fileName)

Parameters

fileName string

Returns

DateRangeCollection

Exceptions

ArgumentNullException

Save(string)

Saves this DateRangeCollection to a xml file.

public void Save(string fileName)

Parameters

fileName string

ToBooleanSeries(ISeries)

Returns a boolean series with true for dates contained in this collection over the dates of the specified series.

public BooleanSeries ToBooleanSeries(ISeries series)

Parameters

series ISeries

Returns

BooleanSeries

ToBooleanSeries(bool)

Returns a boolean series with true for dates contained in this collection.

public BooleanSeries ToBooleanSeries(bool calendarDays = false)

Parameters

calendarDays bool

Returns

BooleanSeries

ToString()

Returns a string representation of this collection.

public override string ToString()

Returns

string