[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading PairsTradingMain
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-12-10 19:41:12
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14483/b7_Scripts/WalkForwardTesting/PairsTrading Modified Files: PairsTradingMain.cs Log Message: code duplication is now avoided, by using three private members: private Time firstTimeToTestInefficiency; private Time lastTimeToTestInefficiency; private Time timeToClosePositions; Index: PairsTradingMain.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/PairsTradingMain.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** PairsTradingMain.cs 24 Nov 2008 21:04:33 -0000 1.23 --- PairsTradingMain.cs 10 Dec 2008 19:40:56 -0000 1.24 *************** *** 57,60 **** --- 57,63 ---- private Benchmark benchmark; private HistoricalMarketValueProvider historicalMarketValueProviderForInSample; + private Time firstTimeToTestInefficiency; + private Time lastTimeToTestInefficiency; + private Time timeToClosePositions; private HistoricalMarketValueProvider historicalMarketValueProviderForChosingPositionsOutOfSample; *************** *** 85,89 **** // definition for the Fitness Evaluator ! // IEquityEvaluator equityEvaluator = new SharpeRatio(); } --- 88,99 ---- // definition for the Fitness Evaluator ! // IEquityEvaluator equityEvaluator = new SharpeRatio(); ! } ! ! protected override void doThisBeforeAnythingElse() ! { ! this.firstTimeToTestInefficiency = new Time( 10 , 0 , 0 ); ! this.lastTimeToTestInefficiency = new Time( 14 , 0 , 0 ); ! this.timeToClosePositions = new Time( 15 , 50 , 0 ); } *************** *** 94,100 **** { List< Time > dailyTimes = new List< Time >(); ! dailyTimes.Add( new Time( 13 , 0 , 0 ) ); ! dailyTimes.Add( new Time( 14 , 0 , 0 ) ); ! dailyTimes.Add( new Time( 15 , 0 , 0 ) ); // dailyTimes.Add( new Time( // HistoricalEndOfDayTimer.GetOneHourAfterMarketClose( DateTime.Now ) ) ); --- 104,110 ---- { List< Time > dailyTimes = new List< Time >(); ! dailyTimes.Add( this.firstTimeToTestInefficiency ); ! dailyTimes.Add( this.lastTimeToTestInefficiency ); ! dailyTimes.Add( this.timeToClosePositions ); // dailyTimes.Add( new Time( // HistoricalEndOfDayTimer.GetOneHourAfterMarketClose( DateTime.Now ) ) ); *************** *** 155,159 **** int numberOfBestTestingPositionsToBeReturned = 50; // uncomment the following line for a faster script ! // numberOfBestTestingPositionsToBeReturned = 5; IDecoderForTestingPositions decoderForWeightedPositions = --- 165,169 ---- int numberOfBestTestingPositionsToBeReturned = 50; // uncomment the following line for a faster script ! numberOfBestTestingPositionsToBeReturned = 10; IDecoderForTestingPositions decoderForWeightedPositions = *************** *** 205,209 **** // uncomment the following line for a faster script // inSampleDays = 5; ! inSampleDays = 60; IIntervalsSelector intervalsSelectorForOutOfSample = --- 215,219 ---- // uncomment the following line for a faster script // inSampleDays = 5; ! // inSampleDays = 60; IIntervalsSelector intervalsSelectorForOutOfSample = *************** *** 242,248 **** 7 , inSampleDays , intervalsSelectorForInSample , ! new Time( 13 , 0 , 0 ) , ! new Time( 14 , 0 , 0 ) , ! new Time( 15 , 0 , 0 ) , eligiblesSelector , inSampleChooser , this.historicalMarketValueProviderForInSample , --- 252,258 ---- 7 , inSampleDays , intervalsSelectorForInSample , ! this.firstTimeToTestInefficiency , ! this.lastTimeToTestInefficiency , ! this.timeToClosePositions , eligiblesSelector , inSampleChooser , this.historicalMarketValueProviderForInSample , *************** *** 276,282 **** // uncomment the following two lines for a faster script firstDateTime = new DateTime( 2006 , 2 , 1 ); ! lastDateTime = new DateTime( 2006 , 2 , 12 ); ! double maxRunningHours = 1; EndOfDayStrategyBackTester endOfDayStrategyBackTester = --- 286,292 ---- // uncomment the following two lines for a faster script firstDateTime = new DateTime( 2006 , 2 , 1 ); ! lastDateTime = new DateTime( 2007 , 12 , 31 ); ! double maxRunningHours = 5; EndOfDayStrategyBackTester endOfDayStrategyBackTester = *************** *** 302,306 **** protected override string getCustomSmallTextForFolderName() { ! return "pairsTrdngIntrdy_13_14_15"; } --- 312,319 ---- protected override string getCustomSmallTextForFolderName() { ! return "pairsTrdngIntrdy_" + ! this.firstTimeToTestInefficiency.Hour + "_" + ! this.lastTimeToTestInefficiency.Hour + "_" + ! this.timeToClosePositions.Hour; } |