[Quantproject-developers] QuantProject/b7_Scripts/TickerSelectionTesting GenomeManagerForEfficientPo
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-08-07 22:37:43
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5555/b7_Scripts/TickerSelectionTesting Modified Files: GenomeManagerForEfficientPortfolio.cs Log Message: Fixed bugs in GetNewGeneValue and Mutate methods Index: GenomeManagerForEfficientPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/GenomeManagerForEfficientPortfolio.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** GenomeManagerForEfficientPortfolio.cs 31 Jul 2005 20:03:31 -0000 1.15 --- GenomeManagerForEfficientPortfolio.cs 7 Aug 2005 22:37:28 -0000 1.16 *************** *** 231,236 **** genome.MaxValueForGenes + 1); while(genome.HasGene(returnValue) || ! genome.HasGene(Math.Abs(returnValue) - 1 ) || ! genome.HasGene(- Math.Abs(returnValue) - 1) ) //the portfolio can't have a long position and a short one for the same ticker { --- 231,236 ---- genome.MaxValueForGenes + 1); while(genome.HasGene(returnValue) || ! ( returnValue<0 && genome.HasGene(Math.Abs(returnValue) - 1 ) )|| ! (returnValue>0 && genome.HasGene(- Math.Abs(returnValue) - 1)) ) //the portfolio can't have a long position and a short one for the same ticker { *************** *** 249,255 **** genome.MaxValueForGenes +1); int genePositionToBeMutated = GenomeManagement.RandomGenerator.Next(genome.Size); ! while(genome.HasGene(newValueForGene) || ! genome.HasGene(Math.Abs(newValueForGene) - 1 ) || ! genome.HasGene(- Math.Abs(newValueForGene) - 1) ) //the efficient portfolio, in this implementation, // can't have a long position and a short position --- 249,255 ---- genome.MaxValueForGenes +1); int genePositionToBeMutated = GenomeManagement.RandomGenerator.Next(genome.Size); ! while(genome.HasGene(returnValue) || ! ( returnValue<0 && genome.HasGene(Math.Abs(returnValue) - 1 ) )|| ! (returnValue>0 && genome.HasGene(- Math.Abs(returnValue) - 1)) ) //the efficient portfolio, in this implementation, // can't have a long position and a short position |