[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDeb
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2006-06-29 17:46:53
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDebugger In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18104/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDebugger Modified Files: WFLagChosenPositionsDebugInfo.cs Log Message: - a WFLagLog parameter has been added to the WFLagChosenPositionsDebugInfo constructor - the InSampleDays property has been added - the InSampleSharpeRatio property has been added - the PreSampleSharpeRatio30 property has been added - the PostSampleSharpeRatio30 property has been added - the InSampleDays property has been added - the InSampleDays property has been added - the InSampleDays property has been added Index: WFLagChosenPositionsDebugInfo.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDebugger/WFLagChosenPositionsDebugInfo.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WFLagChosenPositionsDebugInfo.cs 24 Jun 2006 14:49:54 -0000 1.1 --- WFLagChosenPositionsDebugInfo.cs 29 Jun 2006 17:46:49 -0000 1.2 *************** *** 31,34 **** --- 31,38 ---- { private WFLagChosenPositions wFLagChosenPositions; + private WFLagLog wFLagLog; + private double inSampleSharpeRatio; + private double preSampleSharpeRatio30; + private double postSampleSharpeRatio30; public string DrivingPositions *************** *** 44,48 **** get { return this.wFLagChosenPositions.LastOptimizationDate; } } ! public WFLagChosenPositionsDebugInfo( WFLagChosenPositions wFLagChosenPositions ) { // --- 48,70 ---- get { return this.wFLagChosenPositions.LastOptimizationDate; } } ! public int InSampleDays ! { ! get { return this.wFLagLog.InSampleDays; } ! } ! public double InSampleSharpeRatio ! { ! get { return this.inSampleSharpeRatio; } ! } ! public double PreSampleSharpeRatio30 ! { ! get { return this.preSampleSharpeRatio30; } ! } ! public double PostSampleSharpeRatio30 ! { ! get { return this.postSampleSharpeRatio30; } ! } ! public WFLagChosenPositionsDebugInfo( ! WFLagChosenPositions wFLagChosenPositions , ! WFLagLog wFLagLog ) { // *************** *** 50,53 **** --- 72,110 ---- // this.wFLagChosenPositions = wFLagChosenPositions; + this.wFLagLog = wFLagLog; + this.inSampleSharpeRatio = this.getInSampleSharpeRatio(); + this.preSampleSharpeRatio30 = this.getPreSampleSharpeRatio( 30 ); + this.postSampleSharpeRatio30 = this.getPostSampleSharpeRatio( 30 ); + } + private DateTime getInSampleFirstDate() + { + DateTime inSampleFirstDate = this.LastOptimization.AddDays( + -( this.wFLagLog.InSampleDays - 1 ) ); + return inSampleFirstDate; + } + private double getInSampleSharpeRatio() + { + DateTime firstDateTime = this.getInSampleFirstDate(); + return WFLagSharpeRatioComputer.GetSharpeRatio( + this.wFLagChosenPositions , firstDateTime , + this.LastOptimization ); + } + private double getPreSampleSharpeRatio( int days ) + { + DateTime lastDateTime = this.getInSampleFirstDate(); + DateTime firstDateTime = lastDateTime.AddDays( -days - 1 ); // I subtract one more day, so I have days daily returns + return WFLagSharpeRatioComputer.GetSharpeRatio( + this.wFLagChosenPositions , firstDateTime , + lastDateTime ); + } + private double getPostSampleSharpeRatio( int days ) + { + DateTime firstDateTime = + this.LastOptimization; // add one day if you want to exclude the first day after the optimization; + // consider that the real out of sample jumps out that day + DateTime lastDateTime = firstDateTime.AddDays( days + 1 ); // I add one day, so I have days daily returns + return WFLagSharpeRatioComputer.GetSharpeRatio( + this.wFLagChosenPositions , firstDateTime , + lastDateTime ); } } |