quantproject-developers Mailing List for QuantProject (Page 88)
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...> - 2006-06-08 21:11:46
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27667/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Added Files: ExpectancyScore.cs Log Message: Summary row containing the Expectancy Score calculation for the account report equity line --- NEW FILE: ExpectancyScore.cs --- /* QuantProject - Quantitative Finance Library ExpectancyScore.cs Copyright (C) 2003 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Collections; using QuantProject.ADT.Histories; using QuantProject.ADT.Statistics; using QuantProject.Business.Financial.Accounting.Reporting.Tables; namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryRows { /// <summary> /// Summary row containing the Expectancy Score calculation for /// the account report equity line /// </summary> [Serializable] public class ExpectancyScore : DoubleSummaryRow { private ArrayList getReturns( EquityLine equityLine ) { ArrayList returnValue = new ArrayList(); for ( int i=0 ; i < equityLine.Count - 1 ; i++ ) { if ( Convert.ToDouble( equityLine.GetByIndex( i ) ) <= 0 ) throw new Exception( "Equity line is expected to always being " + "strictly positive. equityLine[ i ] is negative or equal to zero!" ); double periodReturn = ( Convert.ToDouble( equityLine.GetByIndex( i + 1 ) ) - Convert.ToDouble( equityLine.GetByIndex( i ) ) ) / Convert.ToDouble( equityLine.GetByIndex( i ) ); returnValue.Add( periodReturn ); } return returnValue; } public ExpectancyScore( EquityLine equityLine ) : base( 6 ) { this.rowDescription = "Expectancy Score"; ICollection returns = equityLine.GetReturns().Values; this.rowValue = AdvancedFunctions.GetExpectancyScore( returns ); } } } |
|
From: Glauco S. <gla...@us...> - 2006-06-08 21:10:27
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27109/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Added Files: NumberNegativePeriods.cs Log Message: Summary row that computes the number of strategy returns less than zero --- NEW FILE: NumberNegativePeriods.cs --- /* QuantProject - Quantitative Finance Library NumberNegativePeriods.cs Copyright (C) 2003 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Data; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting.Reporting.Tables; using QuantProject.Business.Financial.Instruments; namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryRows { /// <summary> /// Summary row that computes the number of strategy returns less than zero /// </summary> [Serializable] public class NumberNegativePeriods : IntegerSummaryRow { public NumberNegativePeriods( Summary summary ) : base() { this.rowDescription = "# negative periods"; this.format = ConstantsProvider.FormatWithZeroDecimals; this.rowValue = summary.NumberWinningPeriods.NumberNegativePeriods; } } } |
|
From: Glauco S. <gla...@us...> - 2006-06-08 21:09:47
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26611/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Added Files: NumberPositivePeriods.cs Log Message: Summary row that computes the number of strategy returns greater than zero --- NEW FILE: NumberPositivePeriods.cs --- /* QuantProject - Quantitative Finance Library NumberPositivePeriods.cs Copyright (C) 2003 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Data; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting.Reporting.Tables; using QuantProject.Business.Financial.Instruments; namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryRows { /// <summary> /// Summary row that computes the number of strategy returns greater than zero /// </summary> [Serializable] public class NumberPositivePeriods : IntegerSummaryRow { public NumberPositivePeriods( Summary summary ) : base() { this.rowDescription = "# positive periods"; this.format = ConstantsProvider.FormatWithZeroDecimals; this.rowValue = summary.NumberWinningPeriods.NumberPositivePeriods; } } } |
|
From: Glauco S. <gla...@us...> - 2006-06-08 21:09:23
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26503/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Added Files: PercentagePositivePeriods.cs Log Message: Summary row that computes the percentage of strategy returns greater than zero --- NEW FILE: PercentagePositivePeriods.cs --- /* QuantProject - Quantitative Finance Library PercentagePositivePeriods.cs Copyright (C) 2003 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Data; using QuantProject.ADT; using QuantProject.Business.Financial.Accounting.Reporting.Tables; using QuantProject.Business.Financial.Instruments; namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryRows { /// <summary> /// Summary row that computes the percentage of strategy /// returns greater than zero /// </summary> [Serializable] public class PercentagePositivePeriods : PercentageSummaryRow { public PercentagePositivePeriods( Summary summary ) { this.rowDescription = "% positive periods"; this.rowValue = (double)summary.NumberPositivePeriods.Value * 100/ ((double)summary.NumberPositivePeriods.Value + (double)summary.NumberNegativePeriods.Value); } } } |
|
From: Glauco S. <gla...@us...> - 2006-06-08 18:48:59
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25453/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Modified Files: DoubleSummaryRow.cs Log Message: a format string for 6 decimals has been added (a general method should be implemented; in the to do list) Index: DoubleSummaryRow.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/DoubleSummaryRow.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DoubleSummaryRow.cs 19 Jun 2005 15:09:28 -0000 1.1 --- DoubleSummaryRow.cs 8 Jun 2006 18:48:50 -0000 1.2 *************** *** 43,46 **** --- 43,49 ---- this.format = ConstantsProvider.FormatWithTwoDecimals; break; + case 6: + this.format = ConstantsProvider.FormatWithSixDecimals; + break; } } |
|
From: Glauco S. <gla...@us...> - 2006-06-08 18:47:56
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Charting In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24962/b5_Presentation/Charting Modified Files: Chart.cs Log Message: a console directed old debug message has been removed Index: Chart.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Charting/Chart.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Chart.cs 3 Apr 2005 00:04:41 -0000 1.6 --- Chart.cs 8 Jun 2006 18:47:40 -0000 1.7 *************** *** 116,120 **** protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { ! Console.WriteLine( "Chart.OnPaint()" ); // foreach ( ChartPlot chartPlot in this.chartPlots ) // onPaint_addLinePlot_ok( chartPlot ); --- 116,120 ---- protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { ! // Console.WriteLine( "Chart.OnPaint()" ); // foreach ( ChartPlot chartPlot in this.chartPlots ) // onPaint_addLinePlot_ok( chartPlot ); |
|
From: Glauco S. <gla...@us...> - 2006-06-08 18:47:02
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24529/b1_ADT Modified Files: ConstantsProvider.cs Log Message: a format string for 6 decimals has been added (a general method should be implemented; in the to do list) Index: ConstantsProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ConstantsProvider.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ConstantsProvider.cs 2 Jun 2006 18:55:58 -0000 1.16 --- ConstantsProvider.cs 8 Jun 2006 18:46:53 -0000 1.17 *************** *** 29,32 **** --- 29,33 ---- public static string FormatWithOneDecimal = "#,#.0"; public static string FormatWithTwoDecimals = "#,#.00"; + public static string FormatWithSixDecimals = "#,#.000000"; public static DateTime MinQuoteDateTime = new DateTime( 1950 , 1 , 1 ); public static int CachePages = 1000; |
|
From: Glauco S. <gla...@us...> - 2006-06-08 18:45:43
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24026/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Modified Files: NumberWinningPeriods.cs Log Message: a format string for 6 decimals has been added (a general method should be implemented; in the to do list) Index: NumberWinningPeriods.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/NumberWinningPeriods.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NumberWinningPeriods.cs 15 Oct 2005 18:11:54 -0000 1.4 --- NumberWinningPeriods.cs 8 Jun 2006 18:45:28 -0000 1.5 *************** *** 40,43 **** --- 40,46 ---- private double numberLosingPeriods; private double numberEvenPeriods; + private double numberPositivePeriods; + private double numberNegativePeriods; + private double numberZeroPeriods; private void setWinningLosingAndEvenPeriods_forPeriod( int i ) *************** *** 60,70 **** this.numberEvenPeriods++; } } ! public void SetWinningLosingAndEvenPeriods() { this.numberWinningPeriods = 0; this.numberLosingPeriods = 0; this.numberEvenPeriods = 0; for ( int i=0; i<this.summary.AccountReport.EquityLine.Count - 1 ; i++ ) this.setWinningLosingAndEvenPeriods_forPeriod( i ); --- 63,87 ---- this.numberEvenPeriods++; } + if ( equityHistoryGain < 0 ) + this.numberNegativePeriods ++; + else + { + if ( equityHistoryGain > 0 ) + this.numberPositivePeriods ++; + else + // equityHistoryGain == 0 + this.numberZeroPeriods ++; + } + } ! public void SetWinningLosingPositiveAndNegativePeriods() { this.numberWinningPeriods = 0; this.numberLosingPeriods = 0; this.numberEvenPeriods = 0; + this.numberPositivePeriods = 0; + this.numberNegativePeriods = 0; + this.numberZeroPeriods = 0; for ( int i=0; i<this.summary.AccountReport.EquityLine.Count - 1 ; i++ ) this.setWinningLosingAndEvenPeriods_forPeriod( i ); *************** *** 73,77 **** { this.summary = summary; ! this.SetWinningLosingAndEvenPeriods(); this.rowDescription = "# winning periods"; this.format = ConstantsProvider.FormatWithZeroDecimals; --- 90,94 ---- { this.summary = summary; ! this.SetWinningLosingPositiveAndNegativePeriods(); this.rowDescription = "# winning periods"; this.format = ConstantsProvider.FormatWithZeroDecimals; *************** *** 82,85 **** --- 99,110 ---- get { return this.numberLosingPeriods; } } + public double NumberPositivePeriods + { + get { return this.numberPositivePeriods; } + } + public double NumberNegativePeriods + { + get { return this.numberNegativePeriods; } + } } } |
|
From: Glauco S. <gla...@us...> - 2006-06-08 18:44:06
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/FileManaging In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23189/b1_ADT/FileManaging Modified Files: ObjectArchiver.cs Log Message: a catch clause has been added Index: ObjectArchiver.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/FileManaging/ObjectArchiver.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectArchiver.cs 4 Feb 2005 00:02:53 -0000 1.2 --- ObjectArchiver.cs 8 Jun 2006 18:43:57 -0000 1.3 *************** *** 64,80 **** object returnValue = null; ! try ! { ! ObjectArchiver.stream = new FileStream( ! fullPath, ! FileMode.Open, ! FileAccess.Read, ! FileShare.None); ! returnValue = ObjectArchiver.formatter.Deserialize(stream); ! } ! finally ! { ! ObjectArchiver.stream.Close(); ! } return returnValue; } --- 64,85 ---- object returnValue = null; ! try ! { ! ObjectArchiver.stream = new FileStream( ! fullPath, ! FileMode.Open, ! FileAccess.Read, ! FileShare.None); ! returnValue = ObjectArchiver.formatter.Deserialize(stream); ! } ! catch( Exception ex ) ! { ! string stringForBreakpoint = ex.Message; ! stringForBreakpoint = stringForBreakpoint; ! } ! finally ! { ! ObjectArchiver.stream.Close(); ! } return returnValue; } |
|
From: Glauco S. <gla...@us...> - 2006-06-08 18:42:56
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22632/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables Modified Files: Summary.cs Log Message: - property ExpectancyScore has been added - property NumberPositivePeriods has been added - property NumberNegativePeriods has been added - property PercentagePositivePeriods has been added Index: Summary.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables/Summary.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Summary.cs 15 Oct 2005 18:23:22 -0000 1.18 --- Summary.cs 8 Jun 2006 18:42:37 -0000 1.19 *************** *** 26,29 **** --- 26,30 ---- private MaxEquityDrawDown maxEquityDrawDown; private SharpeRatio sharpeRatio; + private ExpectancyScore expectancyScore; private TotalNumberOfTrades totalNumberOfTrades; private NumberWinningTrades numberWinningTrades; *************** *** 37,40 **** --- 38,44 ---- private TotalNumberOfShortTrades totalNumberOfShortTrades; private TotalCommissionAmount totalCommissionAmount; + private NumberPositivePeriods numberPositivePeriods; + private NumberNegativePeriods numberNegativePeriods; + private PercentagePositivePeriods percentagePositivePeriods; private NumberWinningPeriods numberWinningPeriods; private NumberLosingPeriods numberLosingPeriods; *************** *** 80,87 **** --- 84,110 ---- get { return this.sharpeRatio; } } + public ExpectancyScore ExpectancyScore + { + get { return this.expectancyScore; } + } public TotalCommissionAmount TotalCommissionAmount { get { return this.totalCommissionAmount; } } + public NumberPositivePeriods NumberPositivePeriods + { + get { return this.numberPositivePeriods; } + } + public NumberNegativePeriods NumberNegativePeriods + { + get { return this.numberNegativePeriods; } + } + public PercentagePositivePeriods PercentagePositivePeriods + { + get + { + return this.percentagePositivePeriods; + } + } public NumberWinningPeriods NumberWinningPeriods { *************** *** 146,151 **** { this.accountReport = accountReport; - this.numberWinningPeriods = new NumberWinningPeriods( this ); - this.numberLosingPeriods = new NumberLosingPeriods( this ); this.getSummary(); } --- 169,172 ---- *************** *** 168,241 **** equityDataTable.Columns.Add( "Value" , Type.GetType( "System.Double" ) ); } - #region "getSummaryTable_setRows" - // private void getSummary_setRow( SummaryRow summaryRow , DataTable summaryDataTable ) - // { - // if ( summaryRow.Value != null ) - // { - // DataRow summary = summaryDataTable.NewRow(); - // summary[ "Information" ] = summaryRow.Description; - // summary[ "Value" ] = summaryRow.Value; - // summaryDataTable.Rows.Add( summary ); - // } - // } - // private void getSummaryTable_setRows( DataTable summaryDataTable ) - // { - //// getSummary_setRow( new TotalNetProfit( this ) , summaryDataTable ); - // this.returnOnAccount = new ReturnOnAccount( this ); - //// getSummary_setRow( this.returnOnAccount , summaryDataTable ); - // this.benchmarkPercentageReturn = - // new BenchmarkPercentageReturn( this , this.historicalQuoteProvider ); - //// getSummary_setRow( this.benchmarkPercentageReturn , - //// summaryDataTable ); - // this.numberWinningPeriods = new NumberWinningPeriods( this ); - //// getSummary_setRow( this.numberWinningPeriods , summaryDataTable ); - // this.numberLosingPeriods = new NumberLosingPeriods( this ); - //// getSummary_setRow( this.numberLosingPeriods , summaryDataTable ); - //// getSummary_setRow( new NumberEvenPeriods( this ) , summaryDataTable ); - // this.percentageWinningPeriods = new PercentageWinningPeriods( this ); - //// getSummary_setRow( this.percentageWinningPeriods , summaryDataTable ); - // //this.getSummary_setRows_forEquityVsBenchmarkComparison(); - // this.totalNetProfit = new TotalNetProfit( this ); - // this.annualSystemPercentageReturn = new AnnualSystemPercentageReturn( this ); - //// getSummary_setRow( this.annualSystemPercentageReturn , summaryDataTable ); - // this.maxEquityDrawDown = new MaxEquityDrawDown( this ); - // // getSummary_setRow( this.maxEquityDrawDown , summaryDataTable ); - // this.totalNumberOfTrades = new TotalNumberOfTrades( this ); - //// getSummary_setRow( this.totalNumberOfTrades , summaryDataTable ); - // this.numberWinningTrades = new NumberWinningTrades( this ); - //// getSummary_setRow( this.numberWinningTrades , summaryDataTable ); - // this.averageTradePercentageReturn = new AverageTradePercentageReturn( this ); - //// getSummary_setRow( this.averageTradePercentageReturn , summaryDataTable ); - // this.largestWinningTradePercentage = new LargestWinningTradePercentage( this ); - //// getSummary_setRow( this.largestWinningTradePercentage , summaryDataTable ); - // this.largestLosingTradePercentage = new LargestLosingTradePercentage( this ); - //// getSummary_setRow( this.largestLosingTradePercentage , summaryDataTable ); - // this.totalNumberOfLongTrades = new TotalNumberOfLongTrades( this ); - //// getSummary_setRow( this.totalNumberOfLongTrades , summaryDataTable ); - // this.numberWinningLongTrades = new NumberWinningLongTrades( this ); - //// getSummary_setRow( this.numberWinningLongTrades , summaryDataTable ); - // this.averageLongTradePercentageReturn = new AverageLongTradePercentageReturn( this ); - //// getSummary_setRow( this.averageLongTradePercentageReturn , summaryDataTable ); - // this.totalNumberOfShortTrades = new TotalNumberOfShortTrades( this ); - //// getSummary_setRow( this.totalNumberOfShortTrades , summaryDataTable ); - // this.numberWinningShortTrades = new NumberWinningShortTrades( this ); - //// getSummary_setRow( this.numberWinningShortTrades , summaryDataTable ); - // this.totalCommissionAmount = new TotalCommissionAmount( this ); - //// getSummary_setRow( this.totalCommissionAmount , summaryDataTable ); - // // getSummary_setRow( summaryDataTable , - //// new getSummaryTable_setRow( getSummaryTable_setRow_TotalNumberOfShortTrades ) ); - //// getSummary_setRow( summaryDataTable , - //// new getSummaryTable_setRow( getSummaryTable_setRow_NumberWinningShortTrades ) ); - //// getSummary_setRow( summaryDataTable , - //// new getSummaryTable_setRow( getSummaryTable_setRow_AverageShortTradePercentageReturn ) ); - // } - #endregion - // private DataTable getSummaryDataTable() - // { - // DataTable summaryDataTable = new DataTable(); - // getSummaryTable_setColumns( summaryDataTable ); - // getSummaryTable_setRows( summaryDataTable ); - // return summaryDataTable; - // } private void getSummary() { --- 189,192 ---- *************** *** 255,262 **** --- 206,217 ---- this.numberLosingPeriods = new NumberLosingPeriods( this ); this.percentageWinningPeriods = new PercentageWinningPeriods( this ); + this.numberPositivePeriods = new NumberPositivePeriods( this ); + this.numberNegativePeriods = new NumberNegativePeriods( this ); + this.percentagePositivePeriods = new PercentagePositivePeriods( this ); this.totalNetProfit = new TotalNetProfit( this ); this.annualSystemPercentageReturn = new AnnualSystemPercentageReturn( this ); this.maxEquityDrawDown = new MaxEquityDrawDown( this ); this.sharpeRatio = new SharpeRatio( this.accountReport.EquityLine ); + this.expectancyScore = new ExpectancyScore( this.accountReport.EquityLine ); this.totalNumberOfTrades = new TotalNumberOfTrades( this ); this.numberWinningTrades = new NumberWinningTrades( this ); |
|
From: Glauco S. <gla...@us...> - 2006-06-08 18:40:37
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21776/b5_Presentation/Reporting/WindowsForm Modified Files: SummaryTabPage.cs Log Message: now, 14 summary items are kept in the first summary column (it was 10 before) Index: SummaryTabPage.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/SummaryTabPage.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SummaryTabPage.cs 3 Sep 2005 23:40:30 -0000 1.7 --- SummaryTabPage.cs 8 Jun 2006 18:40:28 -0000 1.8 *************** *** 38,42 **** { // constant values for label's placement ! private int labelRows = 10; private int xForLabels = 17; private int textLabelsWidth = 180; --- 38,42 ---- { // constant values for label's placement ! private int labelRows = 14; private int xForLabels = 17; private int textLabelsWidth = 180; |
|
From: Marco M. <mi...@us...> - 2006-06-02 18:58:14
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19211/b7_Scripts/TickerSelectionTesting Modified Files: GenomeManagerForWeightedEfficientPortfolio.cs Log Message: getTickerWeight method has been simplified and a bug has been fixed Index: GenomeManagerForWeightedEfficientPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/GenomeManagerForWeightedEfficientPortfolio.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GenomeManagerForWeightedEfficientPortfolio.cs 17 Nov 2005 21:37:19 -0000 1.2 --- GenomeManagerForWeightedEfficientPortfolio.cs 2 Jun 2006 18:58:09 -0000 1.3 *************** *** 62,77 **** protected override double getTickerWeight(int[] genes, int tickerPositionInGenes) { ! double totalReturnedByWeights = ! (1.0-ConstantsProvider.MinimumPortfolioWeightForTicker*genes.Length/2)/ConstantsProvider.MinimumPortfolioWeightForTicker; ! int totalOfAbsoluteValuesForWeightsInGenes = 0; for(int j = 0; j<genes.Length; j++) { if(j%2==0) //ticker weight is contained in genes at even position ! totalOfAbsoluteValuesForWeightsInGenes += (int)Math.Abs(genes[j]); } ! double min = ConstantsProvider.MinimumPortfolioWeightForTicker; ! ! return min*(1.0 + totalReturnedByWeights * Math.Abs(genes[tickerPositionInGenes-1])/totalOfAbsoluteValuesForWeightsInGenes); } --- 62,76 ---- protected override double getTickerWeight(int[] genes, int tickerPositionInGenes) { ! double minimumWeight = ConstantsProvider.MinimumPortfolioWeightForTicker; ! double totalOfValuesForWeightsInGenes = 0.0; for(int j = 0; j<genes.Length; j++) { if(j%2==0) //ticker weight is contained in genes at even position ! totalOfValuesForWeightsInGenes += Math.Abs(genes[j]) + 1.0; ! //0 has to be avoided ! } ! double freeWeight = (Math.Abs(genes[tickerPositionInGenes-1]) + 1.0)/totalOfValuesForWeightsInGenes; ! return minimumWeight + freeWeight * (1.0 - minimumWeight * genes.Length / 2); } |
|
From: Marco M. <mi...@us...> - 2006-06-02 18:56:08
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18110/b1_ADT Modified Files: ConstantsProvider.cs Log Message: Added new constants to the class. Index: ConstantsProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ConstantsProvider.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ConstantsProvider.cs 8 Nov 2005 18:38:07 -0000 1.15 --- ConstantsProvider.cs 2 Jun 2006 18:55:58 -0000 1.16 *************** *** 39,44 **** public static DateTime DefaultDateForTickersAddedToGroups = new DateTime(1980,1,1); //conventional date for new tickers added to groups ! public static double MinimumPortfolioWeightForTicker = 0.10; ! //default minimum weight for ticker, used by GenomeManagerForWeightedEfficientPortfolio } --- 39,48 ---- public static DateTime DefaultDateForTickersAddedToGroups = new DateTime(1980,1,1); //conventional date for new tickers added to groups ! public static double MinimumPortfolioWeightForTicker = 0.2; ! //default minimum weight for ticker, used by GenomeManagerForWeightedEfficientPortfolio ! public static string SeparatorForTickers = ";"; ! //separator for tickers in GenomeRepresentation class ! public static string SeparatorForWeights = ">"; ! //separator for separating ticker by its weight in GenomeRepresentation class } |
|
From: Glauco S. <gla...@us...> - 2006-06-01 23:40:16
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7106/b3_Data Modified Files: b3_Data.csproj Log Message: Minor automatic changes to the project files Index: b3_Data.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/b3_Data.csproj,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** b3_Data.csproj 14 May 2006 18:42:02 -0000 1.38 --- b3_Data.csproj 1 Jun 2006 23:40:11 -0000 1.39 *************** *** 144,148 **** <File RelPath = "ExtendedDataTable.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 144,148 ---- <File RelPath = "ExtendedDataTable.cs" ! SubType = "Component" BuildAction = "Compile" /> |
|
From: Glauco S. <gla...@us...> - 2006-06-01 23:40:16
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7106/b1_ADT Modified Files: b1_ADT.csproj Log Message: Minor automatic changes to the project files Index: b1_ADT.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/b1_ADT.csproj,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** b1_ADT.csproj 14 Mar 2006 15:07:24 -0000 1.20 --- b1_ADT.csproj 1 Jun 2006 23:40:11 -0000 1.21 *************** *** 229,233 **** <File RelPath = "Statistics\AdvancedFunctions.cs" - SubType = "Code" BuildAction = "Compile" /> --- 229,232 ---- |
|
From: Glauco S. <gla...@us...> - 2006-06-01 23:33:28
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Statistics In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3805/b1_ADT/Statistics Modified Files: AdvancedFunctions.cs Log Message: The GetExpectancyScore public method has been added Index: AdvancedFunctions.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Statistics/AdvancedFunctions.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AdvancedFunctions.cs 3 Sep 2005 23:56:26 -0000 1.2 --- AdvancedFunctions.cs 1 Jun 2006 23:33:23 -0000 1.3 *************** *** 124,128 **** return sharpeRatio; } ! } --- 124,172 ---- return sharpeRatio; } ! #region GetExpectancyScore ! public static double GetExpectancyScore( ICollection returns ) ! { ! double winningPeriods = 0; ! double losingPeriods = 0; ! double sumOfWinningReturns = 0; ! double sumOfLosingReturns = 0; ! double maxWinningReturn = Double.MinValue; ! double averageWinningReturn; ! double averageLosingReturn; ! double probabilityOfWinning; ! double probabilityOfLosing; ! foreach ( double singleReturn in returns ) ! { ! if ( singleReturn > 0 ) ! { ! winningPeriods++; ! sumOfWinningReturns += singleReturn; ! if ( singleReturn > maxWinningReturn ) ! maxWinningReturn = singleReturn; ! } ! if ( singleReturn < 0 ) ! { ! losingPeriods++; ! sumOfLosingReturns += singleReturn; ! } ! } ! ! averageWinningReturn = ( sumOfWinningReturns - maxWinningReturn ) ! / ( winningPeriods - 1 ); ! averageLosingReturn = sumOfLosingReturns / losingPeriods; ! probabilityOfWinning = ( winningPeriods - 1 ) / ! ( winningPeriods + losingPeriods - 1 ); ! probabilityOfLosing = losingPeriods / ! ( winningPeriods + losingPeriods - 1 ); ! ! double expectancyScore = ! ( averageWinningReturn * probabilityOfWinning + ! averageLosingReturn * probabilityOfLosing ) / ! Math.Abs( averageLosingReturn ) / ! ( winningPeriods + losingPeriods - 1 ); ! return expectancyScore; ! } ! #endregion ! } |
|
From: Glauco S. <gla...@us...> - 2006-05-31 14:40:32
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/Caching In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14076/b3_Data/DataProviders/Caching Modified Files: Cache.cs Log Message: bug fixed for the addPage private method: there was an error when an already cached page was cached again. Fixed now. Index: Cache.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/Caching/Cache.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Cache.cs 11 Jan 2006 18:36:40 -0000 1.3 --- Cache.cs 31 May 2006 14:40:28 -0000 1.4 *************** *** 162,166 **** // } // } ! private void addPage( string ticker , int year , QuoteField quoteField ) { if ( this.Count + 1 > this.maxNumPages ) --- 162,166 ---- // } // } ! private void addPage_actually( string ticker , int year , QuoteField quoteField ) { if ( this.Count + 1 > this.maxNumPages ) *************** *** 171,174 **** --- 171,181 ---- this.currentNumPages ++ ; } + private void addPage( string ticker , int year , QuoteField quoteField ) + { + if ( !this.ContainsKey( this.getKey( ticker , year , quoteField ) ) ) + // ticker quotes have not been cached yet, + // for the given year + this.addPage_actually( ticker , year , quoteField ); + } private void addPage( string ticker , DateTime dateTime , QuoteField quoteField ) { *************** *** 179,186 **** { double returnValue; ! // this.getQuote_checkEarlyDateException( dateTime ); ! if ( !this.ContainsKey( this.getKey( ticker , dateTime.Year , quoteField ) ) ) ! // the instrument instrumentKey has not been cached yet, for the given bar component ! this.addPage( ticker , dateTime , quoteField ); try { --- 186,191 ---- { double returnValue; ! // this.getQuote_checkEarlyDateException( dateTime ); ! this.addPage( ticker , dateTime , quoteField ); try { |
|
From: Glauco S. <gla...@us...> - 2006-05-31 14:35:31
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12161/b5_Presentation/Reporting/WindowsForm Modified Files: EquityChartTabPage.cs Log Message: - a new constructor has been added; now it is possible to create a report that will not display the benchmark equity line - the public Chart EquityChart has been added Index: EquityChartTabPage.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/EquityChartTabPage.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EquityChartTabPage.cs 15 Oct 2005 18:06:36 -0000 1.6 --- EquityChartTabPage.cs 31 May 2006 14:35:16 -0000 1.7 *************** *** 40,43 **** --- 40,54 ---- private Chart equityChart; private History benchmark; + // private bool showBenchmark; + + public Chart EquityChart + { + get { return this.equityChart; } + } + // public bool ShowBenchmark + // { + // get { return this.showBenchmark; } + // set { this.showBenchmark = value; } + // } /// <summary> *************** *** 56,60 **** return this.accountReport.BenchmarkEquityLine.MultiplyBy( normalizingFactor ); } ! public EquityChartTabPage( AccountReport accountReport ) { this.Text = "Equity Line"; --- 67,72 ---- return this.accountReport.BenchmarkEquityLine.MultiplyBy( normalizingFactor ); } ! public EquityChartTabPage( AccountReport accountReport , ! bool showBenchmark ) { this.Text = "Equity Line"; *************** *** 67,71 **** // (DateTime)this.accountReport.EquityHistory.GetKey( 0 ) , // (DateTime)this.accountReport.EquityHistory.GetKey( this.accountReport.EquityHistory.Count - 1 ) ); ! this.equityChart.Add( benchmark , Color.Blue ); this.Controls.Add( this.equityChart ); } --- 79,84 ---- // (DateTime)this.accountReport.EquityHistory.GetKey( 0 ) , // (DateTime)this.accountReport.EquityHistory.GetKey( this.accountReport.EquityHistory.Count - 1 ) ); ! if ( showBenchmark ) ! this.equityChart.Add( benchmark , Color.Blue ); this.Controls.Add( this.equityChart ); } |
|
From: Glauco S. <gla...@us...> - 2006-05-31 14:33:23
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11407/b91_QuantProject Removed Files: Main.resx Log Message: The resx file was mistakenly added to the repository. --- Main.resx DELETED --- |
|
From: Glauco S. <gla...@us...> - 2006-05-31 14:31:40
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv10619/b5_Presentation/Reporting/WindowsForm Modified Files: Report.cs Log Message: - a new constructor has been added; now it is possible to create a report that will not display the benchmark equity line - the Create method has been overloaded: now it is possible to create a report that will not display the benchmark equity line - the AddEquityLine public method has been added: now it is possible to add multiple equity lines to the report Index: Report.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/Report.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Report.cs 3 Aug 2005 18:55:10 -0000 1.16 --- Report.cs 31 May 2006 14:31:32 -0000 1.17 *************** *** 21,25 **** --- 21,27 ---- */ using System; + using System.Drawing; using System.Windows.Forms; + using QuantProject.ADT; using QuantProject.Business.DataProviders; *************** *** 72,79 **** public Report( AccountReport accountReport ) { this.accountReport = accountReport; this.account = this.accountReport.Account; this.initializeComponent(); ! this.create_populateForm(); } --- 74,89 ---- public Report( AccountReport accountReport ) { + this.report( accountReport , true ); + } + public Report( AccountReport accountReport , bool showBenchmark ) + { + this.report( accountReport , showBenchmark ); + } + private void report( AccountReport accountReport , bool showBenchmark ) + { this.accountReport = accountReport; this.account = this.accountReport.Account; this.initializeComponent(); ! this.create_populateForm( showBenchmark ); } *************** *** 117,126 **** this.historicalQuoteProvider ); } ! private void create_populateForm() { this.Location = new System.Drawing.Point( 1000,500); this.Width = 700; this.Height = 500; ! this.reportTabControl = new ReportTabControl( this.accountReport ); this.Controls.Add( this.reportTabControl ); } --- 127,137 ---- this.historicalQuoteProvider ); } ! private void create_populateForm( bool showBenchmark ) { this.Location = new System.Drawing.Point( 1000,500); this.Width = 700; this.Height = 500; ! this.reportTabControl = new ReportTabControl( this.accountReport , ! showBenchmark ); this.Controls.Add( this.reportTabControl ); } *************** *** 132,141 **** /// <param name="endDateTime"></param> /// <param name="benchmark"></param> ! public void Create( string reportName , ! int numDaysForInterval , EndOfDayDateTime endDateTime , string benchmark ) { create_set_accountReport( reportName , numDaysForInterval , endDateTime , benchmark ); ! create_populateForm(); } public void Show( string reportName , --- 143,158 ---- /// <param name="endDateTime"></param> /// <param name="benchmark"></param> ! public void Create( string reportName , int numDaysForInterval , ! EndOfDayDateTime endDateTime , string benchmark ) ! { ! this.Create( reportName , numDaysForInterval , endDateTime , ! benchmark , true ); ! } ! public void Create( string reportName , int numDaysForInterval , ! EndOfDayDateTime endDateTime , string benchmark , bool showBenchmark ) { create_set_accountReport( reportName , numDaysForInterval , endDateTime , benchmark ); ! create_populateForm( showBenchmark ); } public void Show( string reportName , *************** *** 248,251 **** --- 265,273 ---- #endregion + public void AddEquityLine( EquityLine equityLine , + Color color ) + { + this.reportTabControl.EquityChart.Add( equityLine , color ); + } // /// <summary> |
|
From: Glauco S. <gla...@us...> - 2006-05-31 14:25:05
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8096/b5_Presentation/Reporting/WindowsForm Modified Files: ReportTabControl.cs Log Message: The public Chart EquityChart property has been added. Now the report chart is available to the world outside the visual report. Index: ReportTabControl.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/ReportTabControl.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReportTabControl.cs 4 Jun 2005 15:20:46 -0000 1.3 --- ReportTabControl.cs 31 May 2006 14:24:58 -0000 1.4 *************** *** 22,26 **** --- 22,28 ---- using System; using System.Windows.Forms; + using QuantProject.Business.Financial.Accounting.Reporting; + using QuantProject.Presentation.Charting; namespace QuantProject.Presentation.Reporting.WindowsForm *************** *** 42,51 **** get { return this.transactions.ReportGrid; } } ! public ReportTabControl( AccountReport accountReport ) { this.accountReport = accountReport; this.Dock = DockStyle.Fill; ! this.equityChart = new EquityChartTabPage( this.accountReport ); this.Controls.Add( this.equityChart ); this.summary = new SummaryTabPage( this.accountReport ); --- 44,65 ---- get { return this.transactions.ReportGrid; } } + public Chart EquityChart + { + get { return this.equityChart.EquityChart; } + } ! /// <summary> ! /// Contains all tab pages of a visual report ! /// </summary> ! /// <param name="accountReport">data for the report to be shown</param> ! /// <param name="showBenchmark">true iif the benchmark equity line ! /// is to be shown</param> ! public ReportTabControl( AccountReport accountReport , ! bool showBenchmark ) { this.accountReport = accountReport; this.Dock = DockStyle.Fill; ! this.equityChart = new EquityChartTabPage( this.accountReport , ! showBenchmark ); this.Controls.Add( this.equityChart ); this.summary = new SummaryTabPage( this.accountReport ); |
|
From: Glauco S. <gla...@us...> - 2006-05-31 14:23:06
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7394/b7_Scripts/WalkForwardTesting/WalkForwardLag Modified Files: RunWalkForwardLag.cs Log Message: Script changed so that now, the out of sample days are computed after the last optimization, when maxRunningHours has been reached (in the previous implementation, the last optimization was performed, but the script was stopped before computing the out of sample test). Index: RunWalkForwardLag.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/RunWalkForwardLag.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RunWalkForwardLag.cs 14 May 2006 23:00:17 -0000 1.3 --- RunWalkForwardLag.cs 31 May 2006 14:22:53 -0000 1.4 *************** *** 224,236 **** report.Show(); } ! private void oneHourAfterMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { DateTime currentTime = ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime; ! if ( ( currentTime > ! this.lastDateTime ) || ! ( DateTime.Now >= ! this.startingTimeForScript.AddHours( this.maxRunningHours ) ) ) { // either the simulation has reached the ending date or --- 224,244 ---- report.Show(); } ! private bool isTimeToStop( DateTime currentTime ) ! { ! DateTime maxEndingDateTimeForScript = ! this.startingTimeForScript.AddHours( this.maxRunningHours ); ! bool scriptTimeElapsed = ( DateTime.Now >= maxEndingDateTimeForScript ); ! bool areBestTickersToBeChosen = ! this.endOfDayTimerHandler.AreBestTickersToBeChosen(); ! return ! ( ( currentTime > this.lastDateTime ) || ! ( scriptTimeElapsed && areBestTickersToBeChosen ) ); ! } ! private void marketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { DateTime currentTime = ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime; ! if ( this.isTimeToStop( currentTime ) ) { // either the simulation has reached the ending date or *************** *** 273,279 **** new OneHourAfterMarketCloseEventHandler( this.endOfDayTimerHandler.OneHourAfterMarketCloseEventHandler ); ! this.endOfDayTimer.OneHourAfterMarketClose += ! new OneHourAfterMarketCloseEventHandler( ! this.oneHourAfterMarketCloseEventHandler ); this.endOfDayTimerHandler.NewChosenTickers += new NewChosenTickersEventHandler( --- 281,287 ---- new OneHourAfterMarketCloseEventHandler( this.endOfDayTimerHandler.OneHourAfterMarketCloseEventHandler ); ! this.endOfDayTimer.MarketClose += ! new MarketCloseEventHandler( ! this.marketCloseEventHandler ); this.endOfDayTimerHandler.NewChosenTickers += new NewChosenTickersEventHandler( |
|
From: Glauco S. <gla...@us...> - 2006-05-31 14:19:57
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagDebugger/WFLagDebugPositions In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6293/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagDebugger/WFLagDebugPositions Modified Files: WFLagDebugPositions.cs Log Message: Now, equity line for both driving positions (green line) and portfolio positions (brown line) are added to the report chart. Index: WFLagDebugPositions.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagDebugger/WFLagDebugPositions/WFLagDebugPositions.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WFLagDebugPositions.cs 14 May 2006 21:23:56 -0000 1.2 --- WFLagDebugPositions.cs 31 May 2006 14:19:43 -0000 1.3 *************** *** 23,27 **** --- 23,29 ---- using System; using System.Collections; + using System.Drawing; + using QuantProject.ADT.Collections; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting; *************** *** 113,118 **** this.account.AddCash( 30000 ); } ! #region getEquityLineForDrivingPositions ! /// <summary> /// Returns a virtual amount of quantities for each virtual ticker. --- 115,120 ---- this.account.AddCash( 30000 ); } ! #region oneHourAfterMarketCloseEventHandler ! #region getEquityLineForSignedTickers /// <summary> /// Returns a virtual amount of quantities for each virtual ticker. *************** *** 121,132 **** /// </summary> /// <returns></returns> ! private Hashtable getDrivingTickersVirtualQuantities( DateTime dateTime ) { ! Hashtable drivingTickersVirtualQuantities = new Hashtable(); double valueForEachPosition = 30000 / ! this.wFLagChosenPositions.DrivingPositions.Count; ! foreach( string signedTicker in ! this.wFLagChosenPositions.DrivingPositions.Keys ) { string ticker = SignedTicker.GetTicker( signedTicker ); --- 123,133 ---- /// </summary> /// <returns></returns> ! private Hashtable getVirtualQuantities( ICollection positions , DateTime dateTime ) { ! Hashtable virtualQuantities = new Hashtable(); double valueForEachPosition = 30000 / ! positions.Count; ! foreach( string signedTicker in positions ) { string ticker = SignedTicker.GetTicker( signedTicker ); *************** *** 137,149 **** ticker , endOfDayDateTime ); double virtualQuantity = valueForEachPosition / tickerQuote; ! drivingTickersVirtualQuantities.Add( ticker , virtualQuantity ); } ! return drivingTickersVirtualQuantities; } ! private double getEquityLineForDrivingPositions( DateTime dateTime , Hashtable tickerVirtualQuantities ) { ! double equityValueForDrivingPositions = 30000; ! foreach( string ticker in tickerVirtualQuantities ) { EndOfDayDateTime endOfDayDateTime = new EndOfDayDateTime( --- 138,169 ---- ticker , endOfDayDateTime ); double virtualQuantity = valueForEachPosition / tickerQuote; ! if ( SignedTicker.IsShort( signedTicker ) ) ! virtualQuantity = -virtualQuantity; ! virtualQuantities.Add( ticker , virtualQuantity ); } ! return virtualQuantities; } ! private double getCash( Hashtable drivingTickerVirtualQuantities ) ! { ! double cash = 30000; ! double valueForEachPosition = ! cash / drivingTickerVirtualQuantities.Count; ! foreach ( double virtualQuantity in ! drivingTickerVirtualQuantities.Values ) ! { ! if ( virtualQuantity > 0 ) ! // long position ! cash -= valueForEachPosition; ! else ! // virtualQuantity > 0 i.e. short position ! cash += valueForEachPosition; ! } ! return cash; ! } ! private double getPortfolioValueForSignedTickers( DateTime dateTime , Hashtable tickerVirtualQuantities ) { ! double portfolioValueForDrivingPositions = 0; ! foreach( string ticker in tickerVirtualQuantities.Keys ) { EndOfDayDateTime endOfDayDateTime = new EndOfDayDateTime( *************** *** 152,179 **** ticker , endOfDayDateTime ); double virtualQuantity = (double)tickerVirtualQuantities[ ticker ]; ! equityValueForDrivingPositions += virtualQuantity * tickerQuote; } ! return equityValueForDrivingPositions; } ! private EquityLine getEquityLineForDrivingPositions( ! Report report ) { EquityLine equityLineForPortfolioPositions = report.AccountReport.EquityLine; ! EquityLine equityLineForDrivingPositions = new EquityLine(); ! Hashtable drivingTickerQuantities = ! this.getDrivingTickersVirtualQuantities( (DateTime)equityLineForPortfolioPositions.GetKey( 0 ) ); ! foreach( DateTime dateTime in equityLineForPortfolioPositions ) ! equityLineForDrivingPositions.Add( dateTime , ! this.getEquityLineForDrivingPositions( dateTime , ! drivingTickerQuantities ) ); ! // double normalizingFactor = ! // ( double )equityLineForPortfolioPositions.GetByIndex( 0 ) / ! // ( double )equityLineForDrivingPositions.GetByIndex( 0 ); ! return equityLineForDrivingPositions; } #endregion public void oneHourAfterMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) --- 172,207 ---- ticker , endOfDayDateTime ); double virtualQuantity = (double)tickerVirtualQuantities[ ticker ]; ! portfolioValueForDrivingPositions += virtualQuantity * tickerQuote; } ! return portfolioValueForDrivingPositions; } ! private EquityLine getEquityLineForSignedTickers( ! ICollection signedTickers , Report report ) { EquityLine equityLineForPortfolioPositions = report.AccountReport.EquityLine; ! EquityLine equityLineForSignedTickers = new EquityLine(); ! Hashtable virtualQuantities = ! this.getVirtualQuantities( signedTickers , (DateTime)equityLineForPortfolioPositions.GetKey( 0 ) ); ! double cash = this.getCash( virtualQuantities ); ! foreach( DateTime dateTime in ! equityLineForPortfolioPositions.Keys ) ! equityLineForSignedTickers.Add( dateTime , ! cash + this.getPortfolioValueForSignedTickers( dateTime , ! virtualQuantities ) ); ! return equityLineForSignedTickers; } #endregion + private void addEquityLineForSignedTickers( + ICollection signedTickers , Color color , Report report ) + { + EquityLine equityLineSignedTickers = + this.getEquityLineForSignedTickers( + signedTickers , report ); + report.AddEquityLine( equityLineSignedTickers , + color ); + } public void oneHourAfterMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) *************** *** 188,198 **** new EndOfDayDateTime( this.postSampleLastDateTime , EndOfDaySpecificTime.OneHourAfterMarketClose ) , ! this.benchmark ); ! EquityLine equityLineForDrivingPositions = ! this.getEquityLineForDrivingPositions( report ); ! // report.AddEquityLine( equityLineForDrivingPositions ); report.Show(); } } public void Run() { --- 216,232 ---- new EndOfDayDateTime( this.postSampleLastDateTime , EndOfDaySpecificTime.OneHourAfterMarketClose ) , ! this.benchmark , false ); ! // EquityLine equityLineForDrivingPositions = ! // this.getEquityLineForPositions( report ); ! this.addEquityLineForSignedTickers( ! this.wFLagChosenPositions.DrivingPositions.Keys , ! Color.YellowGreen , report ); ! this.addEquityLineForSignedTickers( ! this.wFLagChosenPositions.PortfolioPositions.Keys , ! Color.Brown , report ); report.Show(); } } + #endregion public void Run() { |
|
From: Glauco S. <gla...@us...> - 2006-05-31 14:17:57
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5573/b7_Scripts/WalkForwardTesting/WalkForwardLag Modified Files: WFLagEndOfDayTimerHandler.cs Log Message: AreBestTickersToBeChosen is public now. Index: WFLagEndOfDayTimerHandler.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagEndOfDayTimerHandler.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WFLagEndOfDayTimerHandler.cs 8 Apr 2006 18:40:50 -0000 1.2 --- WFLagEndOfDayTimerHandler.cs 31 May 2006 14:17:47 -0000 1.3 *************** *** 345,349 **** } #endregion ! private bool areBestTickersToBeChosen() { bool returnValue = --- 345,349 ---- } #endregion ! public bool AreBestTickersToBeChosen() { bool returnValue = *************** *** 357,361 **** Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! if ( this.areBestTickersToBeChosen() ) // the portfolio is empty and // either the lastOptimizationDate has not been set yet --- 357,361 ---- Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { ! if ( this.AreBestTickersToBeChosen() ) // the portfolio is empty and // either the lastOptimizationDate has not been set yet |
|
From: Glauco S. <gla...@us...> - 2006-05-31 14:16:45
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5200/b7_Scripts/WalkForwardTesting/WalkForwardLag Modified Files: WFLagMain.cs Log Message: EWQ is used as benchmark, instead of MSFT, for ETF's group. Index: WFLagMain.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagMain.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WFLagMain.cs 14 May 2006 22:58:27 -0000 1.3 --- WFLagMain.cs 31 May 2006 14:16:32 -0000 1.4 *************** *** 117,129 **** { // new RunWalkForwardLag( "millo" , 500 , ! // 3 , 3 , 90 , 7 , 1 , 5000 , "MSFT" , // new DateTime( 2002 , 1 , 1 ) , // new DateTime( 2002 , 1 , 8 ) , // 0.01 ).Run(); new RunWalkForwardLag( "ib_etf" , 500 , ! 3 , 1 , 200 , 15 , 50 , 90000 , "EWQ" , ! new DateTime( 2003 , 1 , 1 ) , new DateTime( 2003 , 12 , 31 ) , ! 13 ).Run(); // new RunWalkForwardLag( "ib_etf" , 500 , // 4 , 4 , 250 , 2 , 15 , 30000 , "EWQ" , --- 117,129 ---- { // new RunWalkForwardLag( "millo" , 500 , ! // 3 , 3 , 90 , 4 , 1 , 5000 , "MSFT" , // new DateTime( 2002 , 1 , 1 ) , // new DateTime( 2002 , 1 , 8 ) , // 0.01 ).Run(); new RunWalkForwardLag( "ib_etf" , 500 , ! 4 , 4 , 200 , 15 , 50 , 90000 , "EWQ" , ! new DateTime( 2003 , 8 , 13 ) , new DateTime( 2003 , 12 , 31 ) , ! 7 ).Run(); // new RunWalkForwardLag( "ib_etf" , 500 , // 4 , 4 , 250 , 2 , 15 , 30000 , "EWQ" , |