[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDeb
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2006-10-08 16:10:19
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDebugger In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2760/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDebugger Modified Files: WFLagChosenPositionsDebugInfo.cs Log Message: Bug fixed: a new statement is used for the rare case when the firstCommonDateForTickers comes after this.getInSampleFirstDate() It may happen when this.getInSampleFirstDate() falls in a non market day and one of the involved tickers begins being quoted from the following market day Index: WFLagChosenPositionsDebugInfo.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDebugger/WFLagChosenPositionsDebugInfo.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WFLagChosenPositionsDebugInfo.cs 8 Aug 2006 09:44:12 -0000 1.5 --- WFLagChosenPositionsDebugInfo.cs 8 Oct 2006 16:10:16 -0000 1.6 *************** *** 122,127 **** this.preSampleSharpeRatio30 = this.getPreSampleSharpeRatio( 30 ); this.preSampleSharpeRatio150 = this.getPreSampleSharpeRatio( 150 ); ! this.preSampleMaxSharpeRatio = this.getPreSampleSharpeRatio( ! this.MaxPreSampleDays ); this.postSampleSharpeRatio30 = this.getPostSampleSharpeRatio( 30 ); this.postSampleSharpeRatio150 = this.getPostSampleSharpeRatio( 150 ); --- 122,128 ---- this.preSampleSharpeRatio30 = this.getPreSampleSharpeRatio( 30 ); this.preSampleSharpeRatio150 = this.getPreSampleSharpeRatio( 150 ); ! if ( this.MaxPreSampleDays > 1 ) ! this.preSampleMaxSharpeRatio = this.getPreSampleSharpeRatio( ! this.MaxPreSampleDays - 1 ); this.postSampleSharpeRatio30 = this.getPostSampleSharpeRatio( 30 ); this.postSampleSharpeRatio150 = this.getPostSampleSharpeRatio( 150 ); *************** *** 178,182 **** TimeSpan timeSpan = this.getInSampleFirstDate() - firstCommonDateForTickers; ! this.maxPreSampleDays = timeSpan.Days - 1; // I subtract one, so I have the number of daily returns } private DateTime getInSampleFirstDate() --- 179,189 ---- TimeSpan timeSpan = this.getInSampleFirstDate() - firstCommonDateForTickers; ! this.maxPreSampleDays = timeSpan.Days; ! // the following statement is used for the rare case when the ! // firstCommonDateForTickers comes after this.getInSampleFirstDate() ! // It may happen when this.getInSampleFirstDate() ! // falls in a non market day and one of the involved tickers begins being ! // quoted from the following market day ! this.maxPreSampleDays = Math.Max( this.maxPreSampleDays , 0 ); } private DateTime getInSampleFirstDate() *************** *** 203,207 **** { double preSampleSharpeRatio = this.dummyValue; ! if ( this.MaxPreSampleDays >= days ) { DateTime lastDateTime = this.getInSampleFirstDate(); --- 210,214 ---- { double preSampleSharpeRatio = this.dummyValue; ! if ( this.MaxPreSampleDays > days ) { DateTime lastDateTime = this.getInSampleFirstDate(); |