Update of /cvsroot/quantproject/QuantProject/b4_Business/a05_Timing
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv588/b4_Business/a05_Timing
Modified Files:
IndexBasedEndOfDayTimer.cs
Log Message:
Added new constructor for the IndexBasedEndOfDayTimer
Index: IndexBasedEndOfDayTimer.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a05_Timing/IndexBasedEndOfDayTimer.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** IndexBasedEndOfDayTimer.cs 30 Apr 2006 14:51:15 -0000 1.7
--- IndexBasedEndOfDayTimer.cs 14 May 2006 18:23:38 -0000 1.8
***************
*** 54,76 ****
}
public IndexBasedEndOfDayTimer( EndOfDayDateTime startDateTime,
string marketIndex): base(startDateTime)
{
! this.marketIndex = marketIndex;
! this.indexQuotes = new Quotes(marketIndex,startDateTime.DateTime,DateTime.Now);
! if ( this.indexQuotes.Rows.Count == 0 )
! {
! string errorMessage = "IndexBasedEndOfDayTimer error: the given " +
! "index (" + marketIndex + ") has no quotes in the interval.";
! throw new Exception( errorMessage );
! }
! this.StartDateTime =
! new EndOfDayDateTime(this.indexQuotes.GetQuoteDateOrFollowing(this.StartDateTime.DateTime),
! EndOfDaySpecificTime.MarketOpen);
! this.tickers = new Hashtable();
! this.currentDateArrayPosition = 0;
}
!
! /// <summary>
/// Starts the time walking simulation, based on index's dates
/// </summary>
--- 54,90 ----
}
+ private void indexBasedEndOfDayTimer( EndOfDayDateTime startDateTime,
+ string marketIndex)
+ {
+ this.marketIndex = marketIndex;
+ if ( this.indexQuotes.Rows.Count == 0 )
+ {
+ string errorMessage = "IndexBasedEndOfDayTimer error: the given " +
+ "index (" + marketIndex + ") has no quotes in the interval.";
+ throw new Exception( errorMessage );
+ }
+ this.StartDateTime =
+ new EndOfDayDateTime(this.indexQuotes.GetQuoteDateOrFollowing(this.StartDateTime.DateTime),
+ EndOfDaySpecificTime.MarketOpen);
+ this.tickers = new Hashtable();
+ this.currentDateArrayPosition = 0;
+ }
+
public IndexBasedEndOfDayTimer( EndOfDayDateTime startDateTime,
string marketIndex): base(startDateTime)
{
! this.indexQuotes = new Quotes(marketIndex,startDateTime.DateTime,DateTime.Now);
! this.indexBasedEndOfDayTimer(startDateTime, marketIndex);
}
!
! public IndexBasedEndOfDayTimer( EndOfDayDateTime startDateTime,
! EndOfDayDateTime endDateTime,
! string marketIndex): base(startDateTime)
! {
! this.indexQuotes = new Quotes(marketIndex,startDateTime.DateTime,endDateTime.DateTime.AddDays(10));
! this.indexBasedEndOfDayTimer(startDateTime, marketIndex);
! }
!
! /// <summary>
/// Starts the time walking simulation, based on index's dates
/// </summary>
|