[Quantproject-developers] QuantProject/b4_Business/a2_Strategies EndOfDayStrategyBackTester.cs, 1.1
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2011-08-21 13:44:45
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies
In directory vz-cvs-3.sog:/tmp/cvs-serv17774
Modified Files:
EndOfDayStrategyBackTester.cs
Log Message:
The progress message in the log file has been improved (more info are logged: such as account value and positions in portfolio)
Index: EndOfDayStrategyBackTester.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/EndOfDayStrategyBackTester.cs,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** EndOfDayStrategyBackTester.cs 13 Feb 2011 15:27:16 -0000 1.18
--- EndOfDayStrategyBackTester.cs 21 Aug 2011 13:44:43 -0000 1.19
***************
*** 416,427 ****
#endregion stopTheScriptIfTheCase
private void notifyProgress(
Timer timer )
{
! string progressMessage = "Current out of sample date:" +
! this.timer.GetCurrentDateTime().ToString() + " - " +
! "First date:" + this.firstDateTime.ToString() + " - " +
! "Last date:" + this.lastDateTime.ToString() + " - " +
! "Real time:" + DateTime.Now;
NewMessageEventArgs newMessageEventArgs =
new NewMessageEventArgs( progressMessage );
--- 416,446 ----
#endregion stopTheScriptIfTheCase
+ private string notifyProgress_getPositions()
+ {
+ string returnValue = null;
+ foreach(Position pos in this.strategyForBacktester.Account.Portfolio.Positions)
+ returnValue += pos.Instrument.Key + "; ";
+ return returnValue;
+ }
+
private void notifyProgress(
Timer timer )
{
! string progressMessage;
! try
! {
! progressMessage = "Curr. out of s. date:" +
! this.timer.GetCurrentDateTime().ToString() + " - " +
! "Acc.Value: " + this.strategyForBacktester.Account.GetMarketValue().ToString() + " - " +
! "positions: " + this.notifyProgress_getPositions() + " - " +
! "First date:" + this.firstDateTime.ToString() + " - " +
! "Last date:" + this.lastDateTime.ToString() + " - " +
! "Real time:" + DateTime.Now;
! }
! catch(Exception ex)
! {
! progressMessage = "Error occured during building progressMessage: " +
! ex.Message;
! }
NewMessageEventArgs newMessageEventArgs =
new NewMessageEventArgs( progressMessage );
|