quantproject-developers Mailing List for QuantProject (Page 149)
Brought to you by:
glauco_1
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(103) |
Dec
(67) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(52) |
Feb
(9) |
Mar
(69) |
Apr
(53) |
May
(80) |
Jun
(23) |
Jul
(24) |
Aug
(112) |
Sep
(9) |
Oct
|
Nov
(58) |
Dec
(93) |
| 2005 |
Jan
(90) |
Feb
(93) |
Mar
(61) |
Apr
(56) |
May
(37) |
Jun
(61) |
Jul
(55) |
Aug
(68) |
Sep
(25) |
Oct
(46) |
Nov
(41) |
Dec
(37) |
| 2006 |
Jan
(33) |
Feb
(7) |
Mar
(19) |
Apr
(27) |
May
(73) |
Jun
(49) |
Jul
(83) |
Aug
(66) |
Sep
(45) |
Oct
(16) |
Nov
(15) |
Dec
(7) |
| 2007 |
Jan
(14) |
Feb
(33) |
Mar
|
Apr
(21) |
May
|
Jun
(34) |
Jul
(18) |
Aug
(100) |
Sep
(39) |
Oct
(55) |
Nov
(12) |
Dec
(2) |
| 2008 |
Jan
(120) |
Feb
(133) |
Mar
(129) |
Apr
(104) |
May
(42) |
Jun
(2) |
Jul
(52) |
Aug
(99) |
Sep
(134) |
Oct
|
Nov
(137) |
Dec
(48) |
| 2009 |
Jan
(48) |
Feb
(55) |
Mar
(61) |
Apr
(3) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(51) |
Sep
|
Oct
(7) |
Nov
|
Dec
|
| 2010 |
Jan
(7) |
Feb
(1) |
Mar
(145) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
|
| 2011 |
Jan
(78) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(88) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <gla...@us...> - 2003-11-28 15:37:17
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting
In directory sc8-pr-cvs1:/tmp/cvs-serv2874/b4_Business/a1_Financial/a2_Accounting/h5_Reporting
Modified Files:
AccountReport.cs
Log Message:
Summary type has been fixed: now it is of type
Tables.Summary (it was a general ReportTable).
Index: AccountReport.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/AccountReport.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** AccountReport.cs 8 Nov 2003 20:54:41 -0000 1.6
--- AccountReport.cs 28 Nov 2003 15:37:13 -0000 1.7
***************
*** 47,51 ****
private ReportTable roundTrades;
private ReportTable equity;
! private ReportTable summary;
public string Name
--- 47,51 ----
private ReportTable roundTrades;
private ReportTable equity;
! private Tables.Summary summary;
public string Name
***************
*** 81,85 ****
get { return equity; }
}
! public ReportTable Summary
{
get { return summary; }
--- 81,85 ----
get { return equity; }
}
! public Tables.Summary Summary
{
get { return summary; }
|
|
From: <gla...@us...> - 2003-11-28 15:32:13
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting
In directory sc8-pr-cvs1:/tmp/cvs-serv2113/b4_Business/a1_Financial/a2_Accounting
Modified Files:
Account.cs
Log Message:
I've used better local variable names
Index: Account.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/Account.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Account.cs 24 Nov 2003 19:43:31 -0000 1.3
--- Account.cs 28 Nov 2003 15:32:10 -0000 1.4
***************
*** 180,194 ****
public AccountReport CreateReport( string reportName ,
! int numDaysForInterval , ExtendedDateTime extendedDateTime )
{
AccountReport accountReport = new AccountReport( this );
! return accountReport.Create( reportName , numDaysForInterval , extendedDateTime );
}
public AccountReport CreateReport( string reportName ,
! int numDaysForInterval , ExtendedDateTime extendedDateTime , string buyAndHoldTicker )
{
AccountReport accountReport = new AccountReport( this );
return accountReport.Create( reportName , numDaysForInterval ,
! extendedDateTime , buyAndHoldTicker );
}
public void Serialize( string filePathAndName )
--- 180,194 ----
public AccountReport CreateReport( string reportName ,
! int numDaysForInterval , ExtendedDateTime endDateTime )
{
AccountReport accountReport = new AccountReport( this );
! return accountReport.Create( reportName , numDaysForInterval , endDateTime );
}
public AccountReport CreateReport( string reportName ,
! int numDaysForInterval , ExtendedDateTime endDateTime , string buyAndHoldTicker )
{
AccountReport accountReport = new AccountReport( this );
return accountReport.Create( reportName , numDaysForInterval ,
! endDateTime , buyAndHoldTicker );
}
public void Serialize( string filePathAndName )
|
|
From: <gla...@us...> - 2003-11-28 15:17:39
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject In directory sc8-pr-cvs1:/tmp/cvs-serv32162 Removed Files: Form1.cs Log Message: It was useless --- Form1.cs DELETED --- |
|
From: <gla...@us...> - 2003-11-28 14:17:33
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject In directory sc8-pr-cvs1:/tmp/cvs-serv20337 Removed Files: BackTestForm.cs Log Message: It was useless --- BackTestForm.cs DELETED --- |
|
From: <gla...@us...> - 2003-11-25 16:18:29
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a3_Testing
In directory sc8-pr-cvs1:/tmp/cvs-serv26203/b4_Business/a3_Testing
Added Files:
BackTester.cs
Log Message:
Base class for back testers
--- NEW FILE: BackTester.cs ---
using System;
using QuantProject.ADT.Optimizing;
using QuantProject.ADT;
using QuantProject.Business.Financial.Accounting;
namespace QuantProject.Business.Testing
{
/// <summary>
/// Summary description for BackTester.
/// </summary>
public class BackTester : Optimizable
{
private Account account = new Account();
public Account Account
{
get { return account; }
set { account = value; }
}
public BackTester()
{
//
// TODO: Add constructor logic here
//
}
public override double Objective()
{
return 0;
}
}
}
|
|
From: <gla...@us...> - 2003-11-25 16:03:19
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1:/tmp/cvs-serv22477 Modified Files: QuantProject.suo Log Message: no message Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 Binary files /tmp/cvsehIpPf and /tmp/cvsc59dcl differ |
|
From: <mi...@us...> - 2003-11-25 14:52:19
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader
In directory sc8-pr-cvs1:/tmp/cvs-serv8511/Downloader
Modified Files:
WebDownloader.cs
Log Message:
the call to downloadQuotes_deleteFrom_quotes() method is now useless
Index: WebDownloader.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/WebDownloader.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** WebDownloader.cs 20 Nov 2003 22:38:48 -0000 1.2
--- WebDownloader.cs 25 Nov 2003 14:52:16 -0000 1.3
***************
*** 351,355 ****
{
DataSet ds=new DataSet();
! downloadQuotes_deleteFrom_quotes();
downloadQuotes_createTickerDataSet( ds );
//this.OleDbConnection1.Open();
--- 351,355 ----
{
DataSet ds=new DataSet();
! //downloadQuotes_deleteFrom_quotes() - csv files aren't used anymore;
downloadQuotes_createTickerDataSet( ds );
//this.OleDbConnection1.Open();
|
|
From: <gla...@us...> - 2003-11-24 20:16:54
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a3_Testing
In directory sc8-pr-cvs1:/tmp/cvs-serv6930/b4_Business/a3_Testing
Modified Files:
WalkForwardTester.cs
Log Message:
- Fixed the class namespace
- Now WalkForwardTester inherits BackTester
- Now a single Account is considered and it is inherited from BackTester
- Now the Parameters object is inherited from BackTester (that inherits them from Optimizable)
- The final ReportToConsole method call has been commented out
Index: WalkForwardTester.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a3_Testing/WalkForwardTester.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** WalkForwardTester.cs 13 Oct 2003 21:59:28 -0000 1.1.1.1
--- WalkForwardTester.cs 24 Nov 2003 20:16:51 -0000 1.2
***************
*** 31,40 ****
using QuantProject.Business.Strategies;
! namespace QuantProject.Business.Financial.Testing
{
/// <summary>
/// Summary description for WalkForwardTester.
/// </summary>
! public class WalkForwardTester
{
private DateTime startDateTime;
--- 31,40 ----
using QuantProject.Business.Strategies;
! namespace QuantProject.Business.Testing
{
/// <summary>
/// Summary description for WalkForwardTester.
/// </summary>
! public class WalkForwardTester : BackTester
{
private DateTime startDateTime;
***************
*** 43,47 ****
private int outOfSampleWindowNumDays;
private TradingSystems tradingSystems = new TradingSystems();
- private Accounts accounts = new Accounts();
private TestWindows testWindows;
--- 43,46 ----
***************
*** 91,96 ****
}
- public Parameters Parameters = new Parameters();
-
public WalkForwardTester()
{
--- 90,93 ----
***************
*** 102,120 ****
}
- public void Add( Account account )
- {
- accounts.AddAccount( account );
- }
-
- public Account GetAccount( String accountName )
- {
- return accounts.GetAccount( accountName );
- }
-
#region "Test"
private Parameters getOptimizedParameters( TestWindow testWindow )
{
! Tester tester = new Tester( testWindow , this.tradingSystems , this.GetAccount( "account" ).CashAmount );
tester.Parameters = this.Parameters.Copy();
tester.Optimize();
--- 99,108 ----
}
#region "Test"
private Parameters getOptimizedParameters( TestWindow testWindow )
{
! Tester tester = new Tester( testWindow , this.tradingSystems ,
! this.Account.CashAmount );
tester.Parameters = this.Parameters.Copy();
tester.Optimize();
***************
*** 124,129 ****
private void testNextStepOutOfSample( Parameters parameters , TestWindow testWindow )
{
! Tester tester = new Tester( testWindow , this.tradingSystems , accounts.GetAccount( "account" ).CashAmount );
! tester.Account = this.GetAccount( "account" );
tester.Parameters = parameters;
tester.Test();
--- 112,117 ----
private void testNextStepOutOfSample( Parameters parameters , TestWindow testWindow )
{
! Tester tester = new Tester( testWindow , this.tradingSystems , this.Account.CashAmount );
! tester.Account = this.Account;
tester.Parameters = parameters;
tester.Test();
***************
*** 147,153 ****
{
testNextStep();
lastDateTime = testWindows.OutOfSampleWindow.EndDateTime;
}
! this.accounts.ReportToConsole( lastDateTime );
//this.accounts.Serialize( "c:\\quantProject.xml" );
}
--- 135,142 ----
{
testNextStep();
+ Console.WriteLine( lastDateTime.ToString() );
lastDateTime = testWindows.OutOfSampleWindow.EndDateTime;
}
! // this.accounts.ReportToConsole( lastDateTime );
//this.accounts.Serialize( "c:\\quantProject.xml" );
}
|
|
From: <gla...@us...> - 2003-11-24 20:12:00
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a3_Testing
In directory sc8-pr-cvs1:/tmp/cvs-serv5945/b4_Business/a3_Testing
Modified Files:
TestWindows.cs
Log Message:
- Fixed the class namespace
Index: TestWindows.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a3_Testing/TestWindows.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** TestWindows.cs 13 Oct 2003 21:59:23 -0000 1.1.1.1
--- TestWindows.cs 24 Nov 2003 20:11:58 -0000 1.2
***************
*** 23,27 ****
using System;
! namespace QuantProject.Business.Financial.Testing
{
/// <summary>
--- 23,27 ----
using System;
! namespace QuantProject.Business.Testing
{
/// <summary>
|
|
From: <gla...@us...> - 2003-11-24 20:11:08
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a3_Testing
In directory sc8-pr-cvs1:/tmp/cvs-serv5738/b4_Business/a3_Testing
Modified Files:
TestWindow.cs
Log Message:
- Fixed the class namespace
Index: TestWindow.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a3_Testing/TestWindow.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** TestWindow.cs 13 Oct 2003 21:59:21 -0000 1.1.1.1
--- TestWindow.cs 24 Nov 2003 20:11:05 -0000 1.2
***************
*** 23,27 ****
using System;
! namespace QuantProject.Business.Financial.Testing
{
/// <summary>
--- 23,27 ----
using System;
! namespace QuantProject.Business.Testing
{
/// <summary>
|
|
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 ) );
}
|
|
From: <gla...@us...> - 2003-11-24 20:07:46
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables
In directory sc8-pr-cvs1:/tmp/cvs-serv5173/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables
Modified Files:
Summary.cs
Log Message:
Added control to avoid raised exception
for summaryRow.Value == null
Index: Summary.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables/Summary.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Summary.cs 16 Nov 2003 17:18:45 -0000 1.5
--- Summary.cs 24 Nov 2003 20:07:43 -0000 1.6
***************
*** 128,135 ****
private void getSummary_setRow( SummaryRow summaryRow , DataTable summaryDataTable )
{
! DataRow summary = summaryDataTable.NewRow();
! summary[ "Information" ] = summaryRow.Description;
! summary[ "Value" ] = summaryRow.Value;
! summaryDataTable.Rows.Add( summary );
}
private void getSummaryTable_setRows( DataTable summaryDataTable )
--- 128,138 ----
private void getSummary_setRow( SummaryRow summaryRow , DataTable summaryDataTable )
{
! if ( summaryRow.Value != null )
! {
! DataRow summary = summaryDataTable.NewRow();
! summary[ "Information" ] = summaryRow.Description;
! summary[ "Value" ] = summaryRow.Value;
! summaryDataTable.Rows.Add( summary );
! }
}
private void getSummaryTable_setRows( DataTable summaryDataTable )
|
|
From: <gla...@us...> - 2003-11-24 20:05:25
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1:/tmp/cvs-serv4865 Modified Files: QuantProject.suo Log Message: no message Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 Binary files /tmp/cvsMi4vHE and /tmp/cvsi0Hvkb differ |
|
From: <gla...@us...> - 2003-11-24 20:05:06
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject
In directory sc8-pr-cvs1:/tmp/cvs-serv4770/b91_QuantProject
Modified Files:
Main.cs
Log Message:
- Some commented code has been cleaned up
- New scripts invoking (commented) lines have been added
Index: Main.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b91_QuantProject/Main.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Main.cs 13 Oct 2003 22:01:58 -0000 1.1.1.1
--- Main.cs 24 Nov 2003 20:05:03 -0000 1.2
***************
*** 228,237 ****
//try
{
- //Application.Run(new Principale()); //remove comment to come back to the Windows application
new RunMSFTsimpleTest().Run();
! // string pippo =
! // ((string)Application.CommonAppDataPath).Substring(0, Application.CommonAppDataPath.LastIndexOf('\\'));
! //
! // MessageBox.Show( Application.LocalUserAppDataPath );
}
//catch ( Exception ex )
--- 228,234 ----
//try
{
new RunMSFTsimpleTest().Run();
! //new RunOneRank().Run();
! //new RunMSFTwalkForward().Run();
}
//catch ( Exception ex )
|
|
From: <gla...@us...> - 2003-11-24 20:03:27
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject
In directory sc8-pr-cvs1:/tmp/cvs-serv4278/b91_QuantProject
Modified Files:
BackTestForm.cs
Log Message:
Some fixing have been applied for compiling
pass through, but this class is not
used anymore.
Index: BackTestForm.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b91_QuantProject/BackTestForm.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** BackTestForm.cs 13 Oct 2003 22:00:26 -0000 1.1.1.1
--- BackTestForm.cs 24 Nov 2003 20:03:23 -0000 1.2
***************
*** 29,33 ****
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Accounting;
! using QuantProject.Business.Financial.Testing;
using QuantProject.Scripts;
--- 29,33 ----
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Accounting;
! using QuantProject.Business.Testing;
using QuantProject.Scripts;
***************
*** 115,122 ****
tradingSystem.Parameters.Add( new Parameter( "CrossPercentage" , 0 , 5 , 1 ) );
- Account account = new Account( "account" );
- account.AddCash(
- new ExtendedDateTime( new DateTime( 1995 , 1 , 1 ) , BarComponent.Open ) , 10000 );
-
WalkForwardTester walkForwardTester = new WalkForwardTester();
walkForwardTester.StartDateTime = new DateTime( 1995 , 1 , 1 );
--- 115,118 ----
***************
*** 125,131 ****
walkForwardTester.OutOfSampleWindowNumDays = 30;
walkForwardTester.Add( tradingSystem );
! walkForwardTester.Add( account );
walkForwardTester.Test();
! walkForwardTester.GetAccount( "account" ).DrawReport();
}
}
--- 121,128 ----
walkForwardTester.OutOfSampleWindowNumDays = 30;
walkForwardTester.Add( tradingSystem );
! walkForwardTester.Account.AddCash(
! new ExtendedDateTime( new DateTime( 1995 , 1 , 1 ) , BarComponent.Open ) , 10000 );
walkForwardTester.Test();
! walkForwardTester.Account.DrawReport();
}
}
|
|
From: <gla...@us...> - 2003-11-24 20:01:46
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv4001
Modified Files:
b7_Scripts.csproj
Log Message:
- The script Funds has been removed.
- The script Profunds has been removed.
- The folder SimpleTesting has been added.
- The script MSFTsimpleTest has been moved under the folder SimpleTesting
- The script One Rank has been created under the folder SimpleTesting
- The folder WalkForwardTesting has been added
- The script MSFTwalkForward has been moved under the folder WalkForwardTesting
Index: b7_Scripts.csproj
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/b7_Scripts.csproj,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** b7_Scripts.csproj 27 Oct 2003 19:12:24 -0000 1.4
--- b7_Scripts.csproj 24 Nov 2003 20:01:43 -0000 1.5
***************
*** 103,142 ****
/>
<File
! RelPath = "Funds\AsFunds.cs"
! SubType = "Code"
! BuildAction = "Compile"
! />
! <File
! RelPath = "Funds\RunFunds.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "Funds\TsFunds.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "MSFTsimpleTest\RunMSFTsimpleTest.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "MSFTsimpleTest\TsMSFTsimpleTest.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "Profunds\AsProfunds.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "Profunds\RunProfunds.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "Profunds\TsProfunds.cs"
SubType = "Code"
BuildAction = "Compile"
--- 103,137 ----
/>
<File
! RelPath = "SimpleTesting\MSFTsimpleTest\RunMSFTsimpleTest.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "SimpleTesting\MSFTsimpleTest\TsMSFTsimpleTest.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "SimpleTesting\OneRank\AsOneRank.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "SimpleTesting\OneRank\RunOneRank.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "SimpleTesting\OneRank\TsOneRank.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "WalkForwardTesting\MSFTwalkForward\RunMSFTwalkForward.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "WalkForwardTesting\MSFTwalkForward\TsMSFTwalkForward.cs"
SubType = "Code"
BuildAction = "Compile"
|
|
From: <gla...@us...> - 2003-11-24 19:51:39
|
Update of /cvsroot/quantproject/QuantProject/b4_Business
In directory sc8-pr-cvs1:/tmp/cvs-serv2116/b4_Business
Modified Files:
b4_Business.csproj
Log Message:
- Added the BackTester class.
- Tester and WalkForwardTester inherit such new class.
Index: b4_Business.csproj
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** b4_Business.csproj 16 Nov 2003 17:18:45 -0000 1.6
--- b4_Business.csproj 24 Nov 2003 19:51:35 -0000 1.7
***************
*** 347,350 ****
--- 347,355 ----
/>
<File
+ RelPath = "a3_Testing\BackTester.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "a3_Testing\Tester.cs"
SubType = "Code"
|
|
From: <gla...@us...> - 2003-11-24 19:43:35
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting
In directory sc8-pr-cvs1:/tmp/cvs-serv32358/b4_Business/a1_Financial/a2_Accounting
Modified Files:
Account.cs
Log Message:
Some commented code has been cleaned up.
Index: Account.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/Account.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Account.cs 2 Nov 2003 18:29:47 -0000 1.2
--- Account.cs 24 Nov 2003 19:43:31 -0000 1.3
***************
*** 71,77 ****
public Account( string accountName ) : base ( accountName )
{
cashAmount = 0;
accountStrategy = new AccountStrategy( this );
! // accountReport = new AccountReport( this );
}
--- 71,86 ----
public Account( string accountName ) : base ( accountName )
{
+ this.initialize();
+ }
+
+ private void initialize()
+ {
cashAmount = 0;
accountStrategy = new AccountStrategy( this );
! }
!
! public Account() : base ( "account" )
! {
! this.initialize();
}
|
|
From: <gla...@us...> - 2003-11-24 19:38:13
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/MSFTwalkForward
In directory sc8-pr-cvs1:/tmp/cvs-serv31021
Added Files:
RunMSFTwalkForward.cs TsMSFTwalkForward.cs
Log Message:
The MSFTwalkForward strategy has
been moved under the WalkForwardTesting folder.
--- NEW FILE: RunMSFTwalkForward.cs ---
/*
QuantProject - Quantitative Finance Library
RunMSFTsimpleTest.cs
Copyright (C) 2003
Glauco Siliprandi
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using QuantProject.ADT;
using QuantProject.ADT.Histories;
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Accounting;
using QuantProject.Business.Financial.Accounting.Reporting;
using QuantProject.Business.Financial.Instruments;
using QuantProject.Business.Scripting;
using QuantProject.Business.Strategies;
using QuantProject.Business.Testing;
using QuantProject.Presentation.MicrosoftExcel;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for runMSFTsimpleTest.
/// </summary>
public class RunMSFTwalkForward : Script
{
public RunMSFTwalkForward()
{
//
// TODO: Add constructor logic here
//
}
public override void Run()
{
DateTime startDateTime = new DateTime( 1995 , 1 , 1 );
DateTime endDateTime = new DateTime( 2003 , 9 , 1 );
QuoteCache.Add( new Instrument( "MSFT" ) , BarComponent.Open );
QuoteCache.Add( new Instrument( "MSFT" ) , BarComponent.Close );
QuoteCache.SetCache( startDateTime , endDateTime );
WalkForwardTester walkForwardTester = new WalkForwardTester();
walkForwardTester.StartDateTime = startDateTime;
walkForwardTester.EndDateTime = endDateTime;
walkForwardTester.InSampleWindowNumDays = 300;
walkForwardTester.OutOfSampleWindowNumDays = 60;
walkForwardTester.Parameters.Add( new Parameter( "SMAdays" , 3 , 50 , 2 ) );
walkForwardTester.Add( new TsMSFTsimpleTest() );
walkForwardTester.Account.AddCash(
new ExtendedDateTime( startDateTime , BarComponent.Open ) , 10000 );
walkForwardTester.Test();
AccountReport accountReport = walkForwardTester.Account.CreateReport( "MSFT" , 7 ,
new ExtendedDateTime( endDateTime , BarComponent.Close ) , "MSFT" );
ExcelManager.Add( accountReport );
ExcelManager.ShowReport();
}
}
}
--- NEW FILE: TsMSFTwalkForward.cs ---
/*
QuantProject - Quantitative Finance Library
TsMSFTsimpleTest.cs
Copyright (C) 2003
Glauco Siliprandi
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections;
using QuantProject.ADT;
using QuantProject.ADT.Histories;
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Instruments;
using QuantProject.Business.Financial.Ordering;
using QuantProject.Business.Strategies;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for tsMSFTsimpleTest.
/// </summary>
public class TsMSFTwalkForward : TradingSystem
{
public TsMSFTwalkForward()
{
//
// TODO: Add constructor logic here
//
}
private History microsoftCloseHistory;
private History microsoftCloseHistorySMA;
public override void InitializeData()
{
Parameter parameter = (Parameter) this.Parameters[ "SMAdays" ];
microsoftCloseHistory = QuoteCache.GetCloseHistory( "MSFT" );
microsoftCloseHistorySMA = microsoftCloseHistory.GetSimpleMovingAverage( (int) parameter.Value );
}
public override Signals GetSignals( ExtendedDateTime extendedDateTime )
{
Signals signals = new Signals();
if ( extendedDateTime.BarComponent == BarComponent.Close )
{
Signal signal = new Signal();
if ( microsoftCloseHistory.Cross( microsoftCloseHistorySMA ,
extendedDateTime.DateTime ) )
{
signal.Add( new Order( OrderType.MarketBuy , new Instrument( "MSFT" ) , 1 ,
new ExtendedDateTime( new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
BarComponent.Open ) ) );
signals.Add( signal );
}
else
{
if ( microsoftCloseHistorySMA.Cross( microsoftCloseHistory ,
extendedDateTime.DateTime ) )
{
signal.Add( new Order( OrderType.MarketSell , new Instrument( "MSFT" ) , 1 ,
new ExtendedDateTime(
new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
BarComponent.Open ) ) );
signals.Add( signal );
}
}
}
return signals;
}
}
}
|
|
From: <gla...@us...> - 2003-11-24 19:37:03
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/MSFTwalkForward In directory sc8-pr-cvs1:/tmp/cvs-serv30662/MSFTwalkForward Log Message: Directory /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/MSFTwalkForward added to the repository |
|
From: <gla...@us...> - 2003-11-24 19:36:44
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting In directory sc8-pr-cvs1:/tmp/cvs-serv30602/WalkForwardTesting Log Message: Directory /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting added to the repository |
|
From: <gla...@us...> - 2003-11-24 19:36:27
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/OneRank
In directory sc8-pr-cvs1:/tmp/cvs-serv30545
Added Files:
AsOneRank.cs RunOneRank.cs TsOneRank.cs
Log Message:
This script implements the One Rank strategy.
--- NEW FILE: AsOneRank.cs ---
/*
QuantProject - Quantitative Finance Library
AsProfunds.cs
Copyright (C) 2003
Glauco Siliprandi
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections;
using QuantProject.ADT;
using QuantProject.Business.Financial.Ordering;
using QuantProject.Business.Financial.Accounting;
using QuantProject.Business.Strategies;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for AsProfunds.
/// </summary>
public class AsOneRank : AccountStrategy
{
public AsOneRank( Account account ) : base( account )
{
//
// TODO: Add constructor logic here
//
}
public override ArrayList GetOrdersForCurrentVirtualOrder( Order virtualOrder )
{
ArrayList orders = new ArrayList();
switch(virtualOrder.Type)
{
case OrderType.MarketBuy:
if ( !this.account.Portfolio.IsLong( virtualOrder.Instrument ) )
orders.Add( new Order( OrderType.MarketBuy ,
virtualOrder.Instrument ,
virtualOrder.Instrument.GetMaxBuyableQuantity(
this.account.CashAmount +
this.account.Portfolio.GetMarketValue( virtualOrder.ExtendedDateTime ) ,
virtualOrder.ExtendedDateTime ) , virtualOrder.ExtendedDateTime ) );
break;
case OrderType.MarketSell:
if ( this.account.Portfolio.IsLong( virtualOrder.Instrument ) )
orders.Add( new Order( OrderType.MarketSell ,
virtualOrder.Instrument ,
(long) this.account.Portfolio.GetPosition( virtualOrder.Instrument ).Quantity ,
virtualOrder.ExtendedDateTime ) );
break;
default:
break;
}
return orders;
}
}
}
--- NEW FILE: RunOneRank.cs ---
/*
QuantProject - Quantitative Finance Library
RunProfunds.cs
Copyright (C) 2003
Glauco Siliprandi
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using QuantProject.ADT;
using QuantProject.ADT.Histories;
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Accounting;
using QuantProject.Business.Financial.Accounting.Reporting;
using QuantProject.Business.Financial.Instruments;
using QuantProject.Business.Testing;
using QuantProject.Business.Strategies;
using QuantProject.Business.Scripting;
using QuantProject.Presentation.MicrosoftExcel;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for RunProfunds.
/// </summary>
public class RunOneRank : Script
{
public RunOneRank()
{
}
public override void Run()
{
//this.testTicker( "FSELX" , new DateTime( 2003 , 5 , 20 ) , new DateTime( 2003 , 9 , 26 ) );
this.testTicker( "REPIX" , new DateTime( 2003 , 7 , 1 ) , new DateTime( 2003 , 11 , 20 ) );
}
private void testTicker( string ticker , DateTime startDateTime , DateTime endDateTime )
{
QuoteCache.Add( new Instrument( ticker ) , BarComponent.Open );
QuoteCache.Add( new Instrument( ticker ) , BarComponent.Close );
//QuoteCache.Add( new Instrument( "MSFT" ) , BarComponent.Close );
QuoteCache.SetCache( startDateTime , endDateTime );
TradingSystems tradingSystems = new TradingSystems();
tradingSystems.Add( new TsOneRank( ticker ) );
Tester tester = new Tester(
new TestWindow( startDateTime , endDateTime ) ,
tradingSystems ,
10000 );
tester.Account.AccountStrategy = new AsOneRank( tester.Account );
//tester.Parameters.Add( new Parameter( "SMAdays" , 10 , 10 , 2 ) );
//tester.Optimize();
tester.Test();
//tester.Account.ReportToConsole( endDateTime );
((History)tester.Account.GetProfitNetLossHistory(
new ExtendedDateTime( endDateTime , BarComponent.Close ) ) ).ReportToConsole();
// tester.Account.AccountReport.ReportToExcel( "MSFT" ,
// new ExtendedDateTime( endDateTime , BarComponent.Close ) );
AccountReport accountReport = tester.Account.CreateReport( ticker , 7 ,
new ExtendedDateTime( endDateTime , BarComponent.Close ) , ticker );
ExcelManager.Add( accountReport );
ExcelManager.ShowReport();
}
}
}
--- NEW FILE: TsOneRank.cs ---
/*
QuantProject - Quantitative Finance Library
TsProfunds.cs
Copyright (C) 2003
Glauco Siliprandi
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections;
using QuantProject.ADT;
using QuantProject.ADT.Histories;
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Instruments;
using QuantProject.Business.Financial.Ordering;
using QuantProject.Business.Strategies;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for TsProfunds.
/// </summary>
public class TsOneRank : TradingSystem
{
private string ticker;
public TsOneRank( string ticker )
{
this.ticker = ticker;
}
private History fund;
// private History microsoftCloseHistorySMA;
public override void InitializeData()
{
fund = QuoteCache.GetOpenHistory( this.ticker );
// microsoftCloseHistorySMA = microsoftCloseHistory.GetSimpleMovingAverage( (int) parameter.Value );
}
public override Signals GetSignals( ExtendedDateTime extendedDateTime )
{
Signals signals = new Signals();
if ( !fund.IsLastKey( extendedDateTime.DateTime ) &&
( extendedDateTime.BarComponent == BarComponent.Close ) )
{
DateTime previousMarketDay = (DateTime)((History)fund).GetKey(
((History)fund).IndexOfKeyOrPrevious( extendedDateTime.DateTime ) );
DateTime nextMarketDay =
new Instrument( this.ticker ).GetNextMarketDay( extendedDateTime.DateTime );
Signal signal = new Signal();
if ( (Single)fund[ nextMarketDay ] > (Single)fund[ previousMarketDay ] )
{
signal.Add( new Order( OrderType.MarketBuy , new Instrument( this.ticker ) , 1 ,
new ExtendedDateTime( nextMarketDay , BarComponent.Open ) ) );
signals.Add( signal );
}
if ( (Single)fund[ nextMarketDay ] < (Single)fund[ previousMarketDay ] )
{
signal.Add( new Order( OrderType.MarketSell , new Instrument( this.ticker ) , 1 ,
new ExtendedDateTime( nextMarketDay , BarComponent.Open ) ) );
signals.Add( signal );
}
}
return signals;
}
}
}
|
|
From: <gla...@us...> - 2003-11-24 19:35:33
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTsimpleTest
In directory sc8-pr-cvs1:/tmp/cvs-serv30362
Added Files:
AsMSFTsimpleTest.cs RunMSFTsimpleTest.cs TsMSFTsimpleTest.cs
Log Message:
This MSFTsimpleTest script has been
moved under the SimpleTesting folder.
--- NEW FILE: AsMSFTsimpleTest.cs ---
using System;
using QuantProject.Business.Financial.Accounting;
using QuantProject.Business.Strategies;
namespace QuantProject.Scripts.MSFTsimpleTest
{
/// <summary>
/// Summary description for AsMSFTsimpleTest.
/// </summary>
public class AsMSFTsimpleTest : AccountStrategy
{
public AsMSFTsimpleTest( Account account )
{
//
// TODO: Add constructor logic here
//
}
// public virtual Orders GetOrders( Signal signal )
// {
// Orders orders = new Orders();
// foreach ( Order virtualOrder in signal )
// {
// ArrayList ordersForCurrentVirtualOrder =
// this.getOrdersForCurrentVirtualOrder( virtualOrder , dateTime );
// foreach( Order order in ordersForCurrentVirtualOrder )
// orders.Add( order );
// }
// return orders;
// }
}
}
--- NEW FILE: RunMSFTsimpleTest.cs ---
/*
QuantProject - Quantitative Finance Library
RunMSFTsimpleTest.cs
Copyright (C) 2003
Glauco Siliprandi
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using QuantProject.ADT;
using QuantProject.ADT.Histories;
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Accounting;
using QuantProject.Business.Financial.Accounting.Reporting;
using QuantProject.Business.Financial.Instruments;
using QuantProject.Business.Testing;
using QuantProject.Business.Strategies;
using QuantProject.Business.Scripting;
using QuantProject.Presentation.MicrosoftExcel;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for runMSFTsimpleTest.
/// </summary>
public class RunMSFTsimpleTest : Script
{
public RunMSFTsimpleTest()
{
//
// TODO: Add constructor logic here
//
}
public override void Run()
{
DateTime startDateTime = new DateTime( 2000 , 1 , 1 );
DateTime endDateTime = new DateTime( 2000 , 12 , 31 );
QuoteCache.Add( new Instrument( "MSFT" ) , BarComponent.Open );
QuoteCache.Add( new Instrument( "MSFT" ) , BarComponent.Close );
QuoteCache.SetCache( startDateTime , endDateTime );
TradingSystems tradingSystems = new TradingSystems();
tradingSystems.Add( new TsMSFTsimpleTest() );
Tester tester = new Tester(
new TestWindow( startDateTime , endDateTime ) ,
tradingSystems ,
10000 );
tester.Parameters.Add( new Parameter( "SMAdays" , 10 , 10 , 2 ) );
tester.Optimize();
tester.OptimalParameters.ReportToConsole();
tester.Parameters = tester.OptimalParameters;
tester.Objective();
tester.Account.ReportToConsole( endDateTime );
((History)tester.Account.GetProfitNetLossHistory(
new ExtendedDateTime( endDateTime , BarComponent.Close ) ) ).ReportToConsole();
// tester.Account.AccountReport.ReportToExcel( "MSFT" ,
// new ExtendedDateTime( endDateTime , BarComponent.Close ) );
AccountReport accountReport = tester.Account.CreateReport( "MSFT" , 7 ,
new ExtendedDateTime( endDateTime , BarComponent.Close ) , "MSFT" );
ExcelManager.Add( accountReport );
ExcelManager.ShowReport();
}
}
}
--- NEW FILE: TsMSFTsimpleTest.cs ---
/*
QuantProject - Quantitative Finance Library
TsMSFTsimpleTest.cs
Copyright (C) 2003
Glauco Siliprandi
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections;
using QuantProject.ADT;
using QuantProject.ADT.Histories;
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Instruments;
using QuantProject.Business.Financial.Ordering;
using QuantProject.Business.Strategies;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for tsMSFTsimpleTest.
/// </summary>
public class TsMSFTsimpleTest : TradingSystem
{
public TsMSFTsimpleTest()
{
//
// TODO: Add constructor logic here
//
}
private History microsoftCloseHistory;
private History microsoftCloseHistorySMA;
public override void InitializeData()
{
Parameter parameter = (Parameter) this.Parameters[ "SMAdays" ];
microsoftCloseHistory = QuoteCache.GetCloseHistory( "MSFT" );
microsoftCloseHistorySMA = microsoftCloseHistory.GetSimpleMovingAverage( (int) parameter.Value );
}
public override Signals GetSignals( ExtendedDateTime extendedDateTime )
{
Signals signals = new Signals();
if ( extendedDateTime.BarComponent == BarComponent.Close )
{
Signal signal = new Signal();
if ( microsoftCloseHistory.Cross( microsoftCloseHistorySMA ,
extendedDateTime.DateTime ) )
{
signal.Add( new Order( OrderType.MarketBuy , new Instrument( "MSFT" ) , 1 ,
new ExtendedDateTime( new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
BarComponent.Open ) ) );
signals.Add( signal );
}
else
{
if ( microsoftCloseHistorySMA.Cross( microsoftCloseHistory ,
extendedDateTime.DateTime ) )
{
signal.Add( new Order( OrderType.MarketSell , new Instrument( "MSFT" ) , 1 ,
new ExtendedDateTime(
new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
BarComponent.Open ) ) );
signals.Add( signal );
}
}
}
return signals;
}
}
}
|
|
From: <gla...@us...> - 2003-11-24 19:33:20
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/OneRank In directory sc8-pr-cvs1:/tmp/cvs-serv30009/OneRank Log Message: Directory /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/OneRank added to the repository |
|
From: <gla...@us...> - 2003-11-24 19:33:04
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTsimpleTest In directory sc8-pr-cvs1:/tmp/cvs-serv29940/MSFTsimpleTest Log Message: Directory /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTsimpleTest added to the repository |