[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WeightedPositio
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-09-29 21:22:05
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WeightedPositionsChoosers/WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18958/WeightedPositionsChoosers/WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio Modified Files: WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio.cs WFLagGenomeManagerForFixedPortfolioWithNormalDrivingAndPortfolio.cs Log Message: The new revision moves toward an intraday enabled framework. EndOfDayDate time has been removed, DateTime is used now. The code has been changed accordingly. Index: WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WeightedPositionsChoosers/WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio/WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio.cs 28 Oct 2007 22:35:28 -0000 1.9 --- WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio.cs 29 Sep 2008 21:21:41 -0000 1.10 *************** *** 55,59 **** protected GeneticOptimizer geneticOptimizer; protected WFLagWeightedPositions wFLagChosenPositions; ! private EndOfDayDateTime timeWhenChosePositionsIsRequested; // // first in sample quote date for driving positions --- 55,59 ---- protected GeneticOptimizer geneticOptimizer; protected WFLagWeightedPositions wFLagChosenPositions; ! private DateTime timeWhenChosePositionsIsRequested; // // first in sample quote date for driving positions *************** *** 138,154 **** } #region setChosenPositions_usingTheGeneticOptimizer ! private ReturnIntervals getReturnIntervals( EndOfDayDateTime now ) { DateTime firstInSampleDateForDrivingPositions = ! now.DateTime.AddDays( -( this.NumberDaysForInSampleOptimization - 1 ) ); DateTime lastInSampleOptimizationDate = ! now.DateTime; ReturnIntervals returnIntervals = new CloseToCloseIntervals( ! new EndOfDayDateTime( firstInSampleDateForDrivingPositions , ! EndOfDaySpecificTime.MarketClose ) , ! new EndOfDayDateTime( lastInSampleOptimizationDate , ! EndOfDaySpecificTime.MarketClose ) , this.benchmark ); return returnIntervals; --- 138,156 ---- } #region setChosenPositions_usingTheGeneticOptimizer ! private ReturnIntervals getReturnIntervals( DateTime now ) { DateTime firstInSampleDateForDrivingPositions = ! now.AddDays( -( this.NumberDaysForInSampleOptimization - 1 ) ); DateTime lastInSampleOptimizationDate = ! now; ReturnIntervals returnIntervals = new CloseToCloseIntervals( ! HistoricalEndOfDayTimer.GetMarketClose( firstInSampleDateForDrivingPositions ) , ! HistoricalEndOfDayTimer.GetMarketClose( lastInSampleOptimizationDate ) , ! // new EndOfDayDateTime( firstInSampleDateForDrivingPositions , ! // EndOfDaySpecificTime.MarketClose ) , ! // new EndOfDayDateTime( lastInSampleOptimizationDate , ! // EndOfDaySpecificTime.MarketClose ) , this.benchmark ); return returnIntervals; *************** *** 162,166 **** new WFLagGenerationDebugger( e.Generation , ! this.timeWhenChosePositionsIsRequested.DateTime , this.NumberDaysForInSampleOptimization , this.benchmark ); --- 164,168 ---- new WFLagGenerationDebugger( e.Generation , ! this.timeWhenChosePositionsIsRequested , this.NumberDaysForInSampleOptimization , this.benchmark ); *************** *** 190,194 **** private void setChosenPositions_FromDecodableGenome( IGenomeManager genomeManager , Genome genome , ! EndOfDayDateTime now ) { this.wFLagChosenPositions = --- 192,196 ---- private void setChosenPositions_FromDecodableGenome( IGenomeManager genomeManager , Genome genome , ! DateTime now ) { this.wFLagChosenPositions = *************** *** 209,213 **** public virtual void setChosenPositions_usingTheGeneticOptimizer( WFLagEligibleTickers eligibleTickersForDrivingPositions , ! EndOfDayDateTime now ) { ReturnIntervals returnIntervals = --- 211,215 ---- public virtual void setChosenPositions_usingTheGeneticOptimizer( WFLagEligibleTickers eligibleTickersForDrivingPositions , ! DateTime now ) { ReturnIntervals returnIntervals = *************** *** 247,253 **** private void chosePositions_checkParameters( WFLagEligibleTickers eligibleTickersForDrivingPositions , ! EndOfDayDateTime now ) { ! if ( now.EndOfDaySpecificTime != EndOfDaySpecificTime.OneHourAfterMarketClose ) throw new Exception( "The 'now' parameter must be one hour after market " + "close. It is not." ); --- 249,256 ---- private void chosePositions_checkParameters( WFLagEligibleTickers eligibleTickersForDrivingPositions , ! DateTime now ) { ! if ( HistoricalEndOfDayTimer.IsOneHourAfterMarketClose( now ) ) ! // if ( now.EndOfDaySpecificTime != EndOfDaySpecificTime.OneHourAfterMarketClose ) throw new Exception( "The 'now' parameter must be one hour after market " + "close. It is not." ); *************** *** 269,273 **** WFLagEligibleTickers eligibleTickersForDrivingPositions , WFLagEligibleTickers eligibleTickersForPortfolioPositions , ! EndOfDayDateTime now ) { this.timeWhenChosePositionsIsRequested = now; --- 272,276 ---- WFLagEligibleTickers eligibleTickersForDrivingPositions , WFLagEligibleTickers eligibleTickersForPortfolioPositions , ! DateTime now ) { this.timeWhenChosePositionsIsRequested = now; Index: WFLagGenomeManagerForFixedPortfolioWithNormalDrivingAndPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WeightedPositionsChoosers/WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio/WFLagGenomeManagerForFixedPortfolioWithNormalDrivingAndPortfolio.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** WFLagGenomeManagerForFixedPortfolioWithNormalDrivingAndPortfolio.cs 16 Sep 2007 22:17:18 -0000 1.6 --- WFLagGenomeManagerForFixedPortfolioWithNormalDrivingAndPortfolio.cs 29 Sep 2008 21:21:41 -0000 1.7 *************** *** 127,135 **** // 11 ); GenomeManagement.SetRandomGenerator( seedForRandomGenerator ); ! IHistoricalQuoteProvider historicalQuoteProvider = new HistoricalAdjustedQuoteProvider(); this.closeToCloseReturnsManager = new ReturnsManager( this.returnIntervalsForOptimization , ! historicalQuoteProvider ); this.wFLagMeaningForUndecodableGenomes = --- 127,135 ---- // 11 ); GenomeManagement.SetRandomGenerator( seedForRandomGenerator ); ! HistoricalMarketValueProvider historicalMarketValueProvider = new HistoricalAdjustedQuoteProvider(); this.closeToCloseReturnsManager = new ReturnsManager( this.returnIntervalsForOptimization , ! historicalMarketValueProvider ); this.wFLagMeaningForUndecodableGenomes = |