[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging TesterFo
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-11-12 20:44:42
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14085/b7_Scripts/WalkForwardTesting/PairsTrading/Logging Modified Files: TesterForPairsTradingTestingPositions.cs Log Message: A new parameter of type Timer has been added to the EndOfDayStrategyBackTester Index: TesterForPairsTradingTestingPositions.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging/TesterForPairsTradingTestingPositions.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TesterForPairsTradingTestingPositions.cs 29 Sep 2008 21:21:34 -0000 1.5 --- TesterForPairsTradingTestingPositions.cs 12 Nov 2008 20:44:38 -0000 1.6 *************** *** 19,23 **** along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ using System; --- 19,23 ---- along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ using System; *************** *** 100,104 **** SimpleStrategy simpleStrategy = new SimpleStrategy( weightedPositions , ! intervalsSelector , historicalMarketValueProvider ); IAccountProvider accountProvider = new SimpleAccountProvider(); --- 100,104 ---- SimpleStrategy simpleStrategy = new SimpleStrategy( weightedPositions , ! intervalsSelector , historicalMarketValueProvider ); IAccountProvider accountProvider = new SimpleAccountProvider(); *************** *** 106,110 **** DateTime firstDateTime = this.dateTimeWhenThisObjectWasLogged.AddDays( ! - this.numberOfInSampleDays ); DateTime lastDateTime = this.dateTimeWhenThisObjectWasLogged; --- 106,110 ---- DateTime firstDateTime = this.dateTimeWhenThisObjectWasLogged.AddDays( ! - this.numberOfInSampleDays ); DateTime lastDateTime = this.dateTimeWhenThisObjectWasLogged; *************** *** 112,119 **** EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( ! "SinglePosition" , simpleStrategy , ! historicalMarketValueProvider , accountProvider , ! firstDateTime , lastDateTime , ! benchmark , cashToStart , maxRunningHours ); // simpleStrategy.Account = endOfDayStrategyBackTester.Account; --- 112,123 ---- EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( ! "SinglePosition" , ! new QuantProject.Business.Timing.IndexBasedEndOfDayTimer( ! HistoricalEndOfDayTimer.GetMarketOpen( firstDateTime ) , ! benchmark.Ticker ) , ! simpleStrategy , ! historicalMarketValueProvider , accountProvider , ! firstDateTime , lastDateTime , ! benchmark , cashToStart , maxRunningHours ); // simpleStrategy.Account = endOfDayStrategyBackTester.Account; *************** *** 161,165 **** WeightedPositions weightedPositions = this.testingPositions.WeightedPositions; ! WeightedPositions firstPosition = this.getWeightedPositions( weightedPositions[ 0 ] ); --- 165,169 ---- WeightedPositions weightedPositions = this.testingPositions.WeightedPositions; ! WeightedPositions firstPosition = this.getWeightedPositions( weightedPositions[ 0 ] ); *************** *** 168,179 **** AccountReport accountReportForFirstPosition = this.getAccountReport( firstPosition , intervalsSelector , ! historicalMarketValueProvider , ! benchmark , 30000 ); AccountReport accountReportForSecondPosition = this.getAccountReport( secondPosition , intervalsSelector , ! historicalMarketValueProvider , ! benchmark , ! Math.Abs( 30000 * weightedPositions[ 1 ].Weight / ! weightedPositions[ 0 ].Weight ) ); Report report = --- 172,183 ---- AccountReport accountReportForFirstPosition = this.getAccountReport( firstPosition , intervalsSelector , ! historicalMarketValueProvider , ! benchmark , 30000 ); AccountReport accountReportForSecondPosition = this.getAccountReport( secondPosition , intervalsSelector , ! historicalMarketValueProvider , ! benchmark , ! Math.Abs( 30000 * weightedPositions[ 1 ].Weight / ! weightedPositions[ 0 ].Weight ) ); Report report = *************** *** 185,194 **** // accountReportForFirstPosition.EquityLine.LastDateTime , // EndOfDaySpecificTime.OneHourAfterMarketClose ); ! // report.Create( "PearsonDebug" , 1 , // lastEndOfDayDateTimeForReport , // benchmark.Ticker , false ); report.AddEquityLine( accountReportForSecondPosition.EquityLine , ! Color.Brown ); report.ShowDialog(); } --- 189,198 ---- // accountReportForFirstPosition.EquityLine.LastDateTime , // EndOfDaySpecificTime.OneHourAfterMarketClose ); ! // report.Create( "PearsonDebug" , 1 , // lastEndOfDayDateTimeForReport , // benchmark.Ticker , false ); report.AddEquityLine( accountReportForSecondPosition.EquityLine , ! Color.Brown ); report.ShowDialog(); } |