init
This commit is contained in:
28
MarketDataLib/Utility/DateRange.cs
Normal file
28
MarketDataLib/Utility/DateRange.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
|
||||
namespace MarketData.Utils
|
||||
{
|
||||
public class DateRange : List<DateTime>
|
||||
{
|
||||
public DateRange(DateTime startDate,DateTime endDate)
|
||||
{
|
||||
startDate = startDate.Date;
|
||||
endDate=endDate.Date;
|
||||
DateGenerator dateGenerator=new DateGenerator();
|
||||
List<DateTime> dates= dateGenerator.GenerateHistoricalDates(startDate, endDate);
|
||||
foreach (DateTime date in dates) Add(date);
|
||||
Sort(); // ensure that no matter how we set this up, the oldest date winds up being at the lowest index of the list
|
||||
}
|
||||
public DateTime StartDate
|
||||
{
|
||||
get { return this[0]; }
|
||||
}
|
||||
public DateTime EndDate
|
||||
{
|
||||
get { return this[Count-1]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user