quantproject-developers Mailing List for QuantProject (Page 124)
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: Glauco S. <gla...@us...> - 2004-12-05 02:56:03
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21728/b4_Business/a1_Financial/a2_Accounting Removed Files: Transactions.cs Log Message: Removed from the project --- Transactions.cs DELETED --- |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:50:01
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20495/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: RunWalkForwardOneRank.cs Log Message: Now the ProgressBarInSample is refreshed after each update Index: RunWalkForwardOneRank.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/RunWalkForwardOneRank.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RunWalkForwardOneRank.cs 29 Nov 2004 16:36:50 -0000 1.2 --- RunWalkForwardOneRank.cs 5 Dec 2004 02:49:50 -0000 1.3 *************** *** 88,91 **** --- 88,92 ---- { this.progressBarForm.ProgressBarInSample.Value = eventArgs.CurrentProgress; + this.progressBarForm.ProgressBarInSample.Refresh(); } private void run_initializeProgressHandlers() |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:49:26
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a3_Testing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20358/QuantProject/b4_Business/a3_Testing Modified Files: Tester.cs Log Message: An EndOfDayTime now is used to add the initial cash, instead of ExtendedDayTime Index: Tester.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a3_Testing/Tester.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Tester.cs 29 Nov 2004 16:37:46 -0000 1.5 --- Tester.cs 5 Dec 2004 02:49:16 -0000 1.6 *************** *** 56,60 **** this.TradingSystems = tradingSystems; this.initialCash = initialCash; ! this.Account.AddCash( new ExtendedDateTime( testWindow.StartDateTime , BarComponent.Open ) , initialCash ); } --- 56,60 ---- this.TradingSystems = tradingSystems; this.initialCash = initialCash; ! this.Account.AddCash( new EndOfDayDateTime( testWindow.StartDateTime , EndOfDaySpecificTime.MarketOpen ) , initialCash ); } *************** *** 63,67 **** { this.Account.Clear(); ! this.Account.AddCash( new ExtendedDateTime( testWindow.StartDateTime , BarComponent.Open ) , initialCash ); this.Test(); --- 63,67 ---- { this.Account.Clear(); ! this.Account.AddCash( new EndOfDayDateTime( testWindow.StartDateTime , EndOfDaySpecificTime.MarketOpen ) , initialCash ); this.Test(); |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:49:25
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/MSFTwalkForward In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20358/QuantProject/b7_Scripts/WalkForwardTesting/MSFTwalkForward Modified Files: RunMSFTwalkForward.cs Log Message: An EndOfDayTime now is used to add the initial cash, instead of ExtendedDayTime Index: RunMSFTwalkForward.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/MSFTwalkForward/RunMSFTwalkForward.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RunMSFTwalkForward.cs 29 Nov 2004 16:23:20 -0000 1.3 --- RunMSFTwalkForward.cs 5 Dec 2004 02:49:16 -0000 1.4 *************** *** 64,68 **** walkForwardTester.Add( new TsMSFTsimpleTest() ); walkForwardTester.Account.AddCash( ! new ExtendedDateTime( startDateTime , BarComponent.Open ) , 10000 ); walkForwardTester.Test(); --- 64,68 ---- walkForwardTester.Add( new TsMSFTsimpleTest() ); walkForwardTester.Account.AddCash( ! new EndOfDayDateTime( startDateTime , EndOfDaySpecificTime.MarketOpen ) , 10000 ); walkForwardTester.Test(); |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:46:23
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/OneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19865/QuantProject/b7_Scripts/SimpleTesting/OneRank Modified Files: OneRank.cs Log Message: marketOpenEventHandler() has been added, to provide the account with the cash to start the backtest Index: OneRank.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/OneRank/OneRank.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OneRank.cs 29 Nov 2004 14:36:43 -0000 1.1 --- OneRank.cs 5 Dec 2004 02:46:14 -0000 1.2 *************** *** 40,44 **** private DateTime lastDateTime; ! public void fiveMinutesBeforeMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { --- 40,52 ---- private DateTime lastDateTime; ! private void marketOpenEventHandler( ! Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) ! { ! if ( ( this.account.CashAmount == 0 ) && ! ( this.account.Transactions.Count == 0 ) ) ! // cash has not been added yet ! this.account.AddCash( 10000 ); ! } ! private void fiveMinutesBeforeMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { *************** *** 79,82 **** --- 87,93 ---- this.account = account; this.lastDateTime = lastDateTime; + this.account.EndOfDayTimer.MarketOpen += + new MarketOpenEventHandler( + this.marketOpenEventHandler ); this.account.EndOfDayTimer.FiveMinutesBeforeMarketClose += new FiveMinutesBeforeMarketCloseEventHandler( |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:44:46
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19594/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: BestPerformingTickers.cs Log Message: calculatedTickers changed from long to double (so that percentage increments are properly computed now) Index: BestPerformingTickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/BestPerformingTickers.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BestPerformingTickers.cs 29 Nov 2004 14:28:56 -0000 1.1 --- BestPerformingTickers.cs 5 Dec 2004 02:44:37 -0000 1.2 *************** *** 40,44 **** private int numberDaysForPerformanceCalculation; ! private long calculatedTickers = 0; private ArrayList eligibleAccounts; --- 40,44 ---- private int numberDaysForPerformanceCalculation; ! private double calculatedTickers = 0; private ArrayList eligibleAccounts; *************** *** 86,90 **** // a new time percentage point has been elapsed this.NewProgress( this , new NewProgressEventArgs( ! Convert.ToInt32( Math.Floor( this.calculatedTickers / eligibleAccounts.Count * 100 ) ) , 100 ) ); } --- 86,90 ---- // a new time percentage point has been elapsed this.NewProgress( this , new NewProgressEventArgs( ! Convert.ToInt32( Math.Floor( this.calculatedTickers / eligibleTickers.Count * 100 ) ) , 100 ) ); } |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:42:54
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19260/QuantProject/b4_Business/a1_Financial/a2_Accounting Modified Files: Account.cs Log Message: AddCash( ExtendedDateTime extendedDateTime , double moneyAmount ) has been replaced by AddCash( EndOfDayDateTime endOfDayDateTime , double moneyAmount ) Index: Account.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/Account.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Account.cs 29 Nov 2004 15:22:31 -0000 1.7 --- Account.cs 5 Dec 2004 02:42:45 -0000 1.8 *************** *** 148,157 **** this.Portfolio.Clear(); } ! public void AddCash( ExtendedDateTime extendedDateTime , double moneyAmount ) { try { ! TimedTransaction timedTransaction = ! new TimedTransaction( TransactionType.AddCash , moneyAmount , extendedDateTime ); this.Add( timedTransaction ); //Transactions.MultiAdd( extendedDateTime.DateTime , timedTransaction ); --- 148,157 ---- this.Portfolio.Clear(); } ! public void AddCash( EndOfDayDateTime endOfDayDateTime , double moneyAmount ) { try { ! EndOfDayTransaction timedTransaction = ! new EndOfDayTransaction( TransactionType.AddCash , moneyAmount , endOfDayDateTime ); this.Add( timedTransaction ); //Transactions.MultiAdd( extendedDateTime.DateTime , timedTransaction ); *************** *** 167,171 **** public void AddCash( double moneyAmount ) { ! this.AddCash( this.endOfDayTimer.GetCurrentTime().GetNearestExtendedDateTime() , moneyAmount ); } --- 167,171 ---- public void AddCash( double moneyAmount ) { ! this.AddCash( this.endOfDayTimer.GetCurrentTime() , moneyAmount ); } |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:39:30
|
Update of /cvsroot/quantproject/QuantDownloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18504/QuantDownloader Modified Files: QuantDownloader.suo Log Message: Minor fixings Index: QuantDownloader.suo =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/QuantDownloader.suo,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 Binary files /tmp/cvsMLoXfF and /tmp/cvshnfufR differ |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:39:30
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18504/QuantProject Modified Files: QuantProject.suo Log Message: Minor fixings Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 Binary files /tmp/cvs39IDf6 and /tmp/cvs5lqmvi differ |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:38:48
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18413/QuantDownloader/Downloader Modified Files: Downloader.csproj Log Message: Automatic changes have been applied Index: Downloader.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Downloader.csproj,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Downloader.csproj 1 Dec 2004 22:54:01 -0000 1.26 --- Downloader.csproj 5 Dec 2004 02:38:38 -0000 1.27 *************** *** 170,173 **** --- 170,178 ---- /> <File + RelPath = "Main.resx" + DependentUpon = "Main.cs" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "QuotesDataGrid.cs" SubType = "Component" *************** *** 191,195 **** <File RelPath = "QuotesEditor\QuotesChart.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 196,200 ---- <File RelPath = "QuotesEditor\QuotesChart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> *************** *** 200,203 **** --- 205,213 ---- /> <File + RelPath = "QuotesEditor\QuotesEditor.resx" + DependentUpon = "QuotesEditor.cs" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "QuotesEditor\ValidationDataGrid.cs" SubType = "Component" *************** *** 221,225 **** <File RelPath = "QuotesEditor\VisualValidationChart.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 231,235 ---- <File RelPath = "QuotesEditor\VisualValidationChart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> *************** *** 236,240 **** <File RelPath = "QuotesEditor\CloseToClose\CloseToCloseChart.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 246,250 ---- <File RelPath = "QuotesEditor\CloseToClose\CloseToCloseChart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> *************** *** 266,270 **** <File RelPath = "QuotesEditor\RangeToRange\RangeToRangeChart.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 276,280 ---- <File RelPath = "QuotesEditor\RangeToRange\RangeToRangeChart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:36:29
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18059/QuantProject/b5_Presentation Modified Files: b5_Presentation.csproj Log Message: - Added reference to Microsoft.Office.Core - Added reference to scpl Index: b5_Presentation.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/b5_Presentation.csproj,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** b5_Presentation.csproj 1 Dec 2004 22:47:01 -0000 1.12 --- b5_Presentation.csproj 5 Dec 2004 02:36:20 -0000 1.13 *************** *** 116,124 **** /> <Reference - Name = "scpl" - AssemblyName = "scpl" - HintPath = "..\..\lib\scpl.dll" - /> - <Reference Name = "b4_Business" Project = "{6EE31501-376E-491B-869E-F06D5B7C9C30}" --- 116,119 ---- *************** *** 130,133 **** --- 125,141 ---- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> + <Reference + Name = "Microsoft.Office.Core" + Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" + VersionMajor = "2" + VersionMinor = "3" + Lcid = "0" + WrapperTool = "primary" + /> + <Reference + Name = "scpl" + AssemblyName = "scpl" + HintPath = "..\b91_QuantProject\bin\Debug\scpl.dll" + /> </References> </Build> |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:35:45
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17876/QuantProject/b4_Business Modified Files: b4_Business.csproj Log Message: Added reference to Microsoft.Office.Core Index: b4_Business.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** b4_Business.csproj 1 Dec 2004 22:47:00 -0000 1.12 --- b4_Business.csproj 5 Dec 2004 02:35:35 -0000 1.13 *************** *** 130,133 **** --- 130,141 ---- WrapperTool = "primary" /> + <Reference + Name = "Microsoft.Office.Core" + Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" + VersionMajor = "2" + VersionMinor = "3" + Lcid = "0" + WrapperTool = "primary" + /> </References> </Build> |
|
From: Glauco S. <gla...@us...> - 2004-12-05 02:34:42
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17604/QuantProject/b3_Data Modified Files: b3_Data.csproj Log Message: Added reference to Microsoft.Office.Core Index: b3_Data.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/b3_Data.csproj,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** b3_Data.csproj 1 Dec 2004 22:47:00 -0000 1.15 --- b3_Data.csproj 5 Dec 2004 02:34:33 -0000 1.16 *************** *** 125,128 **** --- 125,136 ---- WrapperTool = "primary" /> + <Reference + Name = "Microsoft.Office.Core" + Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" + VersionMajor = "2" + VersionMinor = "3" + Lcid = "0" + WrapperTool = "primary" + /> </References> </Build> |
|
From: Marco M. <mi...@us...> - 2004-12-01 22:54:12
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23933/Downloader/TickerSelectors Modified Files: TickerGroupsViewer.cs TickerViewer.cs TickerViewerMenu.cs Log Message: Updated TickerViewer (now it's possible to modify the database directly through the form) Index: TickerGroupsViewer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors/TickerGroupsViewer.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TickerGroupsViewer.cs 5 Sep 2004 13:57:00 -0000 1.6 --- TickerGroupsViewer.cs 1 Dec 2004 22:54:01 -0000 1.7 *************** *** 300,307 **** this.menuItemRemoveGroup = new System.Windows.Forms.MenuItem(); this.menuItemRenameGroup = new System.Windows.Forms.MenuItem(); this.imageListGroupsAndTickers = new System.Windows.Forms.ImageList(this.components); this.splitter1 = new System.Windows.Forms.Splitter(); this.listViewGroupsAndTickers = new System.Windows.Forms.ListView(); - this.menuItemTickerSelector = new System.Windows.Forms.MenuItem(); this.SuspendLayout(); // --- 300,307 ---- this.menuItemRemoveGroup = new System.Windows.Forms.MenuItem(); this.menuItemRenameGroup = new System.Windows.Forms.MenuItem(); + this.menuItemTickerSelector = new System.Windows.Forms.MenuItem(); this.imageListGroupsAndTickers = new System.Windows.Forms.ImageList(this.components); this.splitter1 = new System.Windows.Forms.Splitter(); this.listViewGroupsAndTickers = new System.Windows.Forms.ListView(); this.SuspendLayout(); // *************** *** 343,346 **** --- 343,352 ---- this.menuItemRenameGroup.Click += new System.EventHandler(this.menuItemRenameGroup_Click); // + // menuItemTickerSelector + // + this.menuItemTickerSelector.Index = 3; + this.menuItemTickerSelector.Text = "&Ticker Selector"; + this.menuItemTickerSelector.Click += new System.EventHandler(this.menuItemTickerSelector_Click); + // // imageListGroupsAndTickers // *************** *** 361,364 **** --- 367,371 ---- // this.listViewGroupsAndTickers.Activation = System.Windows.Forms.ItemActivation.TwoClick; + this.listViewGroupsAndTickers.AllowDrop = true; this.listViewGroupsAndTickers.Dock = System.Windows.Forms.DockStyle.Fill; this.listViewGroupsAndTickers.Location = new System.Drawing.Point(123, 0); *************** *** 369,378 **** this.listViewGroupsAndTickers.View = System.Windows.Forms.View.Details; this.listViewGroupsAndTickers.ItemActivate += new System.EventHandler(this.listViewGroupsAndTickers_ItemActivate); ! // ! // menuItemTickerSelector ! // ! this.menuItemTickerSelector.Index = 3; ! this.menuItemTickerSelector.Text = "&Ticker Selector"; ! this.menuItemTickerSelector.Click += new System.EventHandler(this.menuItemTickerSelector_Click); // // TickerGroupsViewer --- 376,383 ---- this.listViewGroupsAndTickers.View = System.Windows.Forms.View.Details; this.listViewGroupsAndTickers.ItemActivate += new System.EventHandler(this.listViewGroupsAndTickers_ItemActivate); ! this.listViewGroupsAndTickers.DragDrop += new System.Windows.Forms.DragEventHandler(this.listViewGroupsAndTickers_DragDrop); ! this.listViewGroupsAndTickers.DragEnter += new System.Windows.Forms.DragEventHandler(this.listViewGroupsAndTickers_DragEnter); ! this.listViewGroupsAndTickers.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.listViewGroupsAndTickers_ItemDrag); ! this.listViewGroupsAndTickers.DragLeave += new System.EventHandler(this.listViewGroupsAndTickers_DragLeave); // // TickerGroupsViewer *************** *** 504,511 **** this.selectedGroupID = (string)this.treeViewGroups.SelectedNode.Tag; this.selectedGroupDescription = this.treeViewGroups.SelectedNode.Text; ! this.updateListView(this.treeViewGroups.SelectedNode); ! } #region Update List View --- 509,517 ---- this.selectedGroupID = (string)this.treeViewGroups.SelectedNode.Tag; this.selectedGroupDescription = this.treeViewGroups.SelectedNode.Text; ! this.Text = "Ticker-Groups Viewer " + this.treeViewGroups.SelectedNode.FullPath; ! this.updateListView(this.treeViewGroups.SelectedNode); } + #region Update List View *************** *** 858,861 **** --- 864,889 ---- tickerSelectorForm.Show(); } + + private void listViewGroupsAndTickers_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) + { + DoDragDrop(this.listViewGroupsAndTickers.SelectedItems, DragDropEffects.Copy); + } + + private void listViewGroupsAndTickers_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) + { + //MessageBox.Show("Finished drag and drop"); + } + + private void listViewGroupsAndTickers_DragLeave(object sender, System.EventArgs e) + { + //DragAction + + //MessageBox.Show("Try to leave data here"); + } + + private void listViewGroupsAndTickers_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) + { + //MessageBox.Show("Drag here?"); + } Index: TickerViewer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors/TickerViewer.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TickerViewer.cs 27 Jun 2004 19:21:42 -0000 1.3 --- TickerViewer.cs 1 Dec 2004 22:54:01 -0000 1.4 *************** *** 28,31 **** --- 28,32 ---- using System.Data; using System.Data.OleDb; + using QuantProject.DataAccess; using QuantProject.DataAccess.Tables; using QuantProject.Data.DataTables; *************** *** 61,65 **** private System.Windows.Forms.ComboBox comboBoxSecondOperator; private DataTable tableTickers; ! public TickerViewer() { --- 62,67 ---- private System.Windows.Forms.ComboBox comboBoxSecondOperator; private DataTable tableTickers; ! private bool skipRowChangedEvent;// event must be launched only by ! // user's changes public TickerViewer() { *************** *** 67,72 **** this.dataGrid1.ContextMenu = new TickerViewerMenu(this); this.tableTickers = new DataTable("tickers"); ! this.dataGrid1.DataSource = this.tableTickers; this.setStyle_dataGrid1(); } --- 69,75 ---- this.dataGrid1.ContextMenu = new TickerViewerMenu(this); this.tableTickers = new DataTable("tickers"); ! this.dataGrid1.DataSource = this.tableTickers; this.setStyle_dataGrid1(); + this.AcceptButton = this.buttonFindTickers; } *************** *** 158,166 **** // buttonFindTickers // ! this.buttonFindTickers.Location = new System.Drawing.Point(136, 256); this.buttonFindTickers.Name = "buttonFindTickers"; this.buttonFindTickers.Size = new System.Drawing.Size(104, 24); ! this.buttonFindTickers.TabIndex = 3; ! this.buttonFindTickers.Text = "Find Tickers"; this.buttonFindTickers.Click += new System.EventHandler(this.buttonFindTickers_Click); // --- 161,169 ---- // buttonFindTickers // ! this.buttonFindTickers.Location = new System.Drawing.Point(152, 232); this.buttonFindTickers.Name = "buttonFindTickers"; this.buttonFindTickers.Size = new System.Drawing.Size(104, 24); ! this.buttonFindTickers.TabIndex = 0; ! this.buttonFindTickers.Text = "&Find Tickers"; this.buttonFindTickers.Click += new System.EventHandler(this.buttonFindTickers_Click); // *************** *** 196,200 **** this.panel2.Location = new System.Drawing.Point(432, 0); this.panel2.Name = "panel2"; ! this.panel2.Size = new System.Drawing.Size(392, 478); this.panel2.TabIndex = 7; // --- 199,203 ---- this.panel2.Location = new System.Drawing.Point(432, 0); this.panel2.Name = "panel2"; ! this.panel2.Size = new System.Drawing.Size(400, 478); this.panel2.TabIndex = 7; // *************** *** 213,217 **** this.groupBoxDateQuoteFilter.Location = new System.Drawing.Point(8, 80); this.groupBoxDateQuoteFilter.Name = "groupBoxDateQuoteFilter"; ! this.groupBoxDateQuoteFilter.Size = new System.Drawing.Size(376, 160); this.groupBoxDateQuoteFilter.TabIndex = 14; this.groupBoxDateQuoteFilter.TabStop = false; --- 216,220 ---- this.groupBoxDateQuoteFilter.Location = new System.Drawing.Point(8, 80); this.groupBoxDateQuoteFilter.Name = "groupBoxDateQuoteFilter"; ! this.groupBoxDateQuoteFilter.Size = new System.Drawing.Size(384, 136); this.groupBoxDateQuoteFilter.TabIndex = 14; this.groupBoxDateQuoteFilter.TabStop = false; *************** *** 316,320 **** // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(824, 478); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.splitter1, --- 319,323 ---- // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(832, 478); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.splitter1, *************** *** 390,393 **** --- 393,406 ---- this.tableTickers = Tickers.GetTableOfFilteredTickers(this.textBoxStringToFind.Text, this.textBoxStringToFindInName.Text); + + this.tableTickers.Columns[Tickers.CompanyName].AllowDBNull = false; + this.tableTickers.Columns[Tickers.CompanyName].DefaultValue = "-"; + this.tableTickers.Columns[Tickers.Ticker].AllowDBNull = false; + this.tableTickers.Columns[Tickers.Ticker].DefaultValue = "tickerSymbol"; + + this.tableTickers.RowChanged += new DataRowChangeEventHandler(this.row_Changed); + this.tableTickers.RowDeleted += new DataRowChangeEventHandler(this.row_Deleted); + this.dataGrid1.DataSource = this.tableTickers; + this.dataGrid1.ReadOnly = false; } else *************** *** 400,409 **** this.comboBoxSecondOperator.Text, this.dateTimePickerLastDate.Value); } - // these two lines in order to avoid "strange" exceptions ... - this.dataGrid1.DataSource = null; - this.dataGrid1.DataSource = this.tableTickers; - // - this.dataGrid1.Refresh(); } catch(Exception ex) --- 413,419 ---- this.comboBoxSecondOperator.Text, this.dateTimePickerLastDate.Value); + this.dataGrid1.DataSource = this.tableTickers; + this.dataGrid1.ReadOnly = true; } } catch(Exception ex) *************** *** 469,474 **** } } - } --- 479,547 ---- } } + + private void row_Changed( object sender, DataRowChangeEventArgs e ) + { + this.rowModified_Manager(e); + } + + private void row_Deleted( object sender, DataRowChangeEventArgs e ) + { + this.rowModified_Manager(e); + } + + private void rowModified_Manager(DataRowChangeEventArgs rowChangeEventArgs) + { + if(this.skipRowChangedEvent) + return; + DialogResult userAnswer = MessageBox.Show( "Do you want to commit these changes permanently to the database?", + "Confirmation for permanent commit", + MessageBoxButtons.YesNo); + + if(userAnswer == DialogResult.Yes) + { + this.saveChangesToCurrentRow(rowChangeEventArgs); + } + else + { + this.skipRowChangedEvent = true; + this.tableTickers.RejectChanges(); + this.skipRowChangedEvent = false; + } + } + + private void saveChangesToCurrentRow(DataRowChangeEventArgs rowChangeEventArgs) + { + try + { + if(rowChangeEventArgs.Action == DataRowAction.Add) + { + string sqlInsertString = + "INSERT INTO tickers(tiTicker, tiCompanyName) VALUES('" + + (string)rowChangeEventArgs.Row["tiTicker"] + "', '" + + (string)rowChangeEventArgs.Row["tiCompanyName"] + "')"; + SqlExecutor.ExecuteNonQuery(sqlInsertString); + this.skipRowChangedEvent = true; + } + else + { + DataTable changedData = this.tableTickers.GetChanges(); + this.skipRowChangedEvent = true; + OleDbSingleTableAdapter adapter = new OleDbSingleTableAdapter(); + adapter.SetAdapter("tickers"); + adapter.OleDbDataAdapter.Update(changedData); + this.tableTickers.AcceptChanges(); + } + } + catch(Exception ex) + { + MessageBox.Show(ex.ToString()); + this.tableTickers.RejectChanges(); + } + finally + { + this.skipRowChangedEvent = false; + } + } } Index: TickerViewerMenu.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors/TickerViewerMenu.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TickerViewerMenu.cs 27 Aug 2004 23:20:48 -0000 1.6 --- TickerViewerMenu.cs 1 Dec 2004 22:54:01 -0000 1.7 *************** *** 134,137 **** --- 134,149 ---- DataTable tableOfSelectedTickers = iTickerSelector.GetTableOfSelectedTickers(); string currentTicker; + //user confirmation + if(tableOfSelectedTickers.Rows.Count > 5) + { + if(DialogResult.No == MessageBox.Show( "This operation may be very long: \n" + + "Do you want to continue?", "Confirmation", + MessageBoxButtons.YesNo)) + { + Cursor.Current = Cursors.Default; + return; + } + } + //ok foreach(DataRow row in tableOfSelectedTickers.Rows) { *************** *** 139,143 **** QuantProject.DataAccess.Tables.Quotes.ComputeAndCommitCloseToCloseRatios(currentTicker); } ! Cursor.Current = Cursors.WaitCursor; --- 151,155 ---- QuantProject.DataAccess.Tables.Quotes.ComputeAndCommitCloseToCloseRatios(currentTicker); } ! Cursor.Current = Cursors.Default; |
|
From: Marco M. <mi...@us...> - 2004-12-01 22:54:10
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23933/Downloader Modified Files: Downloader.csproj Main.cs Log Message: Updated TickerViewer (now it's possible to modify the database directly through the form) Index: Main.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Main.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Main.cs 17 Apr 2004 14:16:29 -0000 1.8 --- Main.cs 1 Dec 2004 22:54:01 -0000 1.9 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Data; using System.Drawing; using System.Collections; *************** *** 5,8 **** --- 6,10 ---- using System.Windows.Forms; using QuantProject.Applications.Downloader.TickerSelectors; + using QuantProject.Data.Selectors; namespace QuantProject.Applications.Downloader *************** *** 216,220 **** { Application.Run(new Principale()); //togli il commento per riavere il downloader ! // Application.Run(new QuotesEditor( "RYVYX" )); // Application.Run(new TestScpl()); } --- 218,239 ---- { Application.Run(new Principale()); //togli il commento per riavere il downloader ! /*TickerSelector mySelector1 = ! new TickerSelector(SelectionType.Liquidity, false, "NSDQ100", new DateTime(2003,1,1), ! new DateTime(2003,6,30), 15); ! TickerSelector mySelector2 = ! new TickerSelector(SelectionType.AverageCloseToOpenPerformance, false, "NSDQ100", new DateTime(2003,1,1), ! new DateTime(2003,6,30), 15); ! //System.Collections.Hashtable ht = ADT.ExtendedDataTable.GetCommonValues(mySelector1.GetTableOfSelectedTickers(), ! // mySelector2.GetTableOfSelectedTickers(), ! // 0, 0); ! ! DataTable table = TickerSelector.GetTableOfCommonTickers(mySelector1.GetTableOfSelectedTickers(), ! mySelector2.GetTableOfSelectedTickers()); ! ! foreach(DataRow row in table.Rows) ! { ! Console.WriteLine((string)row[0]); ! }*/ ! // Application.Run(new QuotesEditor( "RYVYX" )); // Application.Run(new TestScpl()); } Index: Downloader.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Downloader.csproj,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Downloader.csproj 1 Dec 2004 15:48:38 -0000 1.25 --- Downloader.csproj 1 Dec 2004 22:54:01 -0000 1.26 *************** *** 131,135 **** Name = "scpl" AssemblyName = "scpl" ! HintPath = "bin\Debug\scpl.dll" /> </References> --- 131,135 ---- Name = "scpl" AssemblyName = "scpl" ! HintPath = "..\..\lib\scpl.dll" /> </References> *************** *** 305,308 **** --- 305,313 ---- /> <File + RelPath = "TickerSelectors\TickerViewer.resx" + DependentUpon = "TickerViewer.cs" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "TickerSelectors\TickerViewerMenu.cs" SubType = "Component" |
|
From: Marco M. <mi...@us...> - 2004-12-01 22:50:24
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22931/b91_QuantProject Modified Files: App.ico Log Message: Modified icon for quantProject (just for fun, killing time ... waiting for commit) Index: App.ico =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b91_QuantProject/App.ico,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsEGbLHb and /tmp/cvs8Bvat9 differ |
|
From: Marco M. <mi...@us...> - 2004-12-01 22:50:24
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22931 Modified Files: QuantProject.suo Log Message: Modified icon for quantProject (just for fun, killing time ... waiting for commit) Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 Binary files /tmp/cvsoZo4Bd and /tmp/cvsJ1F2nb differ |
|
From: Marco M. <mi...@us...> - 2004-12-01 22:47:11
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22059/b4_Business Modified Files: b4_Business.csproj Log Message: Index: b4_Business.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** b4_Business.csproj 1 Dec 2004 15:32:24 -0000 1.11 --- b4_Business.csproj 1 Dec 2004 22:47:00 -0000 1.12 *************** *** 130,141 **** WrapperTool = "primary" /> - <Reference - Name = "Microsoft.Office.Core" - Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" - VersionMajor = "2" - VersionMinor = "3" - Lcid = "0" - WrapperTool = "primary" - /> </References> </Build> --- 130,133 ---- |
|
From: Marco M. <mi...@us...> - 2004-12-01 22:47:10
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22059/b1_ADT Modified Files: ExtendedDataTable.cs Log Message: Index: ExtendedDataTable.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ExtendedDataTable.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ExtendedDataTable.cs 28 Aug 2004 16:38:32 -0000 1.7 --- ExtendedDataTable.cs 1 Dec 2004 22:46:59 -0000 1.8 *************** *** 95,99 **** } ! /// <summary> /// Get an array of float corresponding to the ratio between columnA and columnB --- 95,125 ---- } ! /// <summary> ! /// Get an array of float corresponding to a column compatible with the float type in a given data table, ! /// filtered by the given filterExpression ! /// </summary> ! public static float[] GetArrayOfFloatFromColumn(DataTable table, ! string columnName, ! string filterExpression) ! { ! DataRow[] selectedRows = table.Select(filterExpression); ! int numRows = selectedRows.Length; ! float[] arrayOfFloat = new float[numRows]; ! int index = 0; ! try ! { ! for(; index!= numRows; index++) ! { ! arrayOfFloat[index] = (float)selectedRows[index][columnName]; ! } ! ! } ! catch(Exception ex) ! { ! MessageBox.Show(ex.ToString()); ! index = numRows; ! } ! return arrayOfFloat; ! } /// <summary> /// Get an array of float corresponding to the ratio between columnA and columnB |
|
From: Marco M. <mi...@us...> - 2004-12-01 22:47:09
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22059/b5_Presentation Modified Files: b5_Presentation.csproj Log Message: Index: b5_Presentation.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/b5_Presentation.csproj,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** b5_Presentation.csproj 1 Dec 2004 15:33:39 -0000 1.11 --- b5_Presentation.csproj 1 Dec 2004 22:47:01 -0000 1.12 *************** *** 116,130 **** /> <Reference - Name = "Microsoft.Office.Core" - Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" - VersionMajor = "2" - VersionMinor = "3" - Lcid = "0" - WrapperTool = "primary" - /> - <Reference Name = "scpl" AssemblyName = "scpl" ! HintPath = "..\b91_QuantProject\bin\Debug\scpl.dll" /> <Reference --- 116,122 ---- /> <Reference Name = "scpl" AssemblyName = "scpl" ! HintPath = "..\..\lib\scpl.dll" /> <Reference *************** *** 153,160 **** /> <File - RelPath = "scpl.dll" - BuildAction = "Content" - /> - <File RelPath = "Charting\CharPlot.cs" SubType = "Code" --- 145,148 ---- |
|
From: Marco M. <mi...@us...> - 2004-12-01 22:47:09
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22059/b2_DataAccess/Tables Modified Files: Quotes.cs Tickers.cs Log Message: Index: Tickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Tickers.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Tickers.cs 25 Apr 2004 17:37:52 -0000 1.2 --- Tickers.cs 1 Dec 2004 22:47:00 -0000 1.3 *************** *** 92,96 **** tickerSymbolIsLike + "' " + "AND tiCompanyName LIKE '" + ! tickerCompanyNameIsLike + "'"; return sqlSelectString; } --- 92,97 ---- tickerSymbolIsLike + "' " + "AND tiCompanyName LIKE '" + ! tickerCompanyNameIsLike + "' " + ! "ORDER BY tiTicker"; return sqlSelectString; } Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Quotes.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Quotes.cs 28 Aug 2004 17:13:55 -0000 1.18 --- Quotes.cs 1 Dec 2004 22:47:00 -0000 1.19 *************** *** 316,325 **** public static void ComputeCloseToCloseValues(DataTable tableOfAllQuotesOfAGivenTicker) { ! DataColumn[] columnPrimaryKey = new DataColumn[1]; ! columnPrimaryKey[0]= tableOfAllQuotesOfAGivenTicker.Columns[Quotes.Date]; ! tableOfAllQuotesOfAGivenTicker.PrimaryKey = columnPrimaryKey; int numRows = tableOfAllQuotesOfAGivenTicker.Rows.Count; ! DataView orderedDyDate = new DataView(tableOfAllQuotesOfAGivenTicker, Quotes.AdjustedClose + ">=0", Quotes.Date + " ASC", DataViewRowState.CurrentRows); --- 316,325 ---- public static void ComputeCloseToCloseValues(DataTable tableOfAllQuotesOfAGivenTicker) { ! //DataColumn[] columnPrimaryKey = new DataColumn[1]; ! //columnPrimaryKey[0]= tableOfAllQuotesOfAGivenTicker.Columns[Quotes.Date]; ! //tableOfAllQuotesOfAGivenTicker.PrimaryKey = columnPrimaryKey; int numRows = tableOfAllQuotesOfAGivenTicker.Rows.Count; ! DataView orderedByDate = new DataView(tableOfAllQuotesOfAGivenTicker, Quotes.AdjustedClose + ">=0", Quotes.Date + " ASC", DataViewRowState.CurrentRows); *************** *** 328,335 **** DateTime date; DataRow rowToBeChanged; for(int i = 0;i != numRows;i++) { ! date = (DateTime)orderedDyDate[i].Row[Quotes.Date]; ! rowToBeChanged = tableOfAllQuotesOfAGivenTicker.Rows.Find(date); if(i == 0) //the first available quote ... --- 328,338 ---- DateTime date; DataRow rowToBeChanged; + DataRow[] foundRows; for(int i = 0;i != numRows;i++) { ! date = (DateTime)orderedByDate[i].Row[Quotes.Date]; ! foundRows = tableOfAllQuotesOfAGivenTicker.Select(Quotes.Date + "=" + ! SQLBuilder.GetDateConstant(date)); ! rowToBeChanged = foundRows[0]; if(i == 0) //the first available quote ... *************** *** 342,347 **** { //the other quotes have a previous and a current close ! previousClose = (float)orderedDyDate[i-1].Row[Quotes.AdjustedClose]; ! currentClose = (float)orderedDyDate[i].Row[Quotes.AdjustedClose]; if(previousClose != 0) --- 345,350 ---- { //the other quotes have a previous and a current close ! previousClose = (float)orderedByDate[i-1].Row[Quotes.AdjustedClose]; ! currentClose = (float)orderedByDate[i].Row[Quotes.AdjustedClose]; if(previousClose != 0) |
|
From: Marco M. <mi...@us...> - 2004-12-01 22:47:08
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22059/b3_Data Modified Files: b3_Data.csproj Log Message: Index: b3_Data.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/b3_Data.csproj,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** b3_Data.csproj 1 Dec 2004 15:27:51 -0000 1.14 --- b3_Data.csproj 1 Dec 2004 22:47:00 -0000 1.15 *************** *** 125,136 **** WrapperTool = "primary" /> - <Reference - Name = "Microsoft.Office.Core" - Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}" - VersionMajor = "2" - VersionMinor = "3" - Lcid = "0" - WrapperTool = "primary" - /> </References> </Build> --- 125,128 ---- |
|
From: Marco M. <mi...@us...> - 2004-12-01 22:47:08
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22059/b2_DataAccess Modified Files: DataBaseVersionManager.cs Log Message: Index: DataBaseVersionManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** DataBaseVersionManager.cs 7 Jul 2004 20:17:11 -0000 1.13 --- DataBaseVersionManager.cs 1 Dec 2004 22:47:00 -0000 1.14 *************** *** 96,101 **** private void createTables() { ! this.executeCommand("CREATE TABLE tickers (tiTicker TEXT(8))"); ! this.executeCommand("CREATE TABLE quotes (quTicker TEXT(8), quDate DATETIME, " + "quOpen REAL, quHigh REAL, quLow REAL, quClose REAL, " + "quVolume INTEGER, quAdjustedClose REAL, quAdjustedCloseToCloseRatio FLOAT)"); --- 96,101 ---- private void createTables() { ! this.executeCommand("CREATE TABLE tickers (tiTicker TEXT(10))"); ! this.executeCommand("CREATE TABLE quotes (quTicker TEXT(10), quDate DATETIME, " + "quOpen REAL, quHigh REAL, quLow REAL, quClose REAL, " + "quVolume INTEGER, quAdjustedClose REAL, quAdjustedCloseToCloseRatio FLOAT)"); *************** *** 109,117 **** // a ticker can belong to one or more groups this.executeCommand("CREATE TABLE tickers_tickerGroups " + ! "( ttTgId TEXT(8) , ttTiId TEXT(8))"); // validatedTickers will contain a record for each ticker whose quotes have already // been validated. The quotes are meant to be ok from vtStartDate to vtEndDate. this.executeCommand( "CREATE TABLE validatedTickers " + ! "( vtTicker TEXT(8) , vtStartDate DATETIME , vtEndDate DATETIME , " + "vtHashValue TEXT(50) , vtEditDate DATETIME, " + "CONSTRAINT myKey PRIMARY KEY ( vtTicker ) )" ); --- 109,117 ---- // a ticker can belong to one or more groups this.executeCommand("CREATE TABLE tickers_tickerGroups " + ! "( ttTgId TEXT(8) , ttTiId TEXT(10))"); // validatedTickers will contain a record for each ticker whose quotes have already // been validated. The quotes are meant to be ok from vtStartDate to vtEndDate. this.executeCommand( "CREATE TABLE validatedTickers " + ! "( vtTicker TEXT(10) , vtStartDate DATETIME , vtEndDate DATETIME , " + "vtHashValue TEXT(50) , vtEditDate DATETIME, " + "CONSTRAINT myKey PRIMARY KEY ( vtTicker ) )" ); *************** *** 125,129 **** // vvEditDate: Last date this record has been added/modified this.executeCommand( "CREATE TABLE visuallyValidatedQuotes " + ! "( vvTicker TEXT(8) , vvDate DATETIME , vvValidationType INT , " + "vvHashValue TEXT(50) , vvEditDate DATETIME , " + "CONSTRAINT myKey PRIMARY KEY ( vvTicker , vvDate , vvValidationType ) )" ); --- 125,129 ---- // vvEditDate: Last date this record has been added/modified this.executeCommand( "CREATE TABLE visuallyValidatedQuotes " + ! "( vvTicker TEXT(10) , vvDate DATETIME , vvValidationType INT , " + "vvHashValue TEXT(50) , vvEditDate DATETIME , " + "CONSTRAINT myKey PRIMARY KEY ( vvTicker , vvDate , vvValidationType ) )" ); *************** *** 134,138 **** // qsEditDate: last date this record has been added/modified this.executeCommand( "create table quotesFromSecondarySources " + ! "(qsTicker TEXT(8) , " + "qsDate DATETIME , " + "qsSource SHORT , " + --- 134,138 ---- // qsEditDate: last date this record has been added/modified this.executeCommand( "create table quotesFromSecondarySources " + ! "(qsTicker TEXT(10) , " + "qsDate DATETIME , " + "qsSource SHORT , " + *************** *** 149,153 **** // faultyTickers will contain tickers not downloaded from the web this.executeCommand( "CREATE TABLE faultyTickers " + ! "(ftTicker TEXT(8) , " + "ftDate DATETIME)"); } --- 149,153 ---- // faultyTickers will contain tickers not downloaded from the web this.executeCommand( "CREATE TABLE faultyTickers " + ! "(ftTicker TEXT(10) , " + "ftDate DATETIME)"); } *************** *** 172,176 **** this.executeCommand("ALTER TABLE tickers " + ! "ADD COLUMN tiCompanyName TEXT(100)"); this.executeCommand("ALTER TABLE validatedTickers " + "ADD COLUMN vtHashValue TEXT(50)"); --- 172,176 ---- this.executeCommand("ALTER TABLE tickers " + ! "ADD COLUMN tiCompanyName TEXT(100) NOT NULL"); this.executeCommand("ALTER TABLE validatedTickers " + "ADD COLUMN vtHashValue TEXT(50)"); |
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20368/b7_Scripts/TickerSelectionTesting Added Files: GenomeManagerForEfficientCTOPortfolio.cs GenomeManagerForEfficientPortfolio.cs RunEfficientCTOPortfolio.cs RunEfficientPortfolio.cs Log Message: Added classes in order to find some kinds of efficient portfolios using the genetic optimizer --- NEW FILE: GenomeManagerForEfficientCTOPortfolio.cs --- /* QuantProject - Quantitative Finance Library GenomeManagerForEfficientCTOPortfolio.cs Copyright (C) 2003 Marco Milletti 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.Data; using System.Collections; using QuantProject.ADT.Statistics; using QuantProject.ADT.Optimizing.Genetic; using QuantProject.Data; using QuantProject.Data.DataTables; namespace QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios { /// <summary> /// This class implements IGenomeManager, in order to find efficient /// portfolios based on tickers' CloseToOpen rates, using the /// GeneticOptimizer /// </summary> public class GenomeManagerForEfficientCTOPortfolio : IGenomeManager { private int genomeSize; private int minValueForGenes; private int maxValueForGenes; private DataTable setOfTickers; private DateTime firstQuoteDate; private DateTime lastQuoteDate; private double targetPerformance; private double targetStdDev; private double variance; private double rateOfReturn; //IGenomeManager implementation for properties public int GenomeSize { get{return this.genomeSize;} } public int MinValueForGenes { get{return this.minValueForGenes;} } public int MaxValueForGenes { get{return this.maxValueForGenes;} } //end of implementation for properties public double Variance { get{return this.variance;} } public double RateOfReturn { get{return this.rateOfReturn;} } public GenomeManagerForEfficientCTOPortfolio(DataTable setOfInitialTickers, DateTime firstQuoteDate, DateTime lastQuoteDate, int numberOfTickersInPortfolio, double targetPerformance, double targetStdDev) { this.setOfTickers = setOfInitialTickers; if(!this.setOfTickers.Columns.Contains("ArrayOfCloseToOpenRates")) this.setOfTickers.Columns.Add("ArrayOfCloseToOpenRates", System.Type.GetType("System.Array")); this.firstQuoteDate = firstQuoteDate; this.lastQuoteDate = lastQuoteDate; this.targetPerformance = targetPerformance; this.targetStdDev = targetStdDev; this.genomeSize = numberOfTickersInPortfolio; //each genes is the index for the setOfTickers table this.minValueForGenes = 0; this.maxValueForGenes = this.setOfTickers.Rows.Count - 1; this.retrieveData(); } public double GetFitnessValue(Genome genome) { //parameters used to balance the rate of return against variance double a=2.5, b=2.0; double portofolioVariance = this.getPortfolioVariance(genome.Genes()); double portfolioRateOfReturn = this.getPortfolioRateOfReturn(genome.Genes()); this.variance = portofolioVariance; this.rateOfReturn = portfolioRateOfReturn; double returnValue = System.Math.Pow(((this.targetStdDev*this.targetStdDev)/portofolioVariance),a)* System.Math.Pow(System.Math.Max(0.0,(portfolioRateOfReturn/this.targetPerformance)),b); return returnValue; } public Genome[] GetChilds(Genome parent1, Genome parent2) { return GenomeManagement.MixGenesWithoutDuplicates(parent1, parent2); } public int GetNewGeneValue(Genome genome) { // in this implementation new gene values must be different from // the others already stored in the given genome int returnValue = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, genome.MaxValueForGenes + 1); while(genome.HasGene(returnValue)) { returnValue = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, genome.MaxValueForGenes + 1); } return returnValue; } public void Mutate(Genome genome, double mutationRate) { // in this implementation only one gene is mutated // the new value has to be different from all the other genes of the genome int newValueForGene = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, genome.MaxValueForGenes +1); int genePositionToBeMutated = GenomeManagement.RandomGenerator.Next(genome.Size); while(genome.HasGene(newValueForGene)) { newValueForGene = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, genome.MaxValueForGenes +1); } GenomeManagement.MutateOneGene(genome, mutationRate, genePositionToBeMutated, newValueForGene); } public object Decode(Genome genome) { string sequenceOfTickers = ""; object returnValue; foreach(int index in genome.Genes()) { sequenceOfTickers += (string)this.setOfTickers.Rows[index][0] + ";" ; } returnValue = sequenceOfTickers; returnValue += "(rate: " + this.RateOfReturn + " std: " + System.Math.Sqrt(this.Variance) + ")"; return returnValue; } // end of implementation of IGenomeManager private double getPortfolioVariance(int[] tickerIdx) { double sumOfVariances = this.getSumOfVariances(tickerIdx); double sumOfCovariances = this.getSumOfCovariances(tickerIdx); double returnValue = sumOfVariances + sumOfCovariances; return returnValue; } private double getSumOfVariances(int[] tickerIdx) { double returnValue = 0; double tickerCoeff = 1.0/this.genomeSize; foreach(int idx in tickerIdx) { returnValue += BasicFunctions.Variance((float[])this.setOfTickers.Rows[idx]["ArrayOfCloseToOpenRates"]); } returnValue = returnValue * tickerCoeff * tickerCoeff; return returnValue; } private double getSumOfCovariances(int[] tickerIdx) { double returnValue = 0; float[] ticker_i; float[] ticker_j; double tickerCoeff = 1/this.genomeSize; for(int i = 0; i<this.genomeSize ; i++) { ticker_i = (float[])this.setOfTickers.Rows[i]["ArrayOfCloseToOpenRates"]; for(int j = 0 ; j<this.genomeSize ; j++) { if(j != i) { ticker_j = (float[])this.setOfTickers.Rows[j]["ArrayOfCloseToOpenRates"]; returnValue += BasicFunctions.CoVariance(ticker_i, ticker_j); } } } returnValue = returnValue * tickerCoeff * tickerCoeff; return returnValue; } private void retrieveData() { foreach(DataRow row in this.setOfTickers.Rows) { float[] arrayOfCTORates = this.getArrayOfCTORates((string)row[0]); row["ArrayOfCloseToOpenRates"] = arrayOfCTORates; } } private float[] getArrayOfCTORates(string ticker) { Quotes tickerQuotes = new Quotes(ticker, this.firstQuoteDate, this.lastQuoteDate); return ExtendedDataTable.GetArrayOfFloatFromRatioOfColumns(tickerQuotes, "quClose", "quOpen"); } private double getPortfolioRateOfReturn(int[] tickerIdx) { double returnValue = 0; foreach(int idx in tickerIdx) { returnValue += (BasicFunctions.SimpleAverage((float[])this.setOfTickers.Rows[idx]["ArrayOfCloseToOpenRates"]) - 1); } //the investement is assumed to be equally divided return (returnValue/this.GenomeSize); } } } --- NEW FILE: GenomeManagerForEfficientPortfolio.cs --- /* QuantProject - Quantitative Finance Library GenomeManagerForEfficientPortfolio.cs Copyright (C) 2003 Marco Milletti 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.Data; using System.Collections; using QuantProject.ADT.Statistics; using QuantProject.ADT.Optimizing.Genetic; using QuantProject.Data; using QuantProject.Data.DataTables; namespace QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios { /// <summary> /// This class implements IGenomeManager, in order to find efficient /// portfolios based on the comparison of adjustedClose values for each /// portfolio's ticker /// at the beginning and at the end of a specified interval of days, using the /// GeneticOptimizer /// </summary> public class GenomeManagerForEfficientPortfolio : IGenomeManager { private int genomeSize; private int minValueForGenes; private int maxValueForGenes; private int intervalLength; private DataTable setOfTickers; private DateTime firstQuoteDate; private DateTime lastQuoteDate; private double targetPerformance; private double targetStdDev; private double variance; private double rateOfReturn; //IGenomeManager implementation for properties public int GenomeSize { get{return this.genomeSize;} } public int MinValueForGenes { get{return this.minValueForGenes;} } public int MaxValueForGenes { get{return this.maxValueForGenes;} } //end of implementation for properties public double Variance { get{return this.variance;} } public double RateOfReturn { get{return this.rateOfReturn;} } public GenomeManagerForEfficientPortfolio(int intervalLengthInDays, DataTable setOfInitialTickers, DateTime firstQuoteDate, DateTime lastQuoteDate, int numberOfTickersInPortfolio, double targetPerformance, double targetStdDev) { this.setOfTickers = setOfInitialTickers; this.intervalLength = intervalLengthInDays; //arrayOfRatesOfReturn contains the rates of return computed for the given interval in days if(!this.setOfTickers.Columns.Contains("ArrayOfRatesOfReturn")) this.setOfTickers.Columns.Add("ArrayOfRatesOfReturn", System.Type.GetType("System.Array")); this.firstQuoteDate = firstQuoteDate; this.lastQuoteDate = lastQuoteDate; this.targetPerformance = targetPerformance; this.targetStdDev = targetStdDev; this.genomeSize = numberOfTickersInPortfolio; //each genes is the index for the setOfTickers table this.minValueForGenes = 0; this.maxValueForGenes = this.setOfTickers.Rows.Count - 1; this.retrieveData(); } public double GetFitnessValue(Genome genome) { //parameters used to balance the rate of return against variance double a=2.5, b=2.0; double portofolioVariance = this.getPortfolioVariance(genome.Genes()); double portfolioRateOfReturn = this.getPortfolioRateOfReturn(genome.Genes()); this.variance = portofolioVariance; this.rateOfReturn = portfolioRateOfReturn; //double returnValue = System.Math.Pow(((this.targetStdDev*this.targetStdDev)/portofolioVariance),a)* //System.Math.Pow((portfolioRateOfReturn/this.targetPerformance),b); double returnValue = System.Math.Pow(((this.targetStdDev*this.targetStdDev)/portofolioVariance),a)* System.Math.Pow(System.Math.Max(0.0,(portfolioRateOfReturn/this.targetPerformance)),b); return returnValue; } public Genome[] GetChilds(Genome parent1, Genome parent2) { return GenomeManagement.MixGenesWithoutDuplicates(parent1, parent2); } public int GetNewGeneValue(Genome genome) { // in this implementation new gene values must be different from // the others already stored in the given genome int returnValue = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, genome.MaxValueForGenes + 1); while(genome.HasGene(returnValue)) { returnValue = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, genome.MaxValueForGenes + 1); } return returnValue; } public void Mutate(Genome genome, double mutationRate) { // in this implementation only one gene is mutated // the new value has to be different from all the other genes of the genome int newValueForGene = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, genome.MaxValueForGenes +1); int genePositionToBeMutated = GenomeManagement.RandomGenerator.Next(genome.Size); while(genome.HasGene(newValueForGene)) { newValueForGene = GenomeManagement.RandomGenerator.Next(genome.MinValueForGenes, genome.MaxValueForGenes +1); } GenomeManagement.MutateOneGene(genome, mutationRate, genePositionToBeMutated, newValueForGene); } public object Decode(Genome genome) { string sequenceOfTickers = ""; object returnValue; foreach(int index in genome.Genes()) { sequenceOfTickers += (string)this.setOfTickers.Rows[index][0] + ";" ; } returnValue = sequenceOfTickers; returnValue += "(rate: " + this.RateOfReturn + " std: " + System.Math.Sqrt(this.Variance) + ")"; return returnValue; } // end of implementation of IGenomeManager private double getPortfolioVariance(int[] tickerIdx) { double sumOfVariances = this.getSumOfVariances(tickerIdx); double sumOfCovariances = this.getSumOfCovariances(tickerIdx); double returnValue = sumOfVariances + sumOfCovariances; return returnValue; } private double getSumOfVariances(int[] tickerIdx) { double returnValue = 0; double tickerCoeff = 1.0/this.genomeSize; foreach(int idx in tickerIdx) { returnValue += BasicFunctions.Variance((float[])this.setOfTickers.Rows[idx]["ArrayOfRatesOfReturn"]); } returnValue = returnValue * tickerCoeff * tickerCoeff; return returnValue; } private double getSumOfCovariances(int[] tickerIdx) { double returnValue = 0; float[] ticker_i; float[] ticker_j; double tickerCoeff = 1/this.genomeSize; for(int i = 0; i<this.genomeSize ; i++) { ticker_i = (float[])this.setOfTickers.Rows[i]["ArrayOfRatesOfReturn"]; for(int j = 0 ; j<this.genomeSize ; j++) { if(j != i) { ticker_j = (float[])this.setOfTickers.Rows[j]["ArrayOfRatesOfReturn"]; returnValue += BasicFunctions.CoVariance(ticker_i, ticker_j); } } } returnValue = returnValue * tickerCoeff * tickerCoeff; return returnValue; } private void retrieveData() { foreach(DataRow row in this.setOfTickers.Rows) { // float[] arrayOfRatesOfReturn = this.getArrayOfRatesOfReturn((string)row[0]); row["ArrayOfRatesOfReturn"] = arrayOfRatesOfReturn; } } private float[] getArrayOfRatesOfReturn(string ticker) { Quotes tickerQuotes = new Quotes(ticker, this.firstQuoteDate, this.lastQuoteDate); float[] allAdjValues = ExtendedDataTable.GetArrayOfFloatFromColumn(tickerQuotes, "quAdjustedClose"); float[] ratesOfReturns = new float[allAdjValues.Length/this.intervalLength + 1]; int i = 0; //index for ratesOfReturns array for(int idx = 0; idx + this.intervalLength < allAdjValues.Length; idx += this.intervalLength ) { ratesOfReturns[i] = allAdjValues[idx+this.intervalLength]/ allAdjValues[idx] - 1; i++; } return ratesOfReturns; } private double getPortfolioRateOfReturn(int[] tickerIdx) { double returnValue = 0; foreach(int idx in tickerIdx) { returnValue += BasicFunctions.SimpleAverage((float[])this.setOfTickers.Rows[idx]["ArrayOfRatesOfReturn"]); } //the investement is assumed to be equally divided return (returnValue/this.GenomeSize); } } } --- NEW FILE: RunEfficientPortfolio.cs --- /* QuantProject - Quantitative Finance Library RunEfficientPorfolio.cs Copyright (C) 2003 Marco Milletti 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.Data; using QuantProject.ADT.Optimizing.Genetic; /* using System.Collections; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting.Reporting; using QuantProject.Business.Financial.Instruments; using QuantProject.Business.Strategies; using QuantProject.Business.Testing; using QuantProject.Data.DataTables; using QuantProject.Data.DataProviders; using QuantProject.Presentation.Reporting.WindowsForm; */ using QuantProject.Business.Scripting; using QuantProject.Data.Selectors; using QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios; namespace QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios { /// <summary> /// Script to find the efficient portfolio for the given interval of days /// (the value of portfolio is computed through adjusted close values) /// </summary> public class RunEfficientPorfolio : Script { DateTime firstDate = new DateTime(2001,1,1); DateTime lastDate = new DateTime(2001,3,1); public RunEfficientPorfolio() { } #region Run public override void Run() { //"STOCKMI" "MIB_F" TickerSelector mostLiquid = new TickerSelector(SelectionType.Liquidity, false, "STOCKMI", firstDate, lastDate, 60); DataTable tickers = mostLiquid.GetTableOfSelectedTickers(); IGenomeManager genManEfficientPortfolio = new GenomeManagerForEfficientPortfolio(4, tickers,firstDate, lastDate, 5, 0.01, 0.1); GeneticOptimizer GO = new GeneticOptimizer(genManEfficientPortfolio); //GO.KeepOnRunningUntilConvergenceIsReached = true; GO.GenerationNumber = 4; GO.MutationRate = 0.05; GO.Run(true); System.Console.WriteLine("\n\nThe best solution found is: " + (string)GO.BestGenome.Meaning + " with {0} generations", GO.GenerationCounter); } #endregion } } --- NEW FILE: RunEfficientCTOPortfolio.cs --- /* QuantProject - Quantitative Finance Library RunEfficientCTOPorfolio.cs Copyright (C) 2003 Marco Milletti 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.Data; using QuantProject.ADT.Optimizing.Genetic; /* using System.Collections; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting.Reporting; using QuantProject.Business.Financial.Instruments; using QuantProject.Business.Strategies; using QuantProject.Business.Testing; using QuantProject.Data.DataTables; using QuantProject.Data.DataProviders; using QuantProject.Presentation.Reporting.WindowsForm; */ using QuantProject.Business.Scripting; using QuantProject.Data.Selectors; using QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios; namespace QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios { /// <summary> /// Script to find the efficient close to open daily portfolio /// </summary> public class RunEfficientCTOPorfolio : Script { //DateTime lastDate = DateTime.Now.Date; //DateTime firstDate = DateTime.Now.Date.AddDays(-60); DateTime lastDate = new DateTime(2004,11,25); DateTime firstDate = new DateTime(2004,9,25); public RunEfficientCTOPorfolio() { } #region Run public override void Run() { //"STOCKMI" TickerSelector mostLiquid = new TickerSelector(SelectionType.Liquidity, false, "STOCKMI", firstDate, lastDate, 70); DataTable tickers = mostLiquid.GetTableOfSelectedTickers(); IGenomeManager genManEfficientCTOPortfolio = new GenomeManagerForEfficientCTOPortfolio(tickers,firstDate, lastDate, 6, 0.005, 0.05); GeneticOptimizer GO = new GeneticOptimizer(genManEfficientCTOPortfolio); //GO.KeepOnRunningUntilConvergenceIsReached = true; GO.GenerationNumber = 7; GO.MutationRate = 0.05; GO.Run(true); System.Console.WriteLine("\n\nThe best solution found is: " + (string)GO.BestGenome.Meaning + " with {0} generations", GO.GenerationCounter); } #endregion } } |
|
From: Marco M. <mi...@us...> - 2004-12-01 22:40:22
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20368/b7_Scripts Modified Files: b7_Scripts.csproj Log Message: Added classes in order to find some kinds of efficient portfolios using the genetic optimizer Index: b7_Scripts.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/b7_Scripts.csproj,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** b7_Scripts.csproj 1 Dec 2004 15:41:03 -0000 1.13 --- b7_Scripts.csproj 1 Dec 2004 22:40:03 -0000 1.14 *************** *** 183,186 **** --- 183,206 ---- /> <File + RelPath = "TickerSelectionTesting\GenomeManagerForEfficientCTOPortfolio.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectionTesting\GenomeManagerForEfficientPortfolio.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectionTesting\RunEfficientCTOPortfolio.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "TickerSelectionTesting\RunEfficientPortfolio.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "WalkForwardTesting\MSFTwalkForward\RunMSFTwalkForward.cs" SubType = "Code" |