[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank ComparableAc
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2005-10-15 18:05:07
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15310/b7_Scripts/WalkForwardTesting/WalkForwardOneRank Modified Files: ComparableAccount.cs Log Message: Sharpe Ratio is now used as fitness function Index: ComparableAccount.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardOneRank/ComparableAccount.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ComparableAccount.cs 19 Jun 2005 15:12:04 -0000 1.10 --- ComparableAccount.cs 15 Oct 2005 18:04:58 -0000 1.11 *************** *** 22,25 **** --- 22,26 ---- using System; + using QuantProject.ADT.Statistics; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting; *************** *** 37,43 **** public class ComparableAccount : Account { ! private double maxAcceptableDrawDown = 30; ! private double minAcceptableWinningPeriods = 52; private IHistoricalQuoteProvider historicalQuoteProvider = --- 38,44 ---- public class ComparableAccount : Account { ! // private double maxAcceptableDrawDown = 30; ! // private double minAcceptableWinningPeriods = 52; private IHistoricalQuoteProvider historicalQuoteProvider = *************** *** 63,82 **** private double goodness() { ! double returnValue; if ( this.accountReport == null ) ! this.accountReport = this.CreateReport( this.Key , 1 , ! this.EndOfDayTimer.GetCurrentTime() , this.Key , ! this.historicalQuoteProvider ); // old goodness computation ! if ( ( (double)this.accountReport.Summary.MaxEquityDrawDown.Value >= ! this.maxAcceptableDrawDown ) ! || ( this.accountReport.Summary.TotalPnl <= ! (double)this.accountReport.Summary.BenchmarkPercentageReturn.Value ) ) ! returnValue = Double.MinValue; ! else ! // max draw down is acceptable and the strategy is better than buy and hold ! returnValue = (double)this.accountReport.Summary.ReturnOnAccount.Value - ! (double)this.accountReport.Summary.BenchmarkPercentageReturn.Value; // new goodness computation --- 64,94 ---- private double goodness() { ! double returnValue = Double.MinValue; if ( this.accountReport == null ) ! { ! this.accountReport = new AccountReport( ! this , this.historicalQuoteProvider ); ! this.accountReport.SetEquityLine( 1 , ! this.EndOfDayTimer.GetCurrentTime() ); ! returnValue = AdvancedFunctions.GetSharpeRatio( ! this.accountReport.EquityLine.GetReturns().Values ); ! } // old goodness computation ! // if ( this.accountReport == null ) ! // this.accountReport = this.CreateReport( this.Key , 1 , ! // this.EndOfDayTimer.GetCurrentTime() , this.Key , ! // this.historicalQuoteProvider ); ! ! // very old goodness computation ! // if ( ( (double)this.accountReport.Summary.MaxEquityDrawDown.Value >= ! // this.maxAcceptableDrawDown ) ! // || ( this.accountReport.Summary.TotalPnl <= ! // (double)this.accountReport.Summary.BenchmarkPercentageReturn.Value ) ) ! // returnValue = Double.MinValue; ! // else ! // // max draw down is acceptable and the strategy is better than buy and hold ! // returnValue = (double)this.accountReport.Summary.ReturnOnAccount.Value - ! // (double)this.accountReport.Summary.BenchmarkPercentageReturn.Value; // new goodness computation *************** *** 85,93 **** // else // returnValue = Convert.ToDouble( this.accountReport.Summary.PercentageWinningPeriods ); ! if ( (double)this.accountReport.Summary.PercentageWinningPeriods.Value < ! this.minAcceptableWinningPeriods ) ! returnValue = Double.MinValue; ! else ! returnValue = Convert.ToDouble( - (double)this.accountReport.Summary.MaxEquityDrawDown.Value ); return returnValue; --- 97,105 ---- // else // returnValue = Convert.ToDouble( this.accountReport.Summary.PercentageWinningPeriods ); ! // if ( (double)this.accountReport.Summary.PercentageWinningPeriods.Value < ! // this.minAcceptableWinningPeriods ) ! // returnValue = Double.MinValue; ! // else ! // returnValue = Convert.ToDouble( - (double)this.accountReport.Summary.MaxEquityDrawDown.Value ); return returnValue; |