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
FirstDate
Gets the first date in the collection of date ranges.
public DateTime FirstDate { get; }
Property Value
LastDate
Gets the last date in the collection of date ranges.
public DateTime LastDate { get; }
Property Value
USBearMarkets
Returns a selection of major US equity bear markets.
public static DateRangeCollection USBearMarkets { get; }
Property Value
USBullMarkets
Returns a selection of major US equity bull markets.
public static DateRangeCollection USBullMarkets { get; }
Property Value
Methods
Add(DateRange)
Adds the specified date range.
public void Add(DateRange range)
Parameters
range
DateRange
Exceptions
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
GetEnumerator()
Returns an enumerator to iterate through the collection.
public IEnumerator<DateRange> GetEnumerator()
Returns
Load(string)
Returns a DateRangeCollection from the specified xml file.
public static DateRangeCollection Load(string fileName)
Parameters
fileName
string
Returns
Exceptions
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
ToBooleanSeries(bool)
Returns a boolean series with true for dates contained in this collection.
public BooleanSeries ToBooleanSeries(bool calendarDays = false)
Parameters
calendarDays
bool
Returns
ToString()
Returns a string representation of this collection.
public override string ToString()