quantproject-developers Mailing List for QuantProject (Page 58)
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...> - 2008-02-07 18:21:06
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/General/Logging In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17520 Added Files: LogViewer.cs Log Message: This Form displays a BackTestLog and executes a specific script for every single LogItem --- NEW FILE: LogViewer.cs --- /* QuantProject - Quantitative Finance Library LogViewer.cs Copyright (C) 2008 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.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using QuantProject.Business.Strategies.Logging; namespace QuantProject.Scripts.General.Logging { /// <summary> /// This Form displays a BackTestLog and executes a specific script for /// every single LogItem /// </summary> public class LogViewer : System.Windows.Forms.Form { private BackTestLog backTestLog; private System.Windows.Forms.DataGrid dataGridLogItems; /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public LogViewer( BackTestLog backTestLog ) { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // this.backTestLog = backTestLog; this.setDataGridTableStyle(); this.updateGrid(); } private void setDataGridTableStyle() { DataGridTableStyle dataGridTableStyle = new DataGridTableStyle( true ); // DataGridColumnStyle dataGridColumnStyle = new DataGridColumnStyle(); } private void updateGrid() { ArrayList dataGridItems = new ArrayList( this.backTestLog ); this.dataGridLogItems.DataSource = dataGridItems; this.dataGridLogItems.Refresh(); } /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if(components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.dataGridLogItems = new System.Windows.Forms.DataGrid(); ((System.ComponentModel.ISupportInitialize)(this.dataGridLogItems)).BeginInit(); this.SuspendLayout(); // // dataGridLogItems // this.dataGridLogItems.DataMember = ""; this.dataGridLogItems.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dataGridLogItems.Location = new System.Drawing.Point(16, 16); this.dataGridLogItems.Name = "dataGridLogItems"; this.dataGridLogItems.Size = new System.Drawing.Size(568, 248); this.dataGridLogItems.TabIndex = 0; this.dataGridLogItems.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dataGridLogItems_MouseUp); // // LogViewer // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(592, 278); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.dataGridLogItems}); this.Name = "LogViewer"; this.Text = "LogViewer"; ((System.ComponentModel.ISupportInitialize)(this.dataGridLogItems)).EndInit(); this.ResumeLayout(false); } #endregion #region dataGridLogItems_MouseUp private int getRowNumber( object sender , MouseEventArgs eventArgs ) { DataGrid dataGrid = (DataGrid)sender; Point point = new Point( eventArgs.X , eventArgs.Y ); DataGrid.HitTestInfo hitTestInfo = dataGrid.HitTest( point ); // DataTable dataTable = (DataTable)dataGrid.DataSource; return hitTestInfo.Row; } private LogItem getLogItem( DataGrid dataGrid , int rowNumber ) { // DataTable dataTable = (DataTable)dataGrid.DataSource; LogItem logItem = this.backTestLog[ rowNumber ]; return logItem; } private LogItem getLogItem( object sender, System.Windows.Forms.MouseEventArgs e ) { int rowNumber = this.getRowNumber( sender , e ); LogItem logItem = this.getLogItem( (DataGrid)sender , rowNumber ); return logItem; } private void rightClickEventHandler(object sender, System.Windows.Forms.MouseEventArgs e) { // wFLagWeightedPositions wFLagChosenPositions = // this.rightClickEventHandler_getWFLagChosenPositions( sender , e ); LogItem logItem = this.getLogItem( sender , e ); logItem.Run(); } private void dataGridLogItems_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { if ( e.Button == MouseButtons.Right ) this.rightClickEventHandler( sender , e ); } #endregion dataGridLogItems_MouseUp } } |
|
From: Glauco S. <gla...@us...> - 2008-02-07 18:20:02
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/General/Logging In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16878 Added Files: LogArchiver.cs Log Message: Saves/Loads a backtest log to/from disk invoking a dialog form to ask for the full file path to write/read to/from --- NEW FILE: LogArchiver.cs --- /* QuantProject - Quantitative Finance Library LogArchiver.cs Copyright (C) 2008 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.Business.Strategies.Logging; using QuantProject.Presentation; namespace QuantProject.Scripts.General.Logging { /// <summary> /// Saves/Loads a backtest log to/from disk invoking a dialog form to ask for /// the full file path to write/read to/from. /// </summary> public class LogArchiver { public LogArchiver() { } public static void Save( BackTestLog backTestLog , string suggestedLogFileName , string initialFolderPath ) { VisualObjectArchiver visualObjectArchiver = new VisualObjectArchiver(); visualObjectArchiver.Save( backTestLog , "qPl" , "Save backtest Log" , suggestedLogFileName , initialFolderPath ); } public static BackTestLog Load( string initialFolderPath ) { VisualObjectArchiver visualObjectArchiver = new VisualObjectArchiver(); object backTestLog = visualObjectArchiver.Load( "qPl" , "Load backtest Log" , initialFolderPath ); if ( !( backTestLog is BackTestLog ) ) throw new Exception( "The loaded file is not a valid serialization for " + "a BackTestLog Object!" ); return (BackTestLog)backTestLog; } } } |
|
From: Glauco S. <gla...@us...> - 2008-02-07 18:19:12
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/General/Reporting In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16288/Reporting Log Message: Directory /cvsroot/quantproject/QuantProject/b7_Scripts/General/Reporting added to the repository |
|
From: Glauco S. <gla...@us...> - 2008-02-07 18:18:59
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/General/Logging In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16225/Logging Log Message: Directory /cvsroot/quantproject/QuantProject/b7_Scripts/General/Logging added to the repository |
|
From: Glauco S. <gla...@us...> - 2008-02-07 18:18:47
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/General In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16152/General Log Message: Directory /cvsroot/quantproject/QuantProject/b7_Scripts/General added to the repository |
|
From: Glauco S. <gla...@us...> - 2008-02-07 18:14:29
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13474/b5_Presentation Modified Files: b5_Presentation.csproj Log Message: Minor VSNet automatic change Index: b5_Presentation.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/b5_Presentation.csproj,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** b5_Presentation.csproj 6 Feb 2008 23:23:00 -0000 1.41 --- b5_Presentation.csproj 7 Feb 2008 18:14:22 -0000 1.42 *************** *** 166,170 **** <File RelPath = "Charting\Chart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> --- 166,170 ---- <File RelPath = "Charting\Chart.cs" ! SubType = "Code" BuildAction = "Compile" /> |
|
From: Glauco S. <gla...@us...> - 2008-02-07 18:13:43
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12899/b4_Business Modified Files: Business_SD.csproj Log Message: a2_Strategies\Eligibles\DummyEligibleSelector.cs has been added a2_Strategies\InSample\ConstantWeightedPositionsChooser.cs has been added a2_Strategies\InSample has been added Index: Business_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/Business_SD.csproj,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Business_SD.csproj 6 Feb 2008 23:23:00 -0000 1.9 --- Business_SD.csproj 7 Feb 2008 18:13:39 -0000 1.10 *************** *** 64,67 **** --- 64,68 ---- <Compile Include="a1_Financial\a2_Accounting\h5_Reporting\Tables\StatisticsSummary.cs" /> <Compile Include="a2_Strategies\Benchmark.cs" /> + <Compile Include="a2_Strategies\Eligibles\DummyEligibleSelector.cs" /> <Compile Include="a2_Strategies\Eligibles\ByPriceMostLiquidAlwaysQuoted.cs" /> <Compile Include="a2_Strategies\Eligibles\EligibleTickers.cs" /> *************** *** 71,74 **** --- 72,76 ---- <Compile Include="a2_Strategies\IEndOfDayStrategyForBacktester.cs" /> <Compile Include="a2_Strategies\IInSampleChooser.cs" /> + <Compile Include="a2_Strategies\InSample\ConstantWeightedPositionsChooser.cs" /> <Compile Include="a2_Strategies\Logging\BackTestLog.cs" /> <Compile Include="a2_Strategies\Logging\LogItem.cs" /> *************** *** 223,226 **** --- 225,229 ---- <Folder Include="a2_Strategies\Eligibles" /> <Folder Include="a2_Strategies\EquityEvaluation" /> + <Folder Include="a2_Strategies\InSample" /> <Folder Include="a2_Strategies\Logging" /> <Folder Include="a2_Strategies\Optimizing" /> |
|
From: Glauco S. <gla...@us...> - 2008-02-07 18:12:20
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12124/b4_Business Modified Files: b4_Business.csproj Log Message: a2_Strategies\Eligibles\ByPriceMostLiquidAlwaysQuoted.cs has been added a2_Strategies\Eligibles\DummyEligibleSelector.cs has been added a2_Strategies\InSample\ConstantWeightedPositionsChooser.cs has been added Index: b4_Business.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** b4_Business.csproj 6 Feb 2008 23:23:00 -0000 1.51 --- b4_Business.csproj 7 Feb 2008 18:12:14 -0000 1.52 *************** *** 688,691 **** --- 688,701 ---- /> <File + RelPath = "a2_Strategies\Eligibles\ByPriceMostLiquidAlwaysQuoted.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "a2_Strategies\Eligibles\DummyEligibleSelector.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a2_Strategies\Eligibles\EligibleTickers.cs" SubType = "Code" *************** *** 723,726 **** --- 733,741 ---- /> <File + RelPath = "a2_Strategies\InSample\ConstantWeightedPositionsChooser.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a2_Strategies\Logging\BackTestLog.cs" SubType = "Code" |
|
From: Glauco S. <gla...@us...> - 2008-02-07 18:10:10
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10161 Added Files: ConstantWeightedPositionsChooser.cs Log Message: This chooser returns always the same WeightedPositions (to be used for log item's debugging and/or for data snooping) --- NEW FILE: ConstantWeightedPositionsChooser.cs --- /* QuantProject - Quantitative Finance Library ConstantWeightedPositionsChooser.cs Copyright (C) 2008 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.Messaging; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.Eligibles; using QuantProject.Business.Strategies.ReturnsManagement; namespace QuantProject.Business.Strategies.InSample { /// <summary> /// This chooser returns always the same WeightedPositions /// (to be used for log item's debugging and/or for data snooping) /// </summary> public class ConstantWeightedPositionsChooser : IInSampleChooser { public event NewMessageEventHandler NewMessage; public event NewProgressEventHandler NewProgress; private WeightedPositions weightedPositions; public string Description { get{ return "ConstantWeightedPositions"; } } public ConstantWeightedPositionsChooser( WeightedPositions weightedPositions ) { this.weightedPositions = weightedPositions; } public object AnalyzeInSample( EligibleTickers eligibleTickers , ReturnsManager returnsManager ) { if ( this.NewMessage != null ) this.NewMessage( this , new NewMessageEventArgs( "New" ) ); if ( this.NewProgress != null ) this.NewProgress( this , new NewProgressEventArgs( 1 , 1 ) ); return this.weightedPositions; } } } |
|
From: Glauco S. <gla...@us...> - 2008-02-07 18:09:17
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9897/InSample Log Message: Directory /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample added to the repository |
|
From: Glauco S. <gla...@us...> - 2008-02-07 18:08:37
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9282/b4_Business/a2_Strategies/Eligibles Added Files: DummyEligibleSelector.cs Log Message: Selects no tickers at all. To be used for log item's debugging --- NEW FILE: DummyEligibleSelector.cs --- /* QuantProject - Quantitative Finance Library DummyEligibleSelector.cs Copyright (C) 2008 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.Data; using QuantProject.ADT.Messaging; using QuantProject.Business.Strategies.ReturnsManagement.Time; using QuantProject.Business.Timing; using QuantProject.Data.Selectors; namespace QuantProject.Business.Strategies.Eligibles { /// <summary> /// Selects no tickers at all. To be used for log item's /// debugging /// </summary> public class DummyEligibleSelector : IEligiblesSelector { public event NewMessageEventHandler NewMessage; public string Description { get { return "Elgbls_dummy"; } } /// <summary> /// Returns an empty EligibleTickers object /// </summary> /// <param name="groupID"></param> public DummyEligibleSelector() { } public EligibleTickers GetEligibleTickers( EndOfDayHistory endOfDayHistory ) { if ( this.NewMessage != null ) this.NewMessage( this , new NewMessageEventArgs( "NewEligibles" ) ); EligibleTickers eligibleTickers = new EligibleTickers( new DataTable() ); // eligibleTickers = eligibleTickers; return eligibleTickers; } } } |
|
From: Glauco S. <gla...@us...> - 2008-02-07 17:12:32
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32632/b3_Data Modified Files: b3_Data.csproj Log Message: Minor VSNet automatic change Index: b3_Data.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/b3_Data.csproj,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** b3_Data.csproj 29 Aug 2007 10:32:54 -0000 1.51 --- b3_Data.csproj 7 Feb 2008 17:12:16 -0000 1.52 *************** *** 144,148 **** <File RelPath = "ExtendedDataTable.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 144,148 ---- <File RelPath = "ExtendedDataTable.cs" ! SubType = "Component" BuildAction = "Compile" /> |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:23:11
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3746/b5_Presentation Modified Files: b5_Presentation.csproj Presentation_SD.csproj Log Message: Updated projects files for VS Net and SharpDevelop Index: b5_Presentation.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/b5_Presentation.csproj,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** b5_Presentation.csproj 19 Jan 2008 18:26:09 -0000 1.40 --- b5_Presentation.csproj 6 Feb 2008 23:23:00 -0000 1.41 *************** *** 220,223 **** --- 220,233 ---- /> <File + RelPath = "Reporting\WindowsForm\ReportTabControl.resx" + DependentUpon = "ReportTabControl.cs" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "Reporting\WindowsForm\StatisticsSummaryTabPage.cs" + SubType = "Component" + BuildAction = "Compile" + /> + <File RelPath = "Reporting\WindowsForm\SummaryItem.cs" SubType = "Code" Index: Presentation_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Presentation_SD.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Presentation_SD.csproj 19 Jan 2008 18:26:34 -0000 1.3 --- Presentation_SD.csproj 6 Feb 2008 23:23:00 -0000 1.4 *************** *** 74,77 **** --- 74,78 ---- <Compile Include="Reporting\WindowsForm\ReportShower.cs" /> <Compile Include="Reporting\WindowsForm\ReportTabControl.cs" /> + <Compile Include="Reporting\WindowsForm\StatisticsSummaryTabPage.cs" /> <Compile Include="Reporting\WindowsForm\SummaryTabPage.cs" /> <Compile Include="Reporting\WindowsForm\AccountViewer.cs" /> |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:23:07
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3746/b4_Business Modified Files: b4_Business.csproj Business_SD.csproj Log Message: Updated projects files for VS Net and SharpDevelop Index: Business_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/Business_SD.csproj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Business_SD.csproj 19 Jan 2008 18:21:08 -0000 1.8 --- Business_SD.csproj 6 Feb 2008 23:23:00 -0000 1.9 *************** *** 60,65 **** --- 60,68 ---- <Compile Include="a05_Timing\EndOfDayHistory.cs" /> <Compile Include="a07_DataProviders\HistoricalQuoteProvider.cs" /> + <Compile Include="a1_Financial\a2_Accounting\h5_Reporting\StatisticsSummaryRows\AverageReturnOnMonday.cs" /> <Compile Include="a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\AverageNumberOfTransactionsPerDay.cs" /> + <Compile Include="a1_Financial\a2_Accounting\h5_Reporting\Tables\StatisticsSummary.cs" /> <Compile Include="a2_Strategies\Benchmark.cs" /> + <Compile Include="a2_Strategies\Eligibles\ByPriceMostLiquidAlwaysQuoted.cs" /> <Compile Include="a2_Strategies\Eligibles\EligibleTickers.cs" /> <Compile Include="a2_Strategies\Eligibles\IEligiblesSelector.cs" /> *************** *** 71,76 **** --- 74,83 ---- <Compile Include="a2_Strategies\Logging\LogItem.cs" /> <Compile Include="a2_Strategies\Logging\NewLogItemEventArgs.cs" /> + <Compile Include="a2_Strategies\Optimizing\Decoding\BasicDecoderForTestingPositions.cs" /> <Compile Include="a2_Strategies\Optimizing\Decoding\DecoderForBalancedWeightedPositions.cs" /> + <Compile Include="a2_Strategies\Optimizing\Decoding\DecoderForTestingPositionsWithBalancedWeights.cs" /> + <Compile Include="a2_Strategies\Optimizing\Decoding\IDecoderForTestingPositions.cs" /> <Compile Include="a2_Strategies\Optimizing\Decoding\IDecoderForWeightedPositions.cs" /> + <Compile Include="a2_Strategies\OutOfSample\TestingPositions.cs" /> <Compile Include="a2_Strategies\returnsManagement\time\CloseToCloseIntervals.cs" /> <Compile Include="a2_Strategies\returnsManagement\time\CloseToOpenIntervals.cs" /> *************** *** 83,86 **** --- 90,94 ---- <Compile Include="a2_Strategies\TickersRelationships\CloseToCloseCorrelationProvider.cs" /> <Compile Include="a2_Strategies\TickersRelationships\CorrelationProvider.cs" /> + <Compile Include="a2_Strategies\TickersRelationships\MissingCorrelationException.cs" /> <Compile Include="a2_Strategies\TickersRelationships\OpenToCloseCorrelationProvider.cs" /> <Compile Include="a2_Strategies\TickersRelationships\TickersPearsonCorrelation.cs" /> *************** *** 211,214 **** --- 219,224 ---- <Name>b3_Data</Name> </ProjectReference> + <Folder Include="a1_Financial\a2_Accounting\h5_Reporting\StatisticsSummaryRows" /> + <Folder Include="a2_Strategies\OutOfSample" /> <Folder Include="a2_Strategies\Eligibles" /> <Folder Include="a2_Strategies\EquityEvaluation" /> Index: b4_Business.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** b4_Business.csproj 19 Jan 2008 18:12:17 -0000 1.50 --- b4_Business.csproj 6 Feb 2008 23:23:00 -0000 1.51 *************** *** 363,366 **** --- 363,371 ---- /> <File + RelPath = "a1_Financial\a2_Accounting\h5_Reporting\StatisticsSummaryRows\AverageReturnOnMonday.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\AnnualSystemPercentageReturn.cs" SubType = "Code" *************** *** 528,531 **** --- 533,541 ---- /> <File + RelPath = "a1_Financial\a2_Accounting\h5_Reporting\Tables\StatisticsSummary.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a1_Financial\a2_Accounting\h5_Reporting\Tables\Summary.cs" SubType = "Code" *************** *** 728,731 **** --- 738,746 ---- /> <File + RelPath = "a2_Strategies\Optimizing\Decoding\BasicDecoderForTestingPositions.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a2_Strategies\Optimizing\Decoding\DecoderForBalancedWeightedPositions.cs" SubType = "Code" *************** *** 733,736 **** --- 748,761 ---- /> <File + RelPath = "a2_Strategies\Optimizing\Decoding\DecoderForTestingPositionsWithBalancedWeights.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "a2_Strategies\Optimizing\Decoding\IDecoderForTestingPositions.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a2_Strategies\Optimizing\Decoding\IDecoderForWeightedPositions.cs" SubType = "Code" *************** *** 738,741 **** --- 763,771 ---- /> <File + RelPath = "a2_Strategies\OutOfSample\TestingPositions.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a2_Strategies\returnsManagement\ReturnsManager.cs" SubType = "Code" *************** *** 793,796 **** --- 823,831 ---- /> <File + RelPath = "a2_Strategies\TickersRelationships\MissingCorrelationException.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a2_Strategies\TickersRelationships\OpenToCloseCorrelationProvider.cs" SubType = "Code" |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:20:18
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2663/Reporting/WindowsForm Added Files: StatisticsSummaryTabPage.cs Log Message: Added a new TabPage to the Report: StatisticsSummaryTabPAge, that should contain statistics of various kind (it is just an extension of the SummaryTabPage) --- NEW FILE: StatisticsSummaryTabPage.cs --- /* QuantProject - Quantitative Finance Library StatisticsSummaryTabPage.cs Copyright (C) 2008 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.Collections; using System.Drawing; using System.Reflection; using System.Windows.Forms; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting.Reporting; using QuantProject.Business.Financial.Accounting.Reporting.SummaryRows; using QuantProject.Presentation; namespace QuantProject.Presentation.Reporting.WindowsForm { /// <summary> /// TabPage to show a summary of statistics of various type within the report form /// </summary> [Serializable] public class StatisticsSummaryTabPage : TabPage { // constant values for label's placement private int labelRows = 14; private int xForLabels = 17; private int textLabelsWidth = 180; private int valueLablesWidth = 60; private int textToValueLabelSpacing = 8; private int valueToTextLabelSpacing = 50; private int yStart = 17; private int yStep = 25; private ArrayList summaryItems; /// <summary> /// used just to apply the GetType method /// </summary> private SummaryRow summaryRow; private AccountReport accountReport; private Point getPointForTextLabel( int labelPosition ) { int x,y; if ( labelPosition < this.labelRows ) { x = this.xForLabels; y = this.yStart + labelPosition * this.yStep; } else { x = this.xForLabels + this.textLabelsWidth + this.textToValueLabelSpacing + this.valueLablesWidth + this.valueToTextLabelSpacing; y = this.yStart + ( labelPosition - this.labelRows ) * this.yStep; } return new Point( x , y ); } private void addTextLabel( Label label , string name , string text ) { this.Controls.Add( label ); // label.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; label.Location = getPointForTextLabel( ( this.Controls.Count - 1 ) / 2 ); label.Width = this.textLabelsWidth; label.Name = name; label.Text = text; label.TextAlign = System.Drawing.ContentAlignment.MiddleRight; } private void addValueLabel( Label label , string name ) { this.Controls.Add( label ); // label.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; label.Location = getPointForValueLabel( ( this.Controls.Count / 2 ) - 1 ); label.Width = this.valueLablesWidth; label.Name = name; label.TextAlign = System.Drawing.ContentAlignment.MiddleRight; } private void addTextLabel( Label label ) { this.Controls.Add( label ); // label.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; label.Location = getPointForTextLabel( ( this.Controls.Count - 1 ) / 2 ); label.Width = this.textLabelsWidth; label.TextAlign = System.Drawing.ContentAlignment.MiddleRight; } private void addValueLabel( Label label ) { this.Controls.Add( label ); // label.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; label.Location = getPointForValueLabel( ( this.Controls.Count / 2 ) - 1 ); label.Width = this.valueLablesWidth; label.TextAlign = System.Drawing.ContentAlignment.MiddleRight; } private Point getPointForValueLabel( int labelPosition ) { Point point = getPointForTextLabel( labelPosition ); point.X += this.textLabelsWidth + this.textToValueLabelSpacing; return point; } private void myInitializeComponent_addItem( SummaryItem summaryItem ) { this.addTextLabel( summaryItem.Description ); this.addValueLabel( summaryItem.Value ); } private void myInitializeComponent_addSummaryRow( PropertyInfo propertyInfo ) { Object ob = propertyInfo.GetValue( this.accountReport.StatisticsSummary , null ); if ( ob is SummaryRow ) { this.summaryItems.Add( new SummaryItem( (SummaryRow)ob ) ); } } private void myInitializeComponent_addSummaryRows() { if(this.accountReport.StatisticsSummary != null) //if the StatisticsSummary has been created or deserialized foreach ( PropertyInfo summaryProperty in this.accountReport.StatisticsSummary.GetType().GetProperties() ) myInitializeComponent_addSummaryRow( summaryProperty ); } private void myInitializeComponent() { this.summaryItems = new ArrayList(); myInitializeComponent_addSummaryRows(); foreach( SummaryItem summaryItem in this.summaryItems ) this.myInitializeComponent_addItem( summaryItem ); } public StatisticsSummaryTabPage( AccountReport accountReport ) { this.accountReport = accountReport; this.summaryRow = new SummaryRow(); this.myInitializeComponent(); this.Text = "StatisticsSummary"; // this.setSummaryValues(); } } } |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:17:55
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1318/Reporting/WindowsForm Modified Files: ReportGridTabPage.cs Log Message: Added the Serializable interface Index: ReportGridTabPage.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/ReportGridTabPage.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReportGridTabPage.cs 4 Jun 2005 15:21:27 -0000 1.3 --- ReportGridTabPage.cs 6 Feb 2008 23:17:48 -0000 1.4 *************** *** 29,32 **** --- 29,33 ---- /// Report TabPage, to contain a ReportGrid /// </summary> + [Serializable] public class ReportGridTabPage : TabPage { |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:17:28
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1288/Reporting/WindowsForm Modified Files: EquityChartTabPage.cs Log Message: Added the Serializable interface Index: EquityChartTabPage.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/EquityChartTabPage.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EquityChartTabPage.cs 31 May 2006 14:35:16 -0000 1.7 --- EquityChartTabPage.cs 6 Feb 2008 23:17:23 -0000 1.8 *************** *** 35,38 **** --- 35,39 ---- /// TabPage for the equity chart for the report form /// </summary> + [Serializable] public class EquityChartTabPage : TabPage { |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:16:56
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv809/Reporting/WindowsForm Modified Files: ReportTabControl.cs Log Message: Implemented the ISerializable interface, for allowing custom deserialization Index: ReportTabControl.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/ReportTabControl.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ReportTabControl.cs 31 May 2006 14:24:58 -0000 1.4 --- ReportTabControl.cs 6 Feb 2008 23:16:39 -0000 1.5 *************** *** 21,24 **** --- 21,26 ---- */ using System; + using System.Runtime.Serialization; + using System.Reflection; using System.Windows.Forms; *************** *** 31,35 **** /// TabControl for the report form /// </summary> ! public class ReportTabControl : TabControl { private AccountReport accountReport; --- 33,38 ---- /// TabControl for the report form /// </summary> ! [Serializable] ! public class ReportTabControl : TabControl, ISerializable { private AccountReport accountReport; *************** *** 39,42 **** --- 42,46 ---- private ReportGridTabPage equity; private ReportGridTabPage transactions; + private StatisticsSummaryTabPage statisticsSummary; public ReportGrid TransactionGrid *************** *** 48,51 **** --- 52,105 ---- get { return this.equityChart.EquityChart; } } + + /// <summary> + /// This constructor allows custom deserialization (see the ISerializable + /// interface documentation) + /// </summary> + /// <param name="info"></param> + /// <param name="context"></param> + protected ReportTabControl( SerializationInfo info , StreamingContext context ) : + base() + { + // get the set of serializable members for this class and its base classes + Type thisType = this.GetType(); + MemberInfo[] mi = FormatterServices.GetSerializableMembers( + thisType , context); + + // deserialize the fields from the info object + for (Int32 i = 0 ; i < mi.Length; i++) + { + FieldInfo fieldInfo = (FieldInfo) mi[i]; + + // set the field to the deserialized value + try + { + fieldInfo.SetValue( this , + info.GetValue( fieldInfo.Name, fieldInfo.FieldType ) ); + } + catch(Exception ex) + {ex = ex;} + } + } + + /// <summary> + /// serialize the set of serializable members for this class and base classes + /// </summary> + /// <param name="info"></param> + /// <param name="context"></param> + void ISerializable.GetObjectData( + SerializationInfo info, StreamingContext context) + { + // get the set of serializable members for this class and base classes + Type thisType = this.GetType(); + MemberInfo[] mi = + FormatterServices.GetSerializableMembers( thisType , context); + + // serialize the fields to the info object + for (Int32 i = 0 ; i < mi.Length; i++) + { + info.AddValue(mi[i].Name, ((FieldInfo) mi[i]).GetValue(this)); + } + } /// <summary> *************** *** 74,77 **** --- 128,133 ---- "Transactions" , this.accountReport.TransactionTable ); this.Controls.Add( this.transactions ); + this.statisticsSummary = new StatisticsSummaryTabPage( this.accountReport ); + this.Controls.Add( this.statisticsSummary ); } } |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:14:53
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31948/Reporting/WindowsForm Modified Files: SummaryItem.cs Log Message: Added the serializable attribute Index: SummaryItem.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/SummaryItem.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SummaryItem.cs 19 Jun 2005 15:03:19 -0000 1.1 --- SummaryItem.cs 6 Feb 2008 23:14:48 -0000 1.2 *************** *** 31,34 **** --- 31,35 ---- /// A summary item: it contains both the item label and the item value /// </summary> + [Serializable] public class SummaryItem { |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:14:26
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31871/Reporting/WindowsForm Modified Files: SummaryTabPage.cs Log Message: Added the serializable attribute Index: SummaryTabPage.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/SummaryTabPage.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SummaryTabPage.cs 8 Jun 2006 18:40:28 -0000 1.8 --- SummaryTabPage.cs 6 Feb 2008 23:14:17 -0000 1.9 *************** *** 35,38 **** --- 35,39 ---- /// TabPage to show the summary within the report form /// </summary> + [Serializable] public class SummaryTabPage : TabPage { |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:13:52
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31415/Reporting/WindowsForm Modified Files: ReportGrid.cs Log Message: Added the serializable attribute Index: ReportGrid.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/ReportGrid.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReportGrid.cs 8 Aug 2004 13:40:21 -0000 1.1 --- ReportGrid.cs 6 Feb 2008 23:13:48 -0000 1.2 *************** *** 29,32 **** --- 29,33 ---- /// DataGrid to be displayed within a report TabPage /// </summary> + [Serializable] public class ReportGrid : DataGrid { |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:11:33
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Optimizing/Decoding In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30261/a2_Strategies/Optimizing/Decoding Added Files: BasicDecoderForTestingPositions.cs DecoderForTestingPositionsWithBalancedWeights.cs Log Message: Added two general IDecoderForTestingPositions, that should be inherited by IDecoderForTestingPositions specific to strategies --- NEW FILE: DecoderForTestingPositionsWithBalancedWeights.cs --- /* QuantProject - Quantitative Finance Library DecoderForTestingPositionsWithBalancedWeights.cs Copyright (C) 2008 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 QuantProject.Business.Strategies; namespace QuantProject.Business.Strategies.Optimizing.Decoding { /// <summary> /// Decodes optimization candidates to a /// TestingPositions /// In this implementation, weights are balanced on volatility base /// </summary> public class DecoderForTestingPositionsWithBalancedWeights : BasicDecoderForTestingPositions { public DecoderForTestingPositionsWithBalancedWeights() { } protected override double[] getWeights() { return WeightedPositions.GetBalancedWeights( this.decodeSignedTickers(), this.returnsManager ); } } } --- NEW FILE: BasicDecoderForTestingPositions.cs --- /* QuantProject - Quantitative Finance Library BasicDecoderForTestingPositions.cs Copyright (C) 2008 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.Optimizing.Decoding; using QuantProject.Business.Financial.Accounting; using QuantProject.Business.Strategies.Eligibles; using QuantProject.Business.Strategies.OutOfSample; using QuantProject.Business.Strategies.ReturnsManagement; namespace QuantProject.Business.Strategies.Optimizing.Decoding { /// <summary> /// Decodes optimization candidates to a plain /// TestingPositions /// In this implementation, with the encoded items /// can be decoded only tickers /// </summary> public class BasicDecoderForTestingPositions : IDecoderForTestingPositions { protected int[] tickerRelatedGeneValues; protected int[] encoded; protected EligibleTickers eligibleTickers; protected ReturnsManager returnsManager; public BasicDecoderForTestingPositions() { } #region decodeSignedTickers private void decodeSignedTicker_checkParameters( int geneValue ) { if ( geneValue >= this.eligibleTickers.Count ) throw new Exception( "geneValue is too (positive) large for eligibleTickers !!" ); if ( geneValue < -this.eligibleTickers.Count ) throw new Exception( "geneValue is too (negative) large for eligibleTickers !!" ); } private SignedTicker decodeSignedTickers( int i ) { int signedTickerCode = this.tickerRelatedGeneValues[ i ]; SignedTicker signedTicker; string ticker; decodeSignedTicker_checkParameters( signedTickerCode ); if ( signedTickerCode >= 0 ) { // long ticker ticker = this.eligibleTickers[ signedTickerCode ]; signedTicker = new SignedTicker( ticker , PositionType.Long ); } else { // short ticker ticker = this.eligibleTickers[ -(signedTickerCode+1) ]; signedTicker = new SignedTicker( ticker , PositionType.Short ); } return signedTicker; } protected SignedTickers decodeSignedTickers() { SignedTickers signedTickers = new SignedTickers(); for( int i = 0 ; i < this.tickerRelatedGeneValues.Length ; i++ ) { SignedTicker signedTicker = this.decodeSignedTickers( i ); signedTickers.Add( signedTicker ); } return signedTickers; } #endregion decodeSignedTickers #region isDecodable private string[] getTickersForPositions() { SignedTickers signedTickersForPositions = this.decodeSignedTickers(); return signedTickersForPositions.Tickers; } private bool isDecodable() { return ( WeightedPositions.AreValidTickers( this.getTickersForPositions() ) ); } #endregion isDecodable #region decodeDecodable protected virtual double[] getWeights() { //in this implementation encoded doesn't contain //information for weights: so weights are all the same double[] weights = new double[this.encoded.Length]; for(int i = 0; i<weights.Length; i++) weights[i] = 1.0 / weights.Length; return weights; } protected virtual TestingPositions decodeDecodable() { SignedTickers signedTickers = this.decodeSignedTickers(); TestingPositions testingPositions = new TestingPositions( new WeightedPositions( this.getWeights(), signedTickers) ); return testingPositions; } #endregion decodeDecodable protected virtual void setTickerRelatedGeneValues() { this.tickerRelatedGeneValues = this.encoded; //in this implementation all encoded contains //information only for tickers } private void decode_updateProtectedMembers(int[] encoded , EligibleTickers eligibleTickers , ReturnsManager returnsManager) { this.encoded = encoded; this.eligibleTickers = eligibleTickers; this.returnsManager = returnsManager; } /// <summary> /// A positive array value means a long position. /// A negative array value means a short position. /// The positive value n means the same ticker as the value -(n+1). /// Thus, if there are p (>0) eligible tickers, array values should /// range from -p to p-1 /// </summary> /// <param name="encoded"></param> /// <returns></returns> public TestingPositions Decode(int[] encoded , EligibleTickers eligibleTickers , ReturnsManager returnsManager) { this.setTickerRelatedGeneValues(); this.decode_updateProtectedMembers(encoded , eligibleTickers , returnsManager); TestingPositions meaning = new TestingPositions(); if ( this.isDecodable() ) // encoded, normally a Genome, can be decoded to a TestingPositions meaning = this.decodeDecodable(); return meaning; } } } |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:09:05
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Optimizing/Decoding In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28693/a2_Strategies/Optimizing/Decoding Added Files: IDecoderForTestingPositions.cs Log Message: Added IDecoderForTestingPositions. Objects belonging to this type are used for decoding genomes (during genetic or brute force optimization) to TestingPositions --- NEW FILE: IDecoderForTestingPositions.cs --- /* QuantProject - Quantitative Finance Library IDecoderForTestingPositions.cs Copyright (C) 2008 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 QuantProject.Business.Strategies.Eligibles; using QuantProject.Business.Strategies.OutOfSample; using QuantProject.Business.Strategies.ReturnsManagement; namespace QuantProject.Business.Strategies.Optimizing.Decoding { /// <summary> /// Interface to be implemented by decoders for optimizers (both for /// genetic and for brute force optimizers) that will return a /// StrategyPositionsForTesting /// </summary> public interface IDecoderForTestingPositions { /// <summary> /// Decodes to a TestingPositions, an /// object that is a candidate for an out of sample /// testing /// </summary> TestingPositions Decode( int[] encoded , EligibleTickers eligibleTickers , ReturnsManager returnsManager ); } } |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:05:53
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/OutOfSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27391/a2_Strategies/OutOfSample Added Files: TestingPositions.cs Log Message: Added TestingPositions class. Out of sample testing should be done using a TestingPositions object or an object inherited from TestingPositions (directly or not) --- NEW FILE: TestingPositions.cs --- /* QuantProject - Quantitative Finance Library TestingPositions.cs Copyright (C) 2008 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.Collections; using QuantProject.Business.Strategies; namespace QuantProject.Business.Strategies.OutOfSample { /// <summary> /// This is the base class representing positions that /// should be tested out of sample in a back test /// Every strategy should test out of sample an object /// of this type or an object derived from this class /// </summary> [Serializable] public class TestingPositions { private WeightedPositions weightedPositions; private string hashCodeForTickerComposition; public WeightedPositions WeightedPositions { get{return this.weightedPositions;} } public string HashCodeForTickerComposition { get { if(this.hashCodeForTickerComposition == null && this.weightedPositions != null) //if hashCodeForTickerComposition has not been computed yet and //the current instance is not empty { ArrayList listOfTickers = new ArrayList(this.weightedPositions.SignedTickers.Tickers); listOfTickers.Sort(); foreach(string tickerCode in listOfTickers) this.hashCodeForTickerComposition += tickerCode; } return this.hashCodeForTickerComposition; } } public TestingPositions(WeightedPositions weightedPositions) { this.weightedPositions = weightedPositions; } //it creates a empty TestingPositions public TestingPositions() { this.weightedPositions = null; } } } |
|
From: Marco M. <mi...@us...> - 2008-02-06 23:03:23
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/returnsManagement/time In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26512/a2_Strategies/returnsManagement/time Modified Files: ReturnIntervals.cs Log Message: Added a new constructor to the class, for creating a ReturnIntervals object with just one returnInterval Index: ReturnIntervals.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/returnsManagement/time/ReturnIntervals.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ReturnIntervals.cs 19 Jan 2008 19:22:57 -0000 1.5 --- ReturnIntervals.cs 6 Feb 2008 23:03:15 -0000 1.6 *************** *** 153,156 **** --- 153,164 ---- } + /// <summary> + /// It creates a ReturnIntervals with just a ReturnInterval + /// </summary> + public ReturnIntervals( ReturnInterval returnInterval ) + { + this.Add( returnInterval ); + } + protected virtual void setMarketDaysForBenchmark() { |