[Quantproject-developers] QuantProject/b4_Business/a3_Testing Tester.cs,1.1.1.1,1.2
Brought to you by:
glauco_1
|
From: <gla...@us...> - 2003-11-24 20:10:29
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a3_Testing
In directory sc8-pr-cvs1:/tmp/cvs-serv5618/b4_Business/a3_Testing
Modified Files:
Tester.cs
Log Message:
- Fixed the class namespace
- Now Tester inherits BackTester
- Now Account is inherited from BackTester
Index: Tester.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a3_Testing/Tester.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Tester.cs 13 Oct 2003 21:59:19 -0000 1.1.1.1
--- Tester.cs 24 Nov 2003 20:10:26 -0000 1.2
***************
*** 31,54 ****
! namespace QuantProject.Business.Financial.Testing
{
/// <summary>
/// Summary description for Tester.
/// </summary>
! public class Tester : Optimizable
{
private TestWindow testWindow;
private TradingSystems tradingSystems;
- private Account account = new Account( "test" );
private OrderManager orderManager = new OrderManager();
private double initialCash = 0.0;
//private TestResults testResults;
- public Account Account
- {
- get { return account; }
- set { account = value; }
- }
-
public OrderManager OrderManager
{
--- 31,47 ----
! namespace QuantProject.Business.Testing
{
/// <summary>
/// Summary description for Tester.
/// </summary>
! public class Tester : BackTester
{
private TestWindow testWindow;
private TradingSystems tradingSystems;
private OrderManager orderManager = new OrderManager();
private double initialCash = 0.0;
//private TestResults testResults;
public OrderManager OrderManager
{
***************
*** 62,66 ****
this.tradingSystems = tradingSystems;
this.initialCash = initialCash;
! this.account.AddCash( new ExtendedDateTime( testWindow.StartDateTime , BarComponent.Open ) ,
initialCash );
}
--- 55,59 ----
this.tradingSystems = tradingSystems;
this.initialCash = initialCash;
! this.Account.AddCash( new ExtendedDateTime( testWindow.StartDateTime , BarComponent.Open ) ,
initialCash );
}
***************
*** 68,76 ****
public override double Objective()
{
! this.account.Clear();
! account.AddCash( new ExtendedDateTime( testWindow.StartDateTime , BarComponent.Open ) ,
initialCash );
this.Test();
! return - account.GetProfitNetLoss(
new ExtendedDateTime( testWindow.EndDateTime , BarComponent.Close ) );
}
--- 61,69 ----
public override double Objective()
{
! this.Account.Clear();
! this.Account.AddCash( new ExtendedDateTime( testWindow.StartDateTime , BarComponent.Open ) ,
initialCash );
this.Test();
! return - this.Account.GetProfitNetLoss(
new ExtendedDateTime( testWindow.EndDateTime , BarComponent.Close ) );
}
***************
*** 88,96 ****
private void handleCurrentSignal( Signal signal )
{
! Orders orders = account.AccountStrategy.GetOrders( signal );
foreach (Order order in orders )
{
TimedTransaction transaction = this.OrderManager.GetTransaction( order );
! account.Add( transaction );
//Debug.WriteLine( account.ToString( dateTime ) );
}
--- 81,89 ----
private void handleCurrentSignal( Signal signal )
{
! Orders orders = this.Account.AccountStrategy.GetOrders( signal );
foreach (Order order in orders )
{
TimedTransaction transaction = this.OrderManager.GetTransaction( order );
! this.Account.Add( transaction );
//Debug.WriteLine( account.ToString( dateTime ) );
}
|