[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging PairsTra
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-05-03 18:56:46
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6086/b7_Scripts/WalkForwardTesting/PairsTrading/Logging Modified Files: PairsTradingLogItem.cs Log Message: The public method GetTestingPositions() has been added Index: PairsTradingLogItem.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging/PairsTradingLogItem.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PairsTradingLogItem.cs 30 Mar 2008 15:47:50 -0000 1.4 --- PairsTradingLogItem.cs 3 May 2008 17:54:28 -0000 1.5 *************** *** 128,215 **** } #endregion setTestersForPairstTradingTestingPositions ! // private AccountReport getAccountReport( ! // WeightedPositions weightedPositions , ! // IIntervalsSelector intervalsSelector , ! // IHistoricalQuoteProvider historicalQuoteProvider , ! // Benchmark benchmark , ! // double cashToStart ) ! // { ! // SimpleStrategy simpleStrategy = ! // new SimpleStrategy( weightedPositions , ! // intervalsSelector , historicalQuoteProvider ); ! // ! // DateTime firstDateTime = this.simulatedCreationTime.DateTime.AddDays( -90 ); ! // DateTime lastDateTime = this.simulatedCreationTime.DateTime; ! // double maxRunningHours = 0.3; ! // EndOfDayStrategyBackTester endOfDayStrategyBackTester = ! // new EndOfDayStrategyBackTester( ! // "SinglePosition" , simpleStrategy , ! // historicalQuoteProvider , firstDateTime , ! // lastDateTime , benchmark , cashToStart , maxRunningHours ); ! // ! // simpleStrategy.Account = endOfDayStrategyBackTester.Account; ! // ! // endOfDayStrategyBackTester.Run(); ! // return endOfDayStrategyBackTester.AccountReport; ! // } ! // private WeightedPositions getWeightedPositions( ! // WeightedPosition weightedPosition ) ! // { ! // double[] weights = { 1 }; ! // string[] tickers = { weightedPosition.Ticker }; ! // WeightedPositions weightedPositions = ! // new WeightedPositions( weights , tickers ); ! // return weightedPositions; ! // } ! // public void Run3() ! // { ! //// string backTestId = "SimplePairsTrading"; ! //// double cashToStart = 30000; ! // ! // Benchmark benchmark = new Benchmark( "MSFT" ); ! // ! // IHistoricalQuoteProvider historicalQuoteProvider = ! // new HistoricalAdjustedQuoteProvider(); ! // ! //// IInSampleChooser inSampleChooser = ! //// (IInSampleChooser)new ConstantWeightedPositionsChooser( ! //// this.BestWeightedPositionsInSample ); ! // ! // IIntervalsSelector intervalsSelector = ! // new OddIntervalsSelector( 1 , 1 , benchmark ); ! // IEligiblesSelector eligiblesSelector = new DummyEligibleSelector(); ! // ! // WeightedPositions weightedPositions = ! // this.bestTestingPositionsInSample[ 0 ].WeightedPositions; ! // ! // WeightedPositions firstPosition = ! // this.getWeightedPositions( weightedPositions[ 0 ] ); ! // WeightedPositions secondPosition = ! // this.getWeightedPositions( weightedPositions[ 1 ] ); ! // AccountReport accountReportForFirstPosition = ! // this.getAccountReport( firstPosition , intervalsSelector , ! // historicalQuoteProvider , ! // benchmark , 30000 ); ! // AccountReport accountReportForSecondPosition = ! // this.getAccountReport( secondPosition , intervalsSelector , ! // historicalQuoteProvider , ! // benchmark , ! // 30000 * weightedPositions[ 1 ].Weight / ! // weightedPositions[ 0 ].Weight ); ! // ! // Report report = ! // new Report( accountReportForFirstPosition , false ); ! // EndOfDayDateTime lastEndOfDayDateTimeForReport = ! // new EndOfDayDateTime( ! // accountReportForFirstPosition.EquityLine.LastDateTime , ! // EndOfDaySpecificTime.OneHourAfterMarketClose ); ! // ! //// report.Create( "PearsonDebug" , 1 , ! //// lastEndOfDayDateTimeForReport , ! //// benchmark.Ticker , false ); ! // report.AddEquityLine( accountReportForSecondPosition.EquityLine , ! // Color.Brown ); ! // report.ShowDialog(); ! // } public override void Run() { --- 128,150 ---- } #endregion setTestersForPairstTradingTestingPositions ! ! /// <summary> ! /// We don't use a property instead of this method, ! /// to avoid it being shown in the log viewer list ! /// (it would be meaningless in the grid) ! /// </summary> ! public PairsTradingTestingPositions[] ! GetTestingPositions() ! { ! PairsTradingTestingPositions[] testingPositions = ! new PairsTradingTestingPositions[ ! this.testersForBestTestingPositionsInSample.Length ]; ! for ( int i = 0 ; ! i < this.testersForBestTestingPositionsInSample.Length ; i++ ) ! testingPositions[ i ] = ! this.testersForBestTestingPositionsInSample[ i ].TestingPositions; ! return testingPositions; ! } ! public override void Run() { |