[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading PairsTradingMain
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-09-29 21:21:50
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18913 Modified Files: PairsTradingMain.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: PairsTradingMain.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/PairsTradingMain.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PairsTradingMain.cs 16 Aug 2008 19:38:41 -0000 1.17 --- PairsTradingMain.cs 29 Sep 2008 21:21:34 -0000 1.18 *************** *** 53,61 **** { private Benchmark benchmark; ! private IHistoricalQuoteProvider historicalQuoteProviderForInSample; ! private IHistoricalQuoteProvider ! historicalQuoteProviderForChosingPositionsOutOfSample; ! private IHistoricalQuoteProvider ! historicalQuoteProviderForTheBacktesterAccount; --- 53,61 ---- { private Benchmark benchmark; ! private HistoricalMarketValueProvider historicalMarketValueProviderForInSample; ! private HistoricalMarketValueProvider ! historicalMarketValueProviderForChosingPositionsOutOfSample; ! private HistoricalMarketValueProvider ! historicalMarketValueProviderForTheBacktesterAccount; *************** *** 64,76 **** this.benchmark = new Benchmark( "CCE" ); ! this.historicalQuoteProviderForInSample = new HistoricalRawQuoteProvider(); ! this.historicalQuoteProviderForChosingPositionsOutOfSample = new HistoricalAdjustedQuoteProvider(); // this.historicalQuoteProviderForChosingPositionsOutOfSample = // new HistoricalRawQuoteProvider(); ! this.historicalQuoteProviderForTheBacktesterAccount = new HistoricalRawQuoteProvider(); // this.historicalQuoteProviderForTheBacktesterAccount = --- 64,76 ---- this.benchmark = new Benchmark( "CCE" ); ! this.historicalMarketValueProviderForInSample = new HistoricalRawQuoteProvider(); ! this.historicalMarketValueProviderForChosingPositionsOutOfSample = new HistoricalAdjustedQuoteProvider(); // this.historicalQuoteProviderForChosingPositionsOutOfSample = // new HistoricalRawQuoteProvider(); ! this.historicalMarketValueProviderForTheBacktesterAccount = new HistoricalRawQuoteProvider(); // this.historicalQuoteProviderForTheBacktesterAccount = *************** *** 140,144 **** this.benchmark , decoderForWeightedPositions , fitnessEvaluator , ! this.historicalQuoteProviderForInSample , crossoverRate , mutationRate , elitismRate , populationSizeForGeneticOptimizer , --- 140,144 ---- this.benchmark , decoderForWeightedPositions , fitnessEvaluator , ! this.historicalMarketValueProviderForInSample , crossoverRate , mutationRate , elitismRate , populationSizeForGeneticOptimizer , *************** *** 163,167 **** } ! protected override IEndOfDayStrategyForBacktester getEndOfDayStrategy() { int inSampleDays = 180; --- 163,167 ---- } ! protected override IStrategyForBacktester getStrategyForBacktester() { int inSampleDays = 180; *************** *** 192,202 **** // 2 , 0.006 , 0.99 , 0.006 , 0.99 ); ! IEndOfDayStrategyForBacktester endOfDayStrategyForBacktester = new PairsTradingStrategy( 7 , inSampleDays , intervalsSelectorForInSample , intervalsSelectorForOutOfSample , eligiblesSelector , inSampleChooser , ! this.historicalQuoteProviderForInSample , ! this.historicalQuoteProviderForChosingPositionsOutOfSample , outOfSampleChooser ); // IEndOfDayStrategyForBacktester endOfDayStrategyForBacktester = --- 192,202 ---- // 2 , 0.006 , 0.99 , 0.006 , 0.99 ); ! IStrategyForBacktester strategyForBacktester = new PairsTradingStrategy( 7 , inSampleDays , intervalsSelectorForInSample , intervalsSelectorForOutOfSample , eligiblesSelector , inSampleChooser , ! this.historicalMarketValueProviderForInSample , ! this.historicalMarketValueProviderForChosingPositionsOutOfSample , outOfSampleChooser ); // IEndOfDayStrategyForBacktester endOfDayStrategyForBacktester = *************** *** 214,218 **** // this.historicalQuoteProviderForChosingPositionsOutOfSample , // 0.006 , 0.02 , 0.006 , 0.02 ); ! return endOfDayStrategyForBacktester; } protected override EndOfDayStrategyBackTester --- 214,218 ---- // this.historicalQuoteProviderForChosingPositionsOutOfSample , // 0.006 , 0.02 , 0.006 , 0.02 ); ! return strategyForBacktester; } protected override EndOfDayStrategyBackTester *************** *** 228,240 **** // uncomment the following two lines for a faster script ! // firstDateTime = new DateTime( 2007 , 1 , 1 ); ! // lastDateTime = new DateTime( 2007 , 1 , 31 ); ! double maxRunningHours = 1; EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( ! backTestId , this.endOfDayStrategy , ! this.historicalQuoteProviderForTheBacktesterAccount , accountProvider , firstDateTime , lastDateTime , --- 228,240 ---- // uncomment the following two lines for a faster script ! firstDateTime = new DateTime( 2002 , 1 , 1 ); ! lastDateTime = new DateTime( 2007 , 6 , 30 ); ! double maxRunningHours = 0.05; EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( ! backTestId , this.strategyForBacktester , ! this.historicalMarketValueProviderForTheBacktesterAccount , accountProvider , firstDateTime , lastDateTime , |