[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading PairsTradingMain
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-11-12 20:44:20
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14049/b7_Scripts/WalkForwardTesting/PairsTrading Modified Files: PairsTradingMain.cs Log Message: A new parameter of type Timer has been added to the EndOfDayStrategyBackTester Index: PairsTradingMain.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/PairsTradingMain.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PairsTradingMain.cs 8 Nov 2008 20:36:36 -0000 1.19 --- PairsTradingMain.cs 12 Nov 2008 20:44:13 -0000 1.20 *************** *** 22,27 **** --- 22,29 ---- using System; + using System.Collections.Generic; using QuantProject.ADT; + using QuantProject.ADT.Timing; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting.AccountProviding; *************** *** 89,104 **** #region getBarCache ! private DateTime[] getDailyTimes() { ! DateTime[] dailyTimes = { ! new DateTime( 1900 , 1 , 1 , 10 , 0 , 0 ) , ! new DateTime( 1900 , 1 , 1 , 10 , 30 , 0 ) , ! new DateTime( 1900 , 1 , 1 , 11 , 0 , 0 ) ! }; return dailyTimes; } private IBarCache getBarCache() { ! DateTime[] dailyTimes = this.getDailyTimes(); IBarCache barCache = new DailyBarCache( 60 , dailyTimes ); return barCache; --- 91,105 ---- #region getBarCache ! private List< Time > getDailyTimes() { ! 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 ) ); return dailyTimes; } private IBarCache getBarCache() { ! List< Time > dailyTimes = this.getDailyTimes(); IBarCache barCache = new DailyBarCache( 60 , dailyTimes ); return barCache; *************** *** 121,125 **** string tickersGroupId = "SP500"; // uncomment the following line for a faster script ! // tickersGroupId = "fastTest"; // IEligiblesSelector eligiblesSelector = --- 122,126 ---- string tickersGroupId = "SP500"; // uncomment the following line for a faster script ! tickersGroupId = "fastTest"; // IEligiblesSelector eligiblesSelector = *************** *** 152,156 **** int numberOfBestTestingPositionsToBeReturned = 50; // uncomment the following line for a faster script ! // numberOfBestTestingPositionsToBeReturned = 5; IDecoderForTestingPositions decoderForWeightedPositions = --- 153,157 ---- int numberOfBestTestingPositionsToBeReturned = 50; // uncomment the following line for a faster script ! numberOfBestTestingPositionsToBeReturned = 5; IDecoderForTestingPositions decoderForWeightedPositions = *************** *** 202,206 **** // uncomment the following line for a faster script // inSampleDays = 5; ! // inSampleDays = 60; IIntervalsSelector intervalsSelectorForOutOfSample = --- 203,207 ---- // uncomment the following line for a faster script // inSampleDays = 5; ! inSampleDays = 60; IIntervalsSelector intervalsSelectorForOutOfSample = *************** *** 250,253 **** --- 251,266 ---- return strategyForBacktester; } + + #region getEndOfDayStrategyBackTester + private Timer getTimer( + DateTime firstDateTime , DateTime lastDateTime) + { + List< Time > dailyTimes = this.getDailyTimes(); + IndexBasedHistoricalTimer indexBasedTimer = + new IndexBasedHistoricalTimer( + this.benchmark.Ticker , + firstDateTime , lastDateTime , dailyTimes ); + return indexBasedTimer; + } protected override EndOfDayStrategyBackTester getEndOfDayStrategyBackTester() *************** *** 262,266 **** // uncomment the following two lines for a faster script ! firstDateTime = new DateTime( 2002 , 1 , 1 ); lastDateTime = new DateTime( 2007 , 6 , 30 ); --- 275,279 ---- // uncomment the following two lines for a faster script ! firstDateTime = new DateTime( 2006 , 2 , 1 ); lastDateTime = new DateTime( 2007 , 6 , 30 ); *************** *** 269,273 **** EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( ! backTestId , this.strategyForBacktester , this.historicalMarketValueProviderForTheBacktesterAccount , accountProvider , --- 282,288 ---- EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( ! backTestId , ! this.getTimer( firstDateTime , lastDateTime ) , ! this.strategyForBacktester , this.historicalMarketValueProviderForTheBacktesterAccount , accountProvider , *************** *** 276,279 **** --- 291,295 ---- return endOfDayStrategyBackTester; } + #endregion getEndOfDayStrategyBackTester protected override string getPathForTheMainFolderWhereScriptsResultsAreToBeSaved() |