[Quantproject-developers] QuantProject/b7_Scripts/TickerSelectionTesting GenomeManagerForEfficient
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2006-07-02 19:57:37
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15028/b7_Scripts/TickerSelectionTesting Modified Files: GenomeManagerForEfficientCTOPortfolio.cs EndOfDayTimerHandlerOTCCTO.cs EndOfDayTimerHandlerOTC.cs Log Message: Updated strategies based on OTC and CTO behaviours. Minor changes. Index: EndOfDayTimerHandlerOTCCTO.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerOTCCTO.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EndOfDayTimerHandlerOTCCTO.cs 7 Jan 2006 10:35:39 -0000 1.3 --- EndOfDayTimerHandlerOTCCTO.cs 2 Jul 2006 19:57:34 -0000 1.4 *************** *** 125,152 **** SelectorByGroup temporizedGroup = new SelectorByGroup(this.tickerGroupID, currentDate); ! SelectorByOpenCloseCorrelationToBenchmark lessCorrelatedFromTemporizedGroup = ! new SelectorByOpenCloseCorrelationToBenchmark(temporizedGroup.GetTableOfSelectedTickers(), ! this.benchmark,true, ! currentDate.AddDays(-this.numDaysForOptimizationPeriod ), ! currentDate, ! this.numberOfEligibleTickers); - this.eligibleTickers = lessCorrelatedFromTemporizedGroup.GetTableOfSelectedTickers(); - SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromEligible = - new SelectorByQuotationAtEachMarketDay( this.eligibleTickers, - false, currentDate.AddDays(-this.numDaysForOptimizationPeriod), - currentDate, this.numberOfEligibleTickers, this.benchmark); - //SelectorByWinningOpenToClose winners = - // new SelectorByWinningOpenToClose(quotedAtEachMarketDayFromMostLiquid.GetTableOfSelectedTickers(), - // false, currentDate.AddDays(-2), - // currentDate, this.numberOfEligibleTickers/4); - //return winners.GetTableOfSelectedTickers(); - //SelectorByOpenCloseCorrelationToBenchmark lessCorrelated = - // new SelectorByOpenCloseCorrelationToBenchmark(quotedAtEachMarketDayFromEligible.GetTableOfSelectedTickers(), - // this.benchmark, true, - // currentDate.AddDays(-this.numDaysForLiquidity), - // currentDate, this.numberOfEligibleTickers/2); - return quotedAtEachMarketDayFromEligible.GetTableOfSelectedTickers(); - //return lessCorrelated.GetTableOfSelectedTickers(); } --- 125,141 ---- SelectorByGroup temporizedGroup = new SelectorByGroup(this.tickerGroupID, currentDate); ! DataTable tickersFromGroup = temporizedGroup.GetTableOfSelectedTickers(); ! SelectorByLiquidity mostLiquid = ! new SelectorByLiquidity(tickersFromGroup, ! false,currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, ! this.numberOfEligibleTickers); ! ! SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromMostLiquid = ! new SelectorByQuotationAtEachMarketDay(mostLiquid.GetTableOfSelectedTickers(), ! false, currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, ! this.numberOfEligibleTickers, this.benchmark); ! ! return quotedAtEachMarketDayFromMostLiquid.GetTableOfSelectedTickers(); } *************** *** 161,166 **** { ! IGenomeManager genManEfficientOTCPortfolio = ! new GenomeManagerForEfficientOTCPortfolio(setOfTickersToBeOptimized, currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, --- 150,155 ---- { ! IGenomeManager genManEfficientOTCCTOPortfolio = ! new GenomeManagerForEfficientOTCCTOPortfolio(setOfTickersToBeOptimized, currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, *************** *** 169,173 **** this.portfolioType); ! GeneticOptimizer GO = new GeneticOptimizer(genManEfficientOTCPortfolio, this.populationSizeForGeneticOptimizer, this.generationNumberForGeneticOptimizer, --- 158,162 ---- this.portfolioType); ! GeneticOptimizer GO = new GeneticOptimizer(genManEfficientOTCCTOPortfolio, this.populationSizeForGeneticOptimizer, this.generationNumberForGeneticOptimizer, *************** *** 180,183 **** --- 169,173 ---- currentDate); this.chosenTickers = ((GenomeMeaning)GO.BestGenome.Meaning).Tickers; + this.chosenTickersPortfolioWeights = ((GenomeMeaning)GO.BestGenome.Meaning).TickersPortfolioWeights; } //else it will be buyed again the previous optimized portfolio Index: EndOfDayTimerHandlerOTC.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/EndOfDayTimerHandlerOTC.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EndOfDayTimerHandlerOTC.cs 14 May 2006 18:39:14 -0000 1.2 --- EndOfDayTimerHandlerOTC.cs 2 Jul 2006 19:57:34 -0000 1.3 *************** *** 142,213 **** protected DataTable getSetOfTickersToBeOptimized(DateTime currentDate) { ! SelectorByGroup temporizedGroup = new SelectorByGroup(this.tickerGroupID, currentDate); ! SelectorByOpenCloseCorrelationToBenchmark lessCorrelatedFromTemporizedGroup = ! new SelectorByOpenCloseCorrelationToBenchmark(temporizedGroup.GetTableOfSelectedTickers(), ! this.benchmark,true, ! currentDate.AddDays(-this.numDaysForOptimizationPeriod ), ! currentDate, ! this.numberOfEligibleTickers); ! ! this.eligibleTickers = lessCorrelatedFromTemporizedGroup.GetTableOfSelectedTickers(); ! SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromEligible = ! new SelectorByQuotationAtEachMarketDay( this.eligibleTickers, ! false, currentDate.AddDays(-this.numDaysForOptimizationPeriod), ! currentDate, this.numberOfEligibleTickers, this.benchmark); ! //SelectorByWinningOpenToClose winners = ! // new SelectorByWinningOpenToClose(quotedAtEachMarketDayFromMostLiquid.GetTableOfSelectedTickers(), ! // false, currentDate.AddDays(-2), ! // currentDate, this.numberOfEligibleTickers/4); ! //return winners.GetTableOfSelectedTickers(); ! //SelectorByOpenCloseCorrelationToBenchmark lessCorrelated = ! // new SelectorByOpenCloseCorrelationToBenchmark(quotedAtEachMarketDayFromEligible.GetTableOfSelectedTickers(), ! // this.benchmark, true, ! // currentDate.AddDays(-this.numDaysForLiquidity), ! // currentDate, this.numberOfEligibleTickers/2); ! return quotedAtEachMarketDayFromEligible.GetTableOfSelectedTickers(); ! ! ! /* ! SelectorByGroup temporizedGroup = new SelectorByGroup(this.tickerGroupID, currentDate); ! ! SelectorByLiquidity mostLiquidFromTemporized = ! new SelectorByLiquidity(temporizedGroup.GetTableOfSelectedTickers(), ! false, currentDate.AddDays(-this.numDaysForOptimizationPeriod), ! currentDate, this.numberOfEligibleTickers); ! ! SelectorByAverageRawOpenPrice selectorByOpenPriceFromMostLiquid = ! new SelectorByAverageRawOpenPrice(mostLiquidFromTemporized.GetTableOfSelectedTickers(), false, ! currentDate.AddDays(-10), currentDate, ! this.numberOfEligibleTickers, this.minPriceForMinimumCommission, ! this.maxPriceForMinimumCommission, 0, 10); ! ! SelectorByOpenCloseCorrelationToBenchmark lessCorrelatedFromSelectedByPrice = ! new SelectorByOpenCloseCorrelationToBenchmark(selectorByOpenPriceFromMostLiquid.GetTableOfSelectedTickers(), ! this.benchmark,true, ! currentDate.AddDays(-this.numDaysForOptimizationPeriod ), ! currentDate, ! this.numberOfEligibleTickers/2); ! this.eligibleTickers = lessCorrelatedFromSelectedByPrice.GetTableOfSelectedTickers(); ! SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromEligible = ! new SelectorByQuotationAtEachMarketDay( this.eligibleTickers, ! false, currentDate.AddDays(-this.numDaysForOptimizationPeriod), ! currentDate, this.numberOfEligibleTickers/2, this.benchmark); ! ! //SelectorByWinningOpenToClose winners = ! // new SelectorByWinningOpenToClose(quotedAtEachMarketDayFromMostLiquid.GetTableOfSelectedTickers(), ! // false, currentDate.AddDays(-2), ! // currentDate, this.numberOfEligibleTickers/4); ! //return winners.GetTableOfSelectedTickers(); ! //SelectorByOpenCloseCorrelationToBenchmark lessCorrelated = ! // new SelectorByOpenCloseCorrelationToBenchmark(quotedAtEachMarketDayFromEligible.GetTableOfSelectedTickers(), ! // this.benchmark, true, ! // currentDate.AddDays(-this.numDaysForLiquidity), ! // currentDate, this.numberOfEligibleTickers/2); ! return quotedAtEachMarketDayFromEligible.GetTableOfSelectedTickers(); ! //return mostLiquidFromQuotedAtEachMarketDay.GetTableOfSelectedTickers(); ! //return lessCorrelated.GetTableOfSelectedTickers(); ! //return selectorByOpenPriceFromMostLiquid.GetTableOfSelectedTickers(); ! */ } --- 142,159 ---- protected DataTable getSetOfTickersToBeOptimized(DateTime currentDate) { ! SelectorByGroup temporizedGroup = new SelectorByGroup(this.tickerGroupID, currentDate); ! DataTable tickersFromGroup = temporizedGroup.GetTableOfSelectedTickers(); ! SelectorByLiquidity mostLiquid = ! new SelectorByLiquidity(tickersFromGroup, ! false,currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, ! this.numberOfEligibleTickers); ! SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromMostLiquid = ! new SelectorByQuotationAtEachMarketDay(mostLiquid.GetTableOfSelectedTickers(), ! false, currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, ! this.numberOfEligibleTickers, this.benchmark); ! ! return quotedAtEachMarketDayFromMostLiquid.GetTableOfSelectedTickers(); ! } *************** *** 229,233 **** // this.targetReturn, // this.portfolioType); ! new GenomeManagerForEfficientOTCTypes (setOfTickersToBeOptimized, currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, --- 175,179 ---- // this.targetReturn, // this.portfolioType); ! new GenomeManagerForEfficientOTCCTOPortfolio(setOfTickersToBeOptimized, currentDate.AddDays(-this.numDaysForOptimizationPeriod), currentDate, Index: GenomeManagerForEfficientCTOPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/GenomeManagerForEfficientCTOPortfolio.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** GenomeManagerForEfficientCTOPortfolio.cs 14 May 2006 18:36:37 -0000 1.18 --- GenomeManagerForEfficientCTOPortfolio.cs 2 Jul 2006 19:57:34 -0000 1.19 *************** *** 106,112 **** this.variance = portfolioVariance; this.rateOfReturn = averagePortfolioRateOfReturn; ! //returnValue = this.getFitnessValue_calculate(); ! returnValue = this.getFitnessValue_calculate() - ! this.genManOTC.GetFitnessValue(genome); } --- 106,112 ---- this.variance = portfolioVariance; this.rateOfReturn = averagePortfolioRateOfReturn; ! returnValue = this.getFitnessValue_calculate(); ! // returnValue = this.getFitnessValue_calculate() - ! // this.genManOTC.GetFitnessValue(genome); } |