[Quantproject-developers] QuantProject/b7_Scripts/TickerSelectionTesting GenomeManagerForEfficient
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2006-10-22 18:30:28
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13946/b7_Scripts/TickerSelectionTesting Modified Files: GenomeManagerForEfficientPortfolio.cs Log Message: Fixed important bug in a sub method called by getRatesOfReturn (for the portfolio represented by the genome): the bug was caused by considering 0 a short ticker, while the decode method considered 0, properly, a long ticker. This fix should improve, theoretically, all scripts using IGenomeManager deriving from GenomeManagerForEfficientPortfolio. like the OpenToClose script. Index: GenomeManagerForEfficientPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/GenomeManagerForEfficientPortfolio.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** GenomeManagerForEfficientPortfolio.cs 17 Sep 2006 21:41:37 -0000 1.25 --- GenomeManagerForEfficientPortfolio.cs 22 Oct 2006 18:30:18 -0000 1.26 *************** *** 152,156 **** this.minValueForGenes = - this.originalNumOfTickers; //if gene g is negative, it refers to the ticker |g|-1 to be shorted ! this.maxValueForGenes = 0; break; case QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios.PortfolioType.ShortAndLong : --- 152,156 ---- this.minValueForGenes = - this.originalNumOfTickers; //if gene g is negative, it refers to the ticker |g|-1 to be shorted ! this.maxValueForGenes = - 1; break; case QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios.PortfolioType.ShortAndLong : *************** *** 321,326 **** { string initialCharForTickerCode = ""; ! int position = geneValue; ! if(geneValue<0) { position = Math.Abs(geneValue) - 1; --- 321,326 ---- { string initialCharForTickerCode = ""; ! int position = geneValue;//for geneValue >= 0 the coded ticker is for long ! if(geneValue < 0) { position = Math.Abs(geneValue) - 1; *************** *** 434,439 **** { int position = geneValueForTickerIdx; ! if(geneValueForTickerIdx<0) ! position = Math.Abs(geneValueForTickerIdx + 1); return position; } --- 434,439 ---- { int position = geneValueForTickerIdx; ! if(geneValueForTickerIdx < 0) ! position = Math.Abs(geneValueForTickerIdx) - 1; return position; } *************** *** 444,448 **** { bool longReturns = false; ! if(genes[tickerPositionInGenes] > 0) //genes[tickerPositionInGenes], the code for ticker, points to a ticker for which long returns are to be examined longReturns = true; --- 444,448 ---- { bool longReturns = false; ! if(genes[tickerPositionInGenes] >= 0) //genes[tickerPositionInGenes], the code for ticker, points to a ticker for which long returns are to be examined longReturns = true; |