[Quantproject-developers] QuantProject/b7_Scripts/EvaluatingOptimizationTechnique/EfficientPortfolio
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-11-08 18:32:59
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/EvaluatingOptimizationTechnique/EfficientPortfolio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23365/b7_Scripts/EvaluatingOptimizationTechnique/EfficientPortfolio Modified Files: RunTestingOptimizationOpenToClose.cs Log Message: no message Index: RunTestingOptimizationOpenToClose.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/EvaluatingOptimizationTechnique/EfficientPortfolio/RunTestingOptimizationOpenToClose.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RunTestingOptimizationOpenToClose.cs 23 Oct 2005 19:05:37 -0000 1.5 --- RunTestingOptimizationOpenToClose.cs 8 Nov 2005 18:32:43 -0000 1.6 *************** *** 136,145 **** } DateTime dateOutOfSample = this.marketDate.AddDays(this.numDaysAfterLastOptimizationDay); ! Quotes tickerQuotes = new Quotes(ticker, dateOutOfSample, ! dateOutOfSample); ! returnValue += ! (tickerQuotes.GetFirstValidRawClose(dateOutOfSample)/ ! tickerQuotes.GetFirstValidRawOpen(dateOutOfSample) - 1.0)*coefficient; ! } return returnValue/genome.Size; --- 136,163 ---- } DateTime dateOutOfSample = this.marketDate.AddDays(this.numDaysAfterLastOptimizationDay); ! //returnValue is the single return for the numDaysAfterLastOptimizationDay - th day ! //after the given market date ! ! //Quotes tickerQuotes = new Quotes(ticker, dateOutOfSample, ! // dateOutOfSample); ! ! //returnValue += ! // (tickerQuotes.GetFirstValidRawClose(dateOutOfSample)/ ! // tickerQuotes.GetFirstValidRawOpen(dateOutOfSample) - 1.0)*coefficient; ! // ! //returnValue is the average return for the interval between ! //the given market date and the numDaysAfterLastOptimizationDay - th ! //day after the given market date ! Quotes tickerQuotes = new Quotes(ticker, this.marketDate, ! dateOutOfSample); ! double close, open; ! for(int i = 0; i<this.numDaysAfterLastOptimizationDay; i++) ! { ! close = tickerQuotes.GetFirstValidRawClose(this.marketDate.AddDays(i)); ! open = tickerQuotes.GetFirstValidRawOpen(this.marketDate.AddDays(i)); ! returnValue += ! (close/open - 1.0)*coefficient/this.numDaysAfterLastOptimizationDay; ! ! } } return returnValue/genome.Size; |