quantproject-developers Mailing List for QuantProject (Page 20)
Brought to you by:
glauco_1
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(103) |
Dec
(67) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(52) |
Feb
(9) |
Mar
(69) |
Apr
(53) |
May
(80) |
Jun
(23) |
Jul
(24) |
Aug
(112) |
Sep
(9) |
Oct
|
Nov
(58) |
Dec
(93) |
| 2005 |
Jan
(90) |
Feb
(93) |
Mar
(61) |
Apr
(56) |
May
(37) |
Jun
(61) |
Jul
(55) |
Aug
(68) |
Sep
(25) |
Oct
(46) |
Nov
(41) |
Dec
(37) |
| 2006 |
Jan
(33) |
Feb
(7) |
Mar
(19) |
Apr
(27) |
May
(73) |
Jun
(49) |
Jul
(83) |
Aug
(66) |
Sep
(45) |
Oct
(16) |
Nov
(15) |
Dec
(7) |
| 2007 |
Jan
(14) |
Feb
(33) |
Mar
|
Apr
(21) |
May
|
Jun
(34) |
Jul
(18) |
Aug
(100) |
Sep
(39) |
Oct
(55) |
Nov
(12) |
Dec
(2) |
| 2008 |
Jan
(120) |
Feb
(133) |
Mar
(129) |
Apr
(104) |
May
(42) |
Jun
(2) |
Jul
(52) |
Aug
(99) |
Sep
(134) |
Oct
|
Nov
(137) |
Dec
(48) |
| 2009 |
Jan
(48) |
Feb
(55) |
Mar
(61) |
Apr
(3) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(51) |
Sep
|
Oct
(7) |
Nov
|
Dec
|
| 2010 |
Jan
(7) |
Feb
(1) |
Mar
(145) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
|
| 2011 |
Jan
(78) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(88) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Glauco S. <gla...@us...> - 2009-03-01 21:05:59
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24669/b7_Scripts/WalkForwardTesting/PairsTrading Modified Files: PairsTradingMain.cs Log Message: a variable name has been fixed Index: PairsTradingMain.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/PairsTradingMain.cs,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** PairsTradingMain.cs 28 Feb 2009 18:42:14 -0000 1.29 --- PairsTradingMain.cs 1 Mar 2009 21:05:43 -0000 1.30 *************** *** 242,246 **** // uncomment the following line for a faster script // inSampleDays = 5; ! inSampleDays = 60; IIntervalsSelector intervalsSelectorForOutOfSample = --- 242,246 ---- // uncomment the following line for a faster script // inSampleDays = 5; ! // inSampleDays = 60; IIntervalsSelector intervalsSelectorForOutOfSample = |
|
From: Glauco S. <gla...@us...> - 2009-03-01 21:05:58
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24669/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers Modified Files: OutOfSampleChooserForAlreadyClosing.cs Log Message: a variable name has been fixed Index: OutOfSampleChooserForAlreadyClosing.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/OutOfSampleChooserForAlreadyClosing.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OutOfSampleChooserForAlreadyClosing.cs 28 Feb 2009 18:38:05 -0000 1.2 --- OutOfSampleChooserForAlreadyClosing.cs 1 Mar 2009 21:05:43 -0000 1.3 *************** *** 71,77 **** DateTime yesterdayAtClose = HistoricalEndOfDayTimer.GetMarketClose( yesterdayAtCurrentTime ).AddMinutes( - 1 ); // I'm subtracting 1 minute ! // because the bar for 15.59 is there much more often ! // and I believe that bar open value to be really ! // next to the official close return yesterdayAtClose; } --- 71,77 ---- DateTime yesterdayAtClose = HistoricalEndOfDayTimer.GetMarketClose( yesterdayAtCurrentTime ).AddMinutes( - 1 ); // I'm subtracting 1 minute ! // because the bar for 15.59 is there much more often ! // and I believe that bar open value to be really ! // next to the official close return yesterdayAtClose; } *************** *** 117,130 **** WeightedPositions candidate ) { ! WeightedPositions weightedPositions = base.getWeightedPositionsIfThereIsInefficiency( ! currentDateTime , returnsManagerToTestInefficiency , candidate ); ! if ( ( weightedPositions != null ) && this.inefficiencyCorrectionDetector.IsInefficiencyCorrectionHappening( currentDateTime , returnsManagerToTestInefficiency.ReturnIntervals[ 0 ] , ! weightedPositions ) ) // the candidate is inefficient but the gap is closing ! weightedPositions = candidate; ! return weightedPositions; } #endregion getWeightedPositionsFromCandidateWithoutAdjustment --- 117,132 ---- WeightedPositions candidate ) { ! WeightedPositions weightedPositionsToBeReturned = null; ! WeightedPositions inefficientWeightedPositions = ! base.getWeightedPositionsIfThereIsInefficiency( ! currentDateTime , returnsManagerToTestInefficiency , candidate ); ! if ( ( inefficientWeightedPositions != null ) && this.inefficiencyCorrectionDetector.IsInefficiencyCorrectionHappening( currentDateTime , returnsManagerToTestInefficiency.ReturnIntervals[ 0 ] , ! inefficientWeightedPositions ) ) // the candidate is inefficient but the gap is closing ! weightedPositionsToBeReturned = inefficientWeightedPositions; ! return weightedPositionsToBeReturned; } #endregion getWeightedPositionsFromCandidateWithoutAdjustment |
|
From: Glauco S. <gla...@us...> - 2009-03-01 21:05:58
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/InefficiencyCorrectionDetecion In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24669/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/InefficiencyCorrectionDetecion Modified Files: ConsecutiveMinutesOfCorrectionDetector.cs Log Message: a variable name has been fixed Index: ConsecutiveMinutesOfCorrectionDetector.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/InefficiencyCorrectionDetecion/ConsecutiveMinutesOfCorrectionDetector.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ConsecutiveMinutesOfCorrectionDetector.cs 28 Feb 2009 18:24:59 -0000 1.1 --- ConsecutiveMinutesOfCorrectionDetector.cs 1 Mar 2009 21:05:43 -0000 1.2 *************** *** 121,129 **** ReturnsManager returnsManager , WeightedPositions weightedPositions ) { ! bool areAllNegative = false; try { float[] returns = weightedPositions.GetReturns( returnsManager ); ! areAllNegative = this.areAllPositiveReturns( returns ); } catch( TickerNotExchangedException tickerNotExchangedException ) --- 121,129 ---- ReturnsManager returnsManager , WeightedPositions weightedPositions ) { ! bool areAllPositive = false; try { float[] returns = weightedPositions.GetReturns( returnsManager ); ! areAllPositive = this.areAllPositiveReturns( returns ); } catch( TickerNotExchangedException tickerNotExchangedException ) *************** *** 131,135 **** string toAvoidCompileWarning = tickerNotExchangedException.Message; } ! return areAllNegative; } #endregion areAllPositiveReturns --- 131,135 ---- string toAvoidCompileWarning = tickerNotExchangedException.Message; } ! return areAllPositive; } #endregion areAllPositiveReturns |
|
From: Glauco S. <gla...@us...> - 2009-03-01 21:05:57
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24669/b91_QuantProject Modified Files: app.config Log Message: a variable name has been fixed Index: app.config =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b91_QuantProject/app.config,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** app.config 20 Jul 2008 20:39:26 -0000 1.6 --- app.config 1 Mar 2009 21:05:43 -0000 1.7 *************** *** 7,16 **** <appSettings> ! <add key="AccountsArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedAccounts\\" /> ! <add key="ReportsArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedReports\\" /> ! <add key="TransactionsArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedTransactions\\" /> ! <add key="GenomesArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedGenomes\\" /> ! <add key="GenericArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\GenericArchive\\" /> ! </appSettings> </configuration> --- 7,18 ---- <appSettings> ! <add key="AccountsArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedAccounts\\" /> ! <add key="ReportsArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedReports\\" /> ! <add key="TransactionsArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedTransactions\\" /> ! <add key="GenomesArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\SavedGenomes\\" /> ! <add key="GenericArchive" value="C:\\Documents and Settings\\Marco\\Documenti\\ProgettiOpenSource\\Quant\\GenericArchive\\" /> ! <add key="dbType" value="MySQL" /> ! <add key="mySqlConnectionString" value="Database=quantproject;Data Source=localhost;User Id=root;Password=1111" /> ! </appSettings> </configuration> |
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WeightedPositionsChoosers/WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31572/b7_Scripts/WalkForwardTesting/WalkForwardLag/WeightedPositionsChoosers/WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio Modified Files: WFLagGenomeManagerForFixedPortfolioWithNormalDrivingAndPortfolio.cs Log Message: Commented code has been cleaned out Index: WFLagGenomeManagerForFixedPortfolioWithNormalDrivingAndPortfolio.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WeightedPositionsChoosers/WFLagGeneticFixedPortfolioWithNormalDrivingAndPortfolio/WFLagGenomeManagerForFixedPortfolioWithNormalDrivingAndPortfolio.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** WFLagGenomeManagerForFixedPortfolioWithNormalDrivingAndPortfolio.cs 29 Sep 2008 21:21:41 -0000 1.7 --- WFLagGenomeManagerForFixedPortfolioWithNormalDrivingAndPortfolio.cs 28 Feb 2009 18:46:38 -0000 1.8 *************** *** 515,528 **** WeightedPositions weightedPositions = new WeightedPositions( balancedWeightsForDrivingPositions , signedTickers.Tickers ); - // string[] tickersForDrivingPositions = - // this.getTickersForDrivingPositions( genome ); - // double[] weightsForDrivingPositions = - // this.getWeightsForDrivingPositions( genome ); - // double[] balancedWeightsForDrivingPositions = - // WeightedPositions.GetBalancedWeights( qui!!!! , weightsForDrivingPositions ); - // return this.decodeWeightedPositions( - // weightsForDrivingPositions , - // tickersForDrivingPositions , - // this.eligibleTickersForDrivingWeightedPositions ); return weightedPositions; } --- 515,518 ---- |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:46:01
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Timing In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30877/b1_ADT/Timing Modified Files: Time.cs Log Message: The new public method AddHours() has been added Index: Time.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Timing/Time.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Time.cs 5 Feb 2009 22:18:15 -0000 1.9 --- Time.cs 28 Feb 2009 18:45:55 -0000 1.10 *************** *** 83,86 **** --- 83,105 ---- } + #region AddHours + /// <summary> + /// Adds the given hours to the current instance's value + /// </summary> + /// <param name="hoursToAdd">hours to add (if positive) or to + /// subtract (if negative) from the current instance</param> + /// <returns></returns> + public Time AddHours( double hoursToAdd ) + { + DateTime standardDateTimeWithHoursAdded = + this.standardDateTime.AddHours( hoursToAdd ); + if ( standardDateTimeWithHoursAdded.Day != this.standardDateTime.Day ) + throw new Exception( + "hoursToAdd is too big, for the current time. " + + "The resulting Time would be the day after" ); + return new Time( standardDateTimeWithHoursAdded ); + } + #endregion AddHours + /// <summary> /// Returns a new DateTime, having the date as the given dateTime |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:45:14
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30075/b7_Scripts/WalkForwardTesting/PairsTrading/Logging Modified Files: TesterForPairsTradingTestingPositions.cs Log Message: This class has been changed to test ticker couples intraday (to be further improved) Index: TesterForPairsTradingTestingPositions.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging/TesterForPairsTradingTestingPositions.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TesterForPairsTradingTestingPositions.cs 12 Nov 2008 20:44:38 -0000 1.6 --- TesterForPairsTradingTestingPositions.cs 28 Feb 2009 18:45:06 -0000 1.7 *************** *** 3,7 **** TesterForPairsTradingTestingPositions.cs ! Copyright (C) 2008 Glauco Siliprandi --- 3,7 ---- TesterForPairsTradingTestingPositions.cs ! Copyright (C) 2009 Glauco Siliprandi *************** *** 24,27 **** --- 24,29 ---- using System.Drawing; + using QuantProject.ADT.Histories; + using QuantProject.Data.DataProviders.Bars.Caching; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting.AccountProviding; *************** *** 33,36 **** --- 35,39 ---- using QuantProject.Business.Strategies.ReturnsManagement.Time.IntervalsSelectors; using QuantProject.Business.Timing; + using QuantProject.Presentation; using QuantProject.Presentation.Reporting.WindowsForm; using QuantProject.Scripts.General.Strategies; *************** *** 48,51 **** --- 51,56 ---- private DateTime dateTimeWhenThisObjectWasLogged; + private HistoricalMarketValueProvider historicalMarketValueProvider; + /// <summary> /// Generation when the TestingPositions object has been created *************** *** 79,84 **** this.testingPositions = (PairsTradingTestingPositions)testingPositions; this.numberOfInSampleDays = numberOfInSampleDays; ! this.dateTimeWhenThisObjectWasLogged = ! dateTimeWhenThisObjectWasLogged; } private void checkParameters( TestingPositions testingPositions ) --- 84,88 ---- this.testingPositions = (PairsTradingTestingPositions)testingPositions; this.numberOfInSampleDays = numberOfInSampleDays; ! this.dateTimeWhenThisObjectWasLogged = dateTimeWhenThisObjectWasLogged; } private void checkParameters( TestingPositions testingPositions ) *************** *** 89,202 **** "PairsTradingTestingPositions!" ); } ! #region Run ! private AccountReport getAccountReport( ! WeightedPositions weightedPositions , ! IIntervalsSelector intervalsSelector , ! HistoricalMarketValueProvider historicalMarketValueProvider , ! Benchmark benchmark , ! double cashToStart ) { - SimpleStrategy simpleStrategy = - new SimpleStrategy( weightedPositions , - intervalsSelector , historicalMarketValueProvider ); - IAccountProvider accountProvider = - new SimpleAccountProvider(); - DateTime firstDateTime = ! this.dateTimeWhenThisObjectWasLogged.AddDays( ! - this.numberOfInSampleDays ); DateTime lastDateTime = ! this.dateTimeWhenThisObjectWasLogged; ! double maxRunningHours = 0.3; ! 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; ! ! endOfDayStrategyBackTester.Run(); ! return endOfDayStrategyBackTester.AccountReport; } ! private double getWeightedPositions_getWeight( ! WeightedPosition weightedPosition ) { ! double weight = 1; ! if ( weightedPosition.IsShort ) ! // the current WeightedPosition is short in the couple correlation ! weight = -1; ! return weight; } ! private WeightedPositions getWeightedPositions( ! WeightedPosition weightedPosition ) { ! // double[] weights = { 1 }; ! double[] weights = { this.getWeightedPositions_getWeight( weightedPosition ) }; ! string[] tickers = { weightedPosition.Ticker }; ! WeightedPositions weightedPositions = ! new WeightedPositions( weights , tickers ); ! return weightedPositions; } public void Run() { ! // string backTestId = "SimplePairsTrading"; ! // double cashToStart = 30000; ! ! Benchmark benchmark = new Benchmark( "MSFT" ); ! ! HistoricalMarketValueProvider historicalMarketValueProvider = ! new HistoricalAdjustedQuoteProvider(); ! ! // IInSampleChooser inSampleChooser = ! // (IInSampleChooser)new ConstantWeightedPositionsChooser( ! // this.BestWeightedPositionsInSample ); ! ! IIntervalsSelector intervalsSelector = ! new OddIntervalsSelector( 1 , 1 , benchmark ); ! IEligiblesSelector eligiblesSelector = new DummyEligibleSelector(); ! ! WeightedPositions weightedPositions = ! this.testingPositions.WeightedPositions; ! ! WeightedPositions firstPosition = ! this.getWeightedPositions( weightedPositions[ 0 ] ); ! WeightedPositions secondPosition = ! this.getWeightedPositions( weightedPositions[ 1 ] ); ! 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 = ! new Report( accountReportForFirstPosition , false ); ! DateTime lastDateTimeForReport = ! HistoricalEndOfDayTimer.GetOneHourAfterMarketClose( ! accountReportForFirstPosition.EquityLine.LastDateTime ); ! // new EndOfDayDateTime( ! // accountReportForFirstPosition.EquityLine.LastDateTime , ! // EndOfDaySpecificTime.OneHourAfterMarketClose ); ! ! // report.Create( "PearsonDebug" , 1 , ! // lastEndOfDayDateTimeForReport , ! // benchmark.Ticker , false ); ! report.AddEquityLine( accountReportForSecondPosition.EquityLine , ! Color.Brown ); ! report.ShowDialog(); } #endregion Run } } --- 93,172 ---- "PairsTradingTestingPositions!" ); } ! #region Run ! ! #region getHistory ! ! #region addItemsToHistory ! private DateTime getFirstDateTime() { DateTime firstDateTime = ! HistoricalEndOfDayTimer.GetMarketOpen( ! this.dateTimeWhenThisObjectWasLogged.AddDays( 1 ) ); ! return firstDateTime; ! } ! private DateTime getLastDateTime() ! { ! DateTime firstDateTime = this.getFirstDateTime(); DateTime lastDateTime = ! HistoricalEndOfDayTimer.GetMarketClose( firstDateTime ); ! return lastDateTime; } ! private void addItemToHistory( ! WeightedPosition weightedPosition , DateTime dateTime , History history ) { ! try ! { ! double marketValue = this.historicalMarketValueProvider.GetMarketValue( ! weightedPosition.Ticker , dateTime ); ! history.Add( dateTime , marketValue ); ! } ! catch( TickerNotExchangedException tickerNotExchangedException ) ! { ! string toAvoidWarning = tickerNotExchangedException.Message; ! } } ! private void addItemsToHistory( WeightedPosition weightedPosition , History history ) { ! DateTime currentDateTime = this.getFirstDateTime(); ! DateTime lastDateTime = this.getLastDateTime(); ! while ( currentDateTime <= lastDateTime ) ! { ! this.addItemToHistory( weightedPosition , currentDateTime , history ); ! currentDateTime = currentDateTime.AddMinutes( 1 ); ! } ! } ! #endregion addItemsToHistory ! ! private History getHistory( WeightedPosition weightedPosition ) ! { ! History history = new History(); ! this.addItemsToHistory( weightedPosition , history ); ! return history; ! } ! #endregion getHistory ! ! private void showHistoriesPlots( ! History historyForFirstPosition , History historyForSecondPosition ) ! { ! HistoriesViewer historiesViewer = new HistoriesViewer(); ! historiesViewer.Add( historyForFirstPosition , Color.Green ); ! historiesViewer.Add( historyForSecondPosition , Color.Red ); ! historiesViewer.ShowDialog(); } + public void Run() { ! this.historicalMarketValueProvider = new HistoricalBarProvider( ! new SimpleBarCache( 60 ) ); ! History historyForFirstPosition = this.getHistory( ! this.testingPositions.WeightedPositions[ 0 ] ); ! History historyForSecondPosition = this.getHistory( ! this.testingPositions.WeightedPositions[ 1 ] ); ! this.showHistoriesPlots( historyForFirstPosition , historyForSecondPosition ); } #endregion Run + } } |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:44:08
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/Bars/Caching In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27993/b3_Data/DataProviders/Bars/Caching Modified Files: SimpleBarCache.cs Log Message: The WasExchanged() method has been fixed Index: SimpleBarCache.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/Bars/Caching/SimpleBarCache.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SimpleBarCache.cs 8 Feb 2009 19:12:17 -0000 1.3 --- SimpleBarCache.cs 28 Feb 2009 18:44:02 -0000 1.4 *************** *** 48,52 **** public double GetMarketValue( string ticker, DateTime dateTime ) { ! double returnValue = double.MinValue; try { --- 48,52 ---- public double GetMarketValue( string ticker, DateTime dateTime ) { ! double returnValue = double.NaN; try { *************** *** 64,77 **** public bool WasExchanged( string ticker , DateTime dateTime ) { ! double marketValue = double.NaN; try { ! marketValue = this.GetMarketValue( ticker , dateTime ); } catch ( MissingBarException missingBarException ) { ! string doNothing = missingBarException.Message; doNothing += ""; } ! return (marketValue != Double.NaN); } } --- 64,80 ---- public bool WasExchanged( string ticker , DateTime dateTime ) { ! bool wasExchanged = true; ! // double marketValue = double.NaN; try { ! this.GetMarketValue( ticker , dateTime ); } catch ( MissingBarException missingBarException ) { ! // the bar is not in the database ! wasExchanged = false; ! string toAvoidCompileWarning = missingBarException.Message; } ! return wasExchanged; } } |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:43:23
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/returnsManagement/time In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25809/b4_Business/a2_Strategies/returnsManagement/time Modified Files: ReturnIntervals.cs Log Message: A new constuctor without parameters is now available Index: ReturnIntervals.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/returnsManagement/time/ReturnIntervals.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ReturnIntervals.cs 29 Sep 2008 21:17:14 -0000 1.9 --- ReturnIntervals.cs 28 Feb 2009 18:43:16 -0000 1.10 *************** *** 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; *************** *** 46,56 **** private IIntervalsSelector intervalsSelector; ! public ReturnInterval this[ int index ] { ! get { return( (ReturnInterval) this.List[ index ] ); } ! set { this.List[ index ] = value; --- 46,56 ---- private IIntervalsSelector intervalsSelector; ! public ReturnInterval this[ int index ] { ! get { return( (ReturnInterval) this.List[ index ] ); } ! set { this.List[ index ] = value; *************** *** 67,72 **** if ( this.Count == 0 ) throw new Exception( "LastEndOfDayDateTime " + ! "cannot be used when ReturnIntervals has " + ! "no ReturnInterval added yet!" ); return this[ this.Count - 1 ].End; } --- 67,72 ---- if ( this.Count == 0 ) throw new Exception( "LastEndOfDayDateTime " + ! "cannot be used when ReturnIntervals has " + ! "no ReturnInterval added yet!" ); return this[ this.Count - 1 ].End; } *************** *** 78,83 **** if ( this.Count == 0 ) throw new Exception( "LastInterval " + ! "cannot be used when ReturnIntervals has " + ! "no ReturnInterval added yet!" ); ReturnInterval lastInterval = this[ this.Count - 1 ]; return lastInterval; --- 78,83 ---- if ( this.Count == 0 ) throw new Exception( "LastInterval " + ! "cannot be used when ReturnIntervals has " + ! "no ReturnInterval added yet!" ); ReturnInterval lastInterval = this[ this.Count - 1 ]; return lastInterval; *************** *** 135,139 **** { this.returnIntervals_initialize( firstDateTime, ! lastDateTime , benchmark , 1 );//default intervals are daily } --- 135,139 ---- { this.returnIntervals_initialize( firstDateTime, ! lastDateTime , benchmark , 1 );//default intervals are daily } *************** *** 145,149 **** /// <param name="lastDateTime"></param> /// <param name="benchmark"></param> ! /// <param name="intervalLength"></param> public ReturnIntervals( DateTime firstDateTime , DateTime lastDateTime , --- 145,149 ---- /// <param name="lastDateTime"></param> /// <param name="benchmark"></param> ! /// <param name="intervalLength"></param> public ReturnIntervals( DateTime firstDateTime , DateTime lastDateTime , *************** *** 167,170 **** --- 167,178 ---- /// <summary> + /// creates a ReturnIntervals with no ReturnInterval + /// </summary> + public ReturnIntervals() + { + } + + + /// <summary> /// It creates a ReturnIntervals with just a ReturnInterval /// </summary> *************** *** 178,182 **** this.marketDaysForBenchmark = QuantProject.Data.DataTables.Quotes.GetMarketDays( this.benchmark , ! this.firstDateTime , this.lastDateTime ); } --- 186,190 ---- this.marketDaysForBenchmark = QuantProject.Data.DataTables.Quotes.GetMarketDays( this.benchmark , ! this.firstDateTime , this.lastDateTime ); } *************** *** 200,215 **** foreach ( ReturnInterval returnInterval in this ) if ( !returnInterval.AreBordersCoveredBy( history ) ) ! areAllCovered = false; return areAllCovered; } #region setBordersHistory private bool beginsBeforeTheLastAdded( ReturnInterval ! returnInterval ) { bool beginsBefore = ( ( this.bordersHistory != null ) && ! ( this.bordersHistory.Count > 0 ) && ! ( returnInterval.BeginsBefore( ! this.bordersHistory.LastDateTime ) ) ); return beginsBefore; } --- 208,223 ---- foreach ( ReturnInterval returnInterval in this ) if ( !returnInterval.AreBordersCoveredBy( history ) ) ! areAllCovered = false; return areAllCovered; } #region setBordersHistory private bool beginsBeforeTheLastAdded( ReturnInterval ! returnInterval ) { bool beginsBefore = ( ( this.bordersHistory != null ) && ! ( this.bordersHistory.Count > 0 ) && ! ( returnInterval.BeginsBefore( ! this.bordersHistory.LastDateTime ) ) ); return beginsBefore; } *************** *** 219,230 **** if ( this.beginsBeforeTheLastAdded( returnInterval ) ) throw new Exception( "The first border of the given interval " + ! "begins before the last EndOfDayDateTime added to the history" ); } private bool beginsOnTheLastAddedTime( ReturnInterval returnInterval ) { bool returnValue = ! ( ( this.bordersHistory != null ) && ! ( this.bordersHistory.Count > 0 ) && ! ( this.bordersHistory.LastDateTime == returnInterval.Begin ) ); return returnValue; } --- 227,238 ---- if ( this.beginsBeforeTheLastAdded( returnInterval ) ) throw new Exception( "The first border of the given interval " + ! "begins before the last EndOfDayDateTime added to the history" ); } private bool beginsOnTheLastAddedTime( ReturnInterval returnInterval ) { bool returnValue = ! ( ( this.bordersHistory != null ) && ! ( this.bordersHistory.Count > 0 ) && ! ( this.bordersHistory.LastDateTime == returnInterval.Begin ) ); return returnValue; } *************** *** 254,261 **** --- 262,278 ---- } #endregion setBordersHistory + + #region Add + private void checkParameter( ReturnInterval returnInterval ) + { + if ( ( this.Count > 0 ) && ( returnInterval.Begin < this.LastDateTime ) ) + throw new Exception( "returnInterval must be later" ); + } public void Add( ReturnInterval returnInterval ) { + this.checkParameter( returnInterval ); this.List.Add( returnInterval ); } + #endregion Add #region appendIntervalsButDontGoBeyondLastDate *************** *** 272,276 **** if ( firstDate < currentLastDateTime ) throw new Exception( "firstDate cannot be smaller than " + ! "the end of the last interval already in this collection!" ); } } --- 289,293 ---- if ( firstDate < currentLastDateTime ) throw new Exception( "firstDate cannot be smaller than " + ! "the end of the last interval already in this collection!" ); } } *************** *** 379,383 **** lastDate ); if ( this.LastDateTime < lastDate ) ! // lastDate comes after the last interval already added this.AppendIntervalsButDontGoBeyondLastDate( lastDate ); ReturnInterval lastInterval = --- 396,400 ---- lastDate ); if ( this.LastDateTime < lastDate ) ! // lastDate comes after the last interval already added this.AppendIntervalsButDontGoBeyondLastDate( lastDate ); ReturnInterval lastInterval = |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:42:21
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24351/b7_Scripts/WalkForwardTesting/PairsTrading Modified Files: PairsTradingMain.cs Log Message: The new PairsTradingIntradayStrategy is called Index: PairsTradingMain.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/PairsTradingMain.cs,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** PairsTradingMain.cs 18 Feb 2009 20:05:34 -0000 1.28 --- PairsTradingMain.cs 28 Feb 2009 18:42:14 -0000 1.29 *************** *** 71,78 **** this.historicalMarketValueProviderForInSample = ! new HistoricalRawQuoteProvider(); this.historicalMarketValueProviderForChosingPositionsOutOfSample = ! this.getHistoricalBarProvider(); // this.historicalMarketValueProviderForChosingPositionsOutOfSample = // new HistoricalAdjustedQuoteProvider(); --- 71,78 ---- this.historicalMarketValueProviderForInSample = ! new HistoricalAdjustedQuoteProvider(); this.historicalMarketValueProviderForChosingPositionsOutOfSample = ! this.getHistoricalMarketValueProviderForChosingPositionsOutOfSample(); // this.historicalMarketValueProviderForChosingPositionsOutOfSample = // new HistoricalAdjustedQuoteProvider(); *************** *** 81,85 **** this.historicalMarketValueProviderForTheBacktesterAccount = ! this.historicalMarketValueProviderForChosingPositionsOutOfSample; // this.historicalMarketValueProviderForTheBacktesterAccount = // new HistoricalRawQuoteProvider(); --- 81,85 ---- this.historicalMarketValueProviderForTheBacktesterAccount = ! this.getHistoricalMarketValueProviderForTheBacktesterAccount(); // this.historicalMarketValueProviderForTheBacktesterAccount = // new HistoricalRawQuoteProvider(); *************** *** 98,101 **** --- 98,103 ---- } + #region getHistoricalMarketValueProviderForChosingPositionsOutOfSample + #region getHistoricalBarProvider *************** *** 117,122 **** private IBarCache getBarCache() { ! List< Time > dailyTimes = this.getDailyTimes(); ! IBarCache barCache = new DailyBarCache( 60 , dailyTimes ); return barCache; } --- 119,125 ---- private IBarCache getBarCache() { ! // List< Time > dailyTimes = this.getDailyTimes(); ! // IBarCache barCache = new DailyBarCache( 60 , dailyTimes ); ! IBarCache barCache = new SimpleBarCache( 60 ); return barCache; } *************** *** 126,134 **** { IBarCache barCache = getBarCache(); ! HistoricalBarProvider historicalBarProvider = ! new HistoricalBarProvider( barCache ); return historicalBarProvider; } #endregion getHistoricalBarProvider protected override IEligiblesSelector getEligiblesSelector() --- 129,158 ---- { IBarCache barCache = getBarCache(); ! HistoricalBarProvider historicalBarProvider = new HistoricalBarProvider( barCache ); return historicalBarProvider; } #endregion getHistoricalBarProvider + + private HistoricalMarketValueProvider + getHistoricalMarketValueProviderForChosingPositionsOutOfSample() + { + HistoricalBarProvider historicalBarProvider = + this.getHistoricalBarProvider(); + // HistoricalMarketValueProviderWithQuoteBackupOnClose + // historicalMarketValueProviderForChosingPositionsOutOfSample = + // new HistoricalMarketValueProviderWithQuoteBackupOnClose( historicalBarProvider ); + return historicalBarProvider; + } + #endregion getHistoricalMarketValueProviderForChosingPositionsOutOfSample + + private HistoricalMarketValueProvider + getHistoricalMarketValueProviderForTheBacktesterAccount() + { + HistoricalMarketValueProviderWithQuoteBackupOnClose + historicalMarketValueProviderForTheBacktesterAccount = + new HistoricalMarketValueProviderWithQuoteBackupOnClose( + this.historicalMarketValueProviderForChosingPositionsOutOfSample ); + return historicalMarketValueProviderForTheBacktesterAccount; + } protected override IEligiblesSelector getEligiblesSelector() *************** *** 138,142 **** string tickersGroupId = "SP500"; // uncomment the following line for a faster script ! tickersGroupId = "fastTest"; // IEligiblesSelector eligiblesSelector = --- 162,166 ---- string tickersGroupId = "SP500"; // uncomment the following line for a faster script ! // tickersGroupId = "fastTest"; // IEligiblesSelector eligiblesSelector = *************** *** 168,172 **** int numberOfBestTestingPositionsToBeReturned = 50; // uncomment the following line for a faster script ! numberOfBestTestingPositionsToBeReturned = 10; IDecoderForTestingPositions decoderForWeightedPositions = --- 192,196 ---- int numberOfBestTestingPositionsToBeReturned = 50; // uncomment the following line for a faster script ! // numberOfBestTestingPositionsToBeReturned = 10; IDecoderForTestingPositions decoderForWeightedPositions = *************** *** 237,247 **** OutOfSampleChooser outOfSampleChooser = new OutOfSampleChooserForSingleLongAndShort( ! 0.01 , 0.03 , 0.01 , 0.03 ); // outOfSampleChooser = // new OutOfSampleChooserForExactNumberOfBestLongPositions( // 2 , 0.006 , 0.99 , 0.006 , 0.99 ); outOfSampleChooser = new OutOfSampleChooserForAlreadyClosing( ! 0.01 , 0.03 , 0.01 , 0.03 , 4 ); IStrategyForBacktester strategyForBacktester = --- 261,274 ---- OutOfSampleChooser outOfSampleChooser = new OutOfSampleChooserForSingleLongAndShort( ! this.firstTimeToTestInefficiency , 0.01 , 0.03 , 0.01 , 0.03 ); // outOfSampleChooser = // new OutOfSampleChooserForExactNumberOfBestLongPositions( // 2 , 0.006 , 0.99 , 0.006 , 0.99 ); + IInefficiencyCorrectionDetector inefficiencyCorrectionDetector = + new ConsecutiveMinutesOfCorrectionDetector( + this.historicalMarketValueProviderForChosingPositionsOutOfSample , 4 ); outOfSampleChooser = new OutOfSampleChooserForAlreadyClosing( ! 0.006 , 0.03 , 0.006 , 0.03 , inefficiencyCorrectionDetector ); IStrategyForBacktester strategyForBacktester = *************** *** 254,257 **** --- 281,288 ---- outOfSampleChooser ); + IExitStrategy exitStrategy = new TakeProfitStrategyOrOnMarketClose( + outOfSampleChooser.MinThresholdForGoingLong / 2 , + this.historicalMarketValueProviderForChosingPositionsOutOfSample ); + strategyForBacktester = new PairsTradingIntradayStrategy( *************** *** 264,277 **** this.historicalMarketValueProviderForInSample , this.historicalMarketValueProviderForChosingPositionsOutOfSample , ! outOfSampleChooser ); ! // qui!!! ! // strategyForBacktester = ! // new PairsTradingAfterClosingStrategy( ! // 7 , inSampleDays , ! // intervalsSelectorForInSample , ! // eligiblesSelector , inSampleChooser , ! // this.historicalMarketValueProviderForInSample , ! // this.historicalMarketValueProviderForChosingPositionsOutOfSample , ! // outOfSampleChooser ); return strategyForBacktester; } --- 295,302 ---- this.historicalMarketValueProviderForInSample , this.historicalMarketValueProviderForChosingPositionsOutOfSample , ! outOfSampleChooser , exitStrategy , ! new Time( 10 , 0 , 0 ) , ! new Time( 15 , 30 , 0 ) ! ); return strategyForBacktester; } *************** *** 302,308 **** firstDateTime = new DateTime( 2006 , 1 , 2 ); // lastDateTime = new DateTime( 2007 , 12 , 31 ); ! lastDateTime = new DateTime( 2006 , 1 , 31 ); ! double maxRunningHours = 2.5; EndOfDayStrategyBackTester endOfDayStrategyBackTester = --- 327,333 ---- firstDateTime = new DateTime( 2006 , 1 , 2 ); // lastDateTime = new DateTime( 2007 , 12 , 31 ); ! lastDateTime = new DateTime( 2006 , 12 , 31 ); ! double maxRunningHours = 11; EndOfDayStrategyBackTester endOfDayStrategyBackTester = *************** *** 322,326 **** { string pathForTheMainFolderWhereScriptsResultsAreToBeSaved = ! "C:\\qpReports\\pairsTrading\\"; return pathForTheMainFolderWhereScriptsResultsAreToBeSaved; } --- 347,351 ---- { string pathForTheMainFolderWhereScriptsResultsAreToBeSaved = ! @"T:\senzaBackup\qpReports\pairsTrading\"; return pathForTheMainFolderWhereScriptsResultsAreToBeSaved; } *************** *** 349,353 **** { string fullPathFileNameForMain = ! @"C:\QuantProject\QuantProject\b7_Scripts\WalkForwardTesting\PairsTrading\PairsTradingMain.cs"; return fullPathFileNameForMain; } --- 374,378 ---- { string fullPathFileNameForMain = ! @"T:\QuantProject\QuantProject\b7_Scripts\WalkForwardTesting\PairsTrading\PairsTradingMain.cs"; return fullPathFileNameForMain; } |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:41:39
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Strategies In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24044/b7_Scripts/WalkForwardTesting/PairsTrading/Strategies Modified Files: PairsTradingIntradayStrategy.cs Log Message: The signature for the OutOfSampleChooser has been changed to this.outOfSampleChooser.GetPositionsToBeOpened( this.bestTestingPositionsInSample , currentDateTime ) and the code has been changed accordingly Index: PairsTradingIntradayStrategy.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Strategies/PairsTradingIntradayStrategy.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PairsTradingIntradayStrategy.cs 18 Feb 2009 20:05:34 -0000 1.4 --- PairsTradingIntradayStrategy.cs 28 Feb 2009 18:41:30 -0000 1.5 *************** *** 30,33 **** --- 30,34 ---- using QuantProject.Business.Strategies.Logging; using QuantProject.Business.Strategies.ReturnsManagement.Time.IntervalsSelectors; + using QuantProject.Business.Timing; namespace QuantProject.Scripts.WalkForwardTesting.PairsTrading *************** *** 45,48 **** --- 46,52 ---- historicalMarketValueProviderForChosingPositionsOutOfSample; private OutOfSampleChooser outOfSampleChooser; + private IExitStrategy exitStrategy; + private Time timeToBeginToTryToOpenPositions; + private Time timeToStopToTryToOpenPositions; public PairsTradingIntradayStrategy( *************** *** 50,54 **** int numDaysForInSampleOptimization , IIntervalsSelector intervalsSelectorForInSample , - // IIntervalsSelector intervalsSelectorForOutOfSample , Time firstTimeToTestInefficiency , Time lastTimeToTestInefficiency , --- 54,57 ---- *************** *** 59,63 **** HistoricalMarketValueProvider historicalMarketValueProviderForChosingPositionsOutOfSample , ! OutOfSampleChooser outOfSampleChooser ) : base( numDaysBeetweenEachOtpimization , --- 62,70 ---- HistoricalMarketValueProvider historicalMarketValueProviderForChosingPositionsOutOfSample , ! OutOfSampleChooser outOfSampleChooser , ! IExitStrategy exitStrategy , ! Time timeToBeginToTryToOpenPositions , ! Time timeToStopToTryToOpenPositions ! ) : base( numDaysBeetweenEachOtpimization , *************** *** 70,76 **** { this.checkParameters( ! firstTimeToTestInefficiency , ! lastTimeToTestInefficiency , ! timeToClosePositions ); this.firstTimeToTestInefficiency = firstTimeToTestInefficiency; this.lastTimeToTestInefficiency = lastTimeToTestInefficiency; --- 77,82 ---- { this.checkParameters( ! timeToBeginToTryToOpenPositions , ! timeToStopToTryToOpenPositions ); this.firstTimeToTestInefficiency = firstTimeToTestInefficiency; this.lastTimeToTestInefficiency = lastTimeToTestInefficiency; *************** *** 79,95 **** historicalMarketValueProviderForChosingPositionsOutOfSample; this.outOfSampleChooser = outOfSampleChooser; } private void checkParameters( ! Time firstTimeToTestInefficiency , ! Time lastTimeToTestInefficiency , ! Time timeToClosePositions ) { ! if ( firstTimeToTestInefficiency >= lastTimeToTestInefficiency ) ! throw new Exception( ! "firstTimeToTestInefficiency must come before lastTimeToTestInefficiency" ); ! if ( lastTimeToTestInefficiency >= timeToClosePositions ) throw new Exception( ! "lastTimeToTestInefficiency must come before timeToClosePositions" ); } --- 85,100 ---- historicalMarketValueProviderForChosingPositionsOutOfSample; this.outOfSampleChooser = outOfSampleChooser; + this.exitStrategy = exitStrategy; + this.timeToBeginToTryToOpenPositions = timeToBeginToTryToOpenPositions; + this.timeToStopToTryToOpenPositions = timeToStopToTryToOpenPositions; } private void checkParameters( ! Time timeToBeginToTryToOpenPositions , ! Time timeToStopToTryToOpenPositions ) { ! if ( timeToBeginToTryToOpenPositions >= timeToStopToTryToOpenPositions ) throw new Exception( ! "timeToBeginToTryToOpenPositions come before timeToStopToTryToOpenPositions" ); } *************** *** 109,130 **** } protected override bool arePositionsToBeClosed() { bool areToBeClosed = ! ( this.Account.Portfolio.Count > 1 ); areToBeClosed = ( areToBeClosed && ! ( this.time() == this.timeToClosePositions ) ); return ( areToBeClosed ); } - - protected override bool arePositionsToBeOpened() - { - bool areToBeOpened = ( this.time() == this.lastTimeToTestInefficiency ); - areToBeOpened = - ( areToBeOpened && - ( this.bestTestingPositionsInSample != null ) ); - return ( areToBeOpened ); - } #region getPositionsToBeOpened --- 114,149 ---- } + + #region arePositionsToBeOpened + private bool isAValidTimeToTryToOpenPositins() + { + Time currentTime = this.time(); + bool isAValidTimeToTryToOpen = + ( + ( currentTime >= this.timeToBeginToTryToOpenPositions ) && + ( currentTime <= this.timeToStopToTryToOpenPositions ) + ); + return isAValidTimeToTryToOpen; + } + protected override bool arePositionsToBeOpened() + { + bool areToBeOpened = ( this.Account.Portfolio.Count == 0 ); + areToBeOpened = ( areToBeOpened && ( this.bestTestingPositionsInSample != null ) ); + areToBeOpened = ( areToBeOpened && this.isAValidTimeToTryToOpenPositins() ); + return areToBeOpened; + } + #endregion arePositionsToBeOpened + protected override bool arePositionsToBeClosed() { bool areToBeClosed = ! ( this.Account.Portfolio.Count > 0 ); areToBeClosed = ( areToBeClosed && ! this.exitStrategy.ArePositionsToBeClosed( ! this.now() , this.Account ) ); ! // ( this.time() == this.timeToClosePositions ) ); return ( areToBeClosed ); } #region getPositionsToBeOpened *************** *** 137,186 **** return dateTimeForCurrentDate; } ! private DateTime getFirstDateTimeToTestInefficiency() ! { ! // DateTime now = this.now(); ! // DateTime firstDateTimeToTestInefficiency = new DateTime( ! // now.Year , now.Month , now.Day , ! // this.firstTimeToTestInefficiency.Hour , ! // this.firstTimeToTestInefficiency.Minute , ! // this.firstTimeToTestInefficiency.Second ); ! DateTime firstDateTimeToTestInefficiency = ! this.getDateTimeForCurrentDate( this.firstTimeToTestInefficiency ); ! return firstDateTimeToTestInefficiency; ! } ! private DateTime getLastDateTimeToTestInefficiency() ! { ! // DateTime now = this.now(); ! // DateTime lastDateTimeToTestInefficiency = new DateTime( ! // now.Year , now.Month , now.Day , ! // this.lastTimeToTestInefficiency.Hour , ! // this.lastTimeToTestInefficiency.Minute , ! // this.lastTimeToTestInefficiency.Second ); ! DateTime lastDateTimeToTestInefficiency = ! this.getDateTimeForCurrentDate( this.lastTimeToTestInefficiency ); ! return lastDateTimeToTestInefficiency; ! } ! private DateTime getDateTimeToClosePositions() ! { ! DateTime dateTimeToClosePositions = ! this.getDateTimeForCurrentDate( this.timeToClosePositions ); ! return dateTimeToClosePositions; ! } protected override WeightedPositions getPositionsToBeOpened() { // DateTime firstDateTimeToTestInefficiency = // this.getFirstDateTimeToTestInefficiency(); ! DateTime lastDateTimeToTestInefficiency = ! this.getLastDateTimeToTestInefficiency(); // attention! we are looking in the future here, but we do it // just to avoid picking a ticker for which we don't have // the market value when we will close the positions ! DateTime dateTimeToClosePositions = ! this.getDateTimeToClosePositions(); WeightedPositions weightedPositions = this.outOfSampleChooser.GetPositionsToBeOpened( this.bestTestingPositionsInSample , // firstDateTimeToTestInefficiency , ! lastDateTimeToTestInefficiency , // dateTimeToClosePositions , this.historicalMarketValueProviderForChosingPositionsOutOfSample , --- 156,206 ---- return dateTimeForCurrentDate; } ! // private DateTime getFirstDateTimeToTestInefficiency() ! // { ! //// DateTime now = this.now(); ! //// DateTime firstDateTimeToTestInefficiency = new DateTime( ! //// now.Year , now.Month , now.Day , ! //// this.firstTimeToTestInefficiency.Hour , ! //// this.firstTimeToTestInefficiency.Minute , ! //// this.firstTimeToTestInefficiency.Second ); ! // DateTime firstDateTimeToTestInefficiency = ! // this.getDateTimeForCurrentDate( this.firstTimeToTestInefficiency ); ! // return firstDateTimeToTestInefficiency; ! // } ! // private DateTime getLastDateTimeToTestInefficiency() ! // { ! //// DateTime now = this.now(); ! //// DateTime lastDateTimeToTestInefficiency = new DateTime( ! //// now.Year , now.Month , now.Day , ! //// this.lastTimeToTestInefficiency.Hour , ! //// this.lastTimeToTestInefficiency.Minute , ! //// this.lastTimeToTestInefficiency.Second ); ! // DateTime lastDateTimeToTestInefficiency = ! // this.getDateTimeForCurrentDate( this.lastTimeToTestInefficiency ); ! // return lastDateTimeToTestInefficiency; ! // } ! // private DateTime getDateTimeToClosePositions() ! // { ! // DateTime dateTimeToClosePositions = ! // this.getDateTimeForCurrentDate( this.timeToClosePositions ); ! // return dateTimeToClosePositions; ! // } protected override WeightedPositions getPositionsToBeOpened() { // DateTime firstDateTimeToTestInefficiency = // this.getFirstDateTimeToTestInefficiency(); ! // DateTime lastDateTimeToTestInefficiency = ! // this.getLastDateTimeToTestInefficiency(); // attention! we are looking in the future here, but we do it // just to avoid picking a ticker for which we don't have // the market value when we will close the positions ! // DateTime dateTimeToClosePositions = ! // this.getDateTimeToClosePositions(); ! DateTime currentDateTime = this.now(); WeightedPositions weightedPositions = this.outOfSampleChooser.GetPositionsToBeOpened( this.bestTestingPositionsInSample , // firstDateTimeToTestInefficiency , ! currentDateTime , // dateTimeToClosePositions , this.historicalMarketValueProviderForChosingPositionsOutOfSample , |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:39:21
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23097/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers Modified Files: OutOfSampleChooserForSingleLongAndShort.cs Log Message: An additional firstTimeToTestInefficiency parameter is givent to the constructor Index: OutOfSampleChooserForSingleLongAndShort.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/OutOfSampleChooserForSingleLongAndShort.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OutOfSampleChooserForSingleLongAndShort.cs 29 Sep 2008 21:20:44 -0000 1.2 --- OutOfSampleChooserForSingleLongAndShort.cs 28 Feb 2009 18:39:15 -0000 1.3 *************** *** 19,26 **** 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; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.OutOfSample; --- 19,27 ---- 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; + using QuantProject.ADT.Timing; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.OutOfSample; *************** *** 40,43 **** --- 41,45 ---- /// </summary> public OutOfSampleChooserForSingleLongAndShort( + Time firstTimeToTestInefficiency , double minThresholdForGoingLong , double maxThresholdForGoingLong , *************** *** 45,52 **** double maxThresholdForGoingShort ) : base( ! minThresholdForGoingLong , ! maxThresholdForGoingLong , ! minThresholdForGoingShort , ! maxThresholdForGoingShort ) { } --- 47,55 ---- double maxThresholdForGoingShort ) : base( ! firstTimeToTestInefficiency , ! minThresholdForGoingLong , ! maxThresholdForGoingLong , ! minThresholdForGoingShort , ! maxThresholdForGoingShort ) { } *************** *** 57,61 **** WeightedPositions positionsToBeOpened = null; if ( ( inefficientCouples != null ) && ! ( inefficientCouples.Length > 0 ) ) // at least an inefficient couple has been found positionsToBeOpened = inefficientCouples[ 0 ]; --- 60,64 ---- WeightedPositions positionsToBeOpened = null; if ( ( inefficientCouples != null ) && ! ( inefficientCouples.Length > 0 ) ) // at least an inefficient couple has been found positionsToBeOpened = inefficientCouples[ 0 ]; |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:39:00
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22925/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers Modified Files: OutOfSampleChooserForExactNumberOfBestLongPositions.cs Log Message: An additional firstTimeToTestInefficiency parameter is givent to the constructor Index: OutOfSampleChooserForExactNumberOfBestLongPositions.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/OutOfSampleChooserForExactNumberOfBestLongPositions.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OutOfSampleChooserForExactNumberOfBestLongPositions.cs 29 Sep 2008 21:20:43 -0000 1.4 --- OutOfSampleChooserForExactNumberOfBestLongPositions.cs 28 Feb 2009 18:38:51 -0000 1.5 *************** *** 19,27 **** 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; using QuantProject.ADT.Collections; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.OutOfSample; --- 19,28 ---- 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; using QuantProject.ADT.Collections; + using QuantProject.ADT.Timing; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.OutOfSample; *************** *** 54,57 **** --- 55,59 ---- public OutOfSampleChooserForExactNumberOfBestLongPositions( int exactNumberOfBestLongPositionsToBeReturned , + Time firstTimeToTestInefficiency , double minThresholdForGoingLong , double maxThresholdForGoingLong , *************** *** 59,66 **** double maxThresholdForGoingShort ) : base( ! minThresholdForGoingLong , ! maxThresholdForGoingLong , ! minThresholdForGoingShort , ! maxThresholdForGoingShort ) { this.exactNumberOfBestLongPositionsToBeReturned = --- 61,69 ---- double maxThresholdForGoingShort ) : base( ! firstTimeToTestInefficiency , ! minThresholdForGoingLong , ! maxThresholdForGoingLong , ! minThresholdForGoingShort , ! maxThresholdForGoingShort ) { this.exactNumberOfBestLongPositionsToBeReturned = *************** *** 102,106 **** new String[ this.exactNumberOfBestLongPositionsToBeReturned ]; Array.Copy( longPositionTickers , tickers , ! this.exactNumberOfBestLongPositionsToBeReturned ); // comment out the following three lines to select only the second best long ticker --- 105,109 ---- new String[ this.exactNumberOfBestLongPositionsToBeReturned ]; Array.Copy( longPositionTickers , tickers , ! this.exactNumberOfBestLongPositionsToBeReturned ); // comment out the following three lines to select only the second best long ticker *************** *** 121,125 **** this.getLongPositionTickers( inefficientCouples ); if ( longPositionTickers.Length >= ! this.exactNumberOfBestLongPositionsToBeReturned ) // at least a long position has been found in the inefficient couples weightedPositionsToBeOpened = --- 124,128 ---- this.getLongPositionTickers( inefficientCouples ); if ( longPositionTickers.Length >= ! this.exactNumberOfBestLongPositionsToBeReturned ) // at least a long position has been found in the inefficient couples weightedPositionsToBeOpened = |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:38:11
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22608/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers Modified Files: OutOfSampleChooserForAlreadyClosing.cs Log Message: Chooses two positions that seem to be an arbitrage opportunity. The measured inefficiency must be seen to have narrowed now, before giving the entry signal. Among the eligible couples, a couple is discarded if any of the two tickers have had a either split, or dividend, or any other event that may have caused an overnight price adjustment Index: OutOfSampleChooserForAlreadyClosing.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/OutOfSampleChooserForAlreadyClosing.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OutOfSampleChooserForAlreadyClosing.cs 18 Feb 2009 20:05:33 -0000 1.1 --- OutOfSampleChooserForAlreadyClosing.cs 28 Feb 2009 18:38:05 -0000 1.2 *************** *** 3,7 **** OutOfSampleChooserForAlreadyClosing.cs ! Copyright (C) 2008 Glauco Siliprandi --- 3,7 ---- OutOfSampleChooserForAlreadyClosing.cs ! Copyright (C) 2009 Glauco Siliprandi *************** *** 23,28 **** --- 23,32 ---- using System; + using QuantProject.ADT.Timing; + using QuantProject.Business.DataProviders; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.ReturnsManagement; + using QuantProject.Business.Strategies.ReturnsManagement.Time; + using QuantProject.Business.Timing; namespace QuantProject.Scripts.WalkForwardTesting.PairsTrading *************** *** 30,34 **** /// <summary> /// Chooses two positions that seem to be an arbitrage opportunity. ! /// Among the eligible couples, a couple is discard if any of the two tickers /// have had a either split, or dividend, or any other event that may /// have caused an overnight price adjustment --- 34,40 ---- /// <summary> /// Chooses two positions that seem to be an arbitrage opportunity. ! /// The measured inefficiency must be seen to have narrowed now, before ! /// giving the entry signal. ! /// Among the eligible couples, a couple is discarded if any of the two tickers /// have had a either split, or dividend, or any other event that may /// have caused an overnight price adjustment *************** *** 38,42 **** OutOfSampleChooserForSingleLongAndShort { ! private int numberOfConsecutiveMinutesToSayTheInefficiencyIsClosing; public OutOfSampleChooserForAlreadyClosing( --- 44,50 ---- OutOfSampleChooserForSingleLongAndShort { ! private IInefficiencyCorrectionDetector inefficiencyCorrectionDetector; ! ! private PriceAdjustmentDetector adjustmentDetector; public OutOfSampleChooserForAlreadyClosing( *************** *** 45,50 **** double minThresholdForGoingShort , double maxThresholdForGoingShort , ! int numberOfConsecutiveMinutesToSayTheInefficiencyIsClosing ) : base( minThresholdForGoingLong , maxThresholdForGoingLong , --- 53,59 ---- double minThresholdForGoingShort , double maxThresholdForGoingShort , ! IInefficiencyCorrectionDetector inefficiencyCorrectionDetector ) : base( + new Time( 1 , 0 , 0 ) , // dummy parameter, not used by this derived class minThresholdForGoingLong , maxThresholdForGoingLong , *************** *** 52,97 **** maxThresholdForGoingShort ) { ! this.numberOfConsecutiveMinutesToSayTheInefficiencyIsClosing = ! numberOfConsecutiveMinutesToSayTheInefficiencyIsClosing; } #region getPositionsFromCandidate ! #region hasThePriceBeenAdjustedLastNight ! private bool hasThePriceBeenAdjustedLastNight( WeightedPositions candidate ) { ! // qui!!! ! return false; } ! #endregion hasThePriceBeenAdjustedLastNight #region getWeightedPositionsFromCandidateWithoutAdjustment private WeightedPositions getWeightedPositionsFromCandidateWithoutAdjustment( ! ReturnsManager returnsManagerForLastSecondPhaseInterval , WeightedPositions candidate ) { ! // qui!!!! ! // vedi OutOfSampleChooser.getWeightedPositionsFromCandidate(), ! // testa l'inefficienza allo stesso modo, ma poi aggiungi il test ! // per vedere se c'e' l'inizio di chiusura; devi considerare ! // il passaggio dei tempi: probabilmente ti converra' modificare ! // OutOfSampleChooserForSingleLongAndShort e passargli ! // firstTimeToTestInefficiency nel costruttore per poi modificare ! // OutOfSampleChooser.GetPositionsToBeOpened() togliendo i ! // parametri firstDateTimeToTestInefficiency e dateTimeToClosePositions ! // qui!!! ! return candidate; } #endregion getWeightedPositionsFromCandidateWithoutAdjustment ! protected override WeightedPositions getWeightedPositionsFromCandidate( ReturnsManager returnsManagerForLastSecondPhaseInterval , WeightedPositions candidate ) { WeightedPositions weightedPositionsFromCandidate = null; ! if ( !this.hasThePriceBeenAdjustedLastNight( candidate ) ) weightedPositionsFromCandidate = this.getWeightedPositionsFromCandidateWithoutAdjustment( ! returnsManagerForLastSecondPhaseInterval , candidate ); return weightedPositionsFromCandidate; } --- 61,145 ---- maxThresholdForGoingShort ) { ! this.inefficiencyCorrectionDetector = inefficiencyCorrectionDetector; ! ! this.adjustmentDetector = new PriceAdjustmentDetector(); ! } ! ! protected override DateTime getFirstDateTimeToTestInefficiency(DateTime currentDateTime) ! { ! DateTime yesterdayAtCurrentTime = currentDateTime.AddDays( -1 ); ! DateTime yesterdayAtClose = HistoricalEndOfDayTimer.GetMarketClose( ! yesterdayAtCurrentTime ).AddMinutes( - 1 ); // I'm subtracting 1 minute ! // because the bar for 15.59 is there much more often ! // and I believe that bar open value to be really ! // next to the official close ! return yesterdayAtClose; } #region getPositionsFromCandidate ! #region hasThePriceBeenAdjustedWithinTheInterval ! ! // private double getAdjustedCloseToCloseReturn( string ticker , ReturnInterval returnInterval ) ! // { ! // ReturnsManager returnManager = new ReturnsManager( ! // returnIntervals , this.historicalAdjustedQuoteProvider ! // ! // } ! ! private bool doWeKnowThePriceHasNotBeenAdjustedWithinTheInterval( ! WeightedPositions candidate , ReturnInterval returnInterval ) { ! bool doWeKnowNotAdjusted = false; ! try ! { ! doWeKnowNotAdjusted = ! ( ! ( !this.adjustmentDetector.HasThePriceBeenAdjusted( ! candidate[ 0 ].Ticker , returnInterval.Begin , returnInterval.End ) ) ! && ! ( !this.adjustmentDetector.HasThePriceBeenAdjusted( ! candidate[ 1 ].Ticker , returnInterval.Begin , returnInterval.End ) ) ! ); ! } ! catch( TickerNotExchangedException tickerNotExchangedException ) ! { ! string toAvoidCompileWarning = tickerNotExchangedException.Message; ! } ! return doWeKnowNotAdjusted; } ! #endregion hasThePriceBeenAdjustedWithinTheInterval #region getWeightedPositionsFromCandidateWithoutAdjustment private WeightedPositions getWeightedPositionsFromCandidateWithoutAdjustment( ! DateTime currentDateTime , ! ReturnsManager returnsManagerToTestInefficiency , WeightedPositions candidate ) { ! WeightedPositions weightedPositions = base.getWeightedPositionsIfThereIsInefficiency( ! currentDateTime , returnsManagerToTestInefficiency , candidate ); ! if ( ( weightedPositions != null ) && ! this.inefficiencyCorrectionDetector.IsInefficiencyCorrectionHappening( ! currentDateTime , ! returnsManagerToTestInefficiency.ReturnIntervals[ 0 ] , ! weightedPositions ) ) ! // the candidate is inefficient but the gap is closing ! weightedPositions = candidate; ! return weightedPositions; } #endregion getWeightedPositionsFromCandidateWithoutAdjustment ! protected override WeightedPositions getWeightedPositionsIfThereIsInefficiency( ! DateTime currentDateTime , ReturnsManager returnsManagerForLastSecondPhaseInterval , WeightedPositions candidate ) { WeightedPositions weightedPositionsFromCandidate = null; ! if ( this.doWeKnowThePriceHasNotBeenAdjustedWithinTheInterval( ! candidate , ! returnsManagerForLastSecondPhaseInterval.ReturnIntervals[ 0 ] ) ) weightedPositionsFromCandidate = this.getWeightedPositionsFromCandidateWithoutAdjustment( ! currentDateTime , returnsManagerForLastSecondPhaseInterval , candidate ); return weightedPositionsFromCandidate; } |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:35:17
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21462/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers Modified Files: OutOfSampleChooser.cs Log Message: The code has been changed so that the derived classes can change the strategy by overriding some key methods Index: OutOfSampleChooser.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/OutOfSampleChooser.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OutOfSampleChooser.cs 18 Feb 2009 20:05:32 -0000 1.6 --- OutOfSampleChooser.cs 28 Feb 2009 18:35:10 -0000 1.7 *************** *** 25,28 **** --- 25,29 ---- using QuantProject.ADT.Collections; + using QuantProject.ADT.Timing; using QuantProject.Business.DataProviders; using QuantProject.Business.Strategies; *************** *** 41,44 **** --- 42,46 ---- public abstract class OutOfSampleChooser { + private Time firstTimeToTestInefficiency; private double minThresholdForGoingLong; private double maxThresholdForGoingLong; *************** *** 46,51 **** --- 48,57 ---- private double maxThresholdForGoingShort; + public double MinThresholdForGoingLong { + get { return this.minThresholdForGoingLong; } + } public OutOfSampleChooser( + Time firstTimeToTestInefficiency , double minThresholdForGoingLong , double maxThresholdForGoingLong , *************** *** 53,56 **** --- 59,63 ---- double maxThresholdForGoingShort ) { + this.firstTimeToTestInefficiency = firstTimeToTestInefficiency; this.minThresholdForGoingLong = minThresholdForGoingLong; this.maxThresholdForGoingLong = maxThresholdForGoingLong; *************** *** 64,68 **** /// <param name="inefficientCouples">a collection of couples that /// are strongly correlated in sample, but were not so ! /// correlated in the latest second phase interval</param> /// <param name="inSampleReturnsManager"></param> /// <returns></returns> --- 71,75 ---- /// <param name="inefficientCouples">a collection of couples that /// are strongly correlated in sample, but were not so ! /// correlated in the interval to test for inefficiency</param> /// <param name="inSampleReturnsManager"></param> /// <returns></returns> *************** *** 114,117 **** --- 121,139 ---- #region getReturnIntervalsForLastSecondPhaseInterval + + protected virtual DateTime getFirstDateTimeToTestInefficiency( DateTime currentDateTime ) + { + // DateTime now = this.now(); + // DateTime firstDateTimeToTestInefficiency = new DateTime( + // now.Year , now.Month , now.Day , + // this.firstTimeToTestInefficiency.Hour , + // this.firstTimeToTestInefficiency.Minute , + // this.firstTimeToTestInefficiency.Second ); + DateTime firstDateTimeToTestInefficiency = + Time.GetDateTimeFromMerge( + currentDateTime , this.firstTimeToTestInefficiency ); + return firstDateTimeToTestInefficiency; + } + private ReturnInterval getReturnIntervalToTestInefficiency( *************** *** 121,132 **** ) { - // qui!!! DateTime firstDateTimeToTestInefficiency = ! currentDateTime.AddMinutes( 30 ); ! ReturnInterval returnIntervalForLastSecondPhaseInterval = new ReturnInterval( firstDateTimeToTestInefficiency , currentDateTime ); ! return returnIntervalForLastSecondPhaseInterval; } private ReturnIntervals --- 143,154 ---- ) { DateTime firstDateTimeToTestInefficiency = ! this.getFirstDateTimeToTestInefficiency( currentDateTime ); ! // currentDateTime.AddMinutes( 30 ); ! ReturnInterval returnIntervalToTestInefficiency = new ReturnInterval( firstDateTimeToTestInefficiency , currentDateTime ); ! return returnIntervalToTestInefficiency; } private ReturnIntervals *************** *** 137,141 **** ) { ! ReturnInterval returnIntervalForLastSecondPhaseInterval = this.getReturnIntervalToTestInefficiency( currentDateTime --- 159,163 ---- ) { ! ReturnInterval returnIntervalToTestInefficiency = this.getReturnIntervalToTestInefficiency( currentDateTime *************** *** 143,149 **** // lastDateTimeToTestInefficiency ); ! ReturnIntervals returnIntervalsForLastSecondPhaseInterval = ! new ReturnIntervals( returnIntervalForLastSecondPhaseInterval ); ! return returnIntervalsForLastSecondPhaseInterval; } #endregion getReturnIntervalsForLastSecondPhaseInterval --- 165,171 ---- // lastDateTimeToTestInefficiency ); ! ReturnIntervals returnIntervalsToTestInefficiency = ! new ReturnIntervals( returnIntervalToTestInefficiency ); ! return returnIntervalsToTestInefficiency; } #endregion getReturnIntervalsForLastSecondPhaseInterval *************** *** 171,212 **** #region getInefficientCouples ! #region areAllNeededMarketValuesAvailableForTheCurrentCouple ! private bool areAllNeededMarketValuesAvailableForTheCurrentCouple( ! TestingPositions currentCouple , ! DateTime dateTimeToClosePositions , ! HistoricalMarketValueProvider ! historicalMarketValueProviderForChosingPositionsOutOfSample ) ! { ! bool areAllAvailable = true; ! foreach ( WeightedPosition weightedPosition in ! currentCouple.WeightedPositions.Values ) ! areAllAvailable = ! ( ! areAllAvailable && ! // attention! we are looking in the future here, but we do it ! // just to avoid picking a ticker for which we don't have ! // the market value when we will close the positions ! historicalMarketValueProviderForChosingPositionsOutOfSample.WasExchanged( ! weightedPosition.Ticker , dateTimeToClosePositions ) ! ); ! return areAllAvailable; ! } ! private bool areAllNeededMarketValuesAvailableForTheCurrentCouple( ! TestingPositions[] bestTestingPositionsInSample , ! int currentTestingPositionsIndex , // DateTime dateTimeToClosePositions , ! HistoricalMarketValueProvider ! historicalMarketValueProviderForChosingPositionsOutOfSample ) ! { ! TestingPositions currentCouple = ! bestTestingPositionsInSample[ currentTestingPositionsIndex ]; ! bool areAllAvailable = true; ! // qui!!! ! // this.areAllNeededMarketValuesAvailableForTheCurrentCouple( ! // currentCouple , dateTimeToClosePositions , ! // historicalMarketValueProviderForChosingPositionsOutOfSample ); ! return areAllAvailable; ! } ! #endregion areAllNeededMarketValuesAvailableForTheCurrentCouple #region addPositionsIfInefficiencyForCurrentCoupleIsInTheRange --- 193,232 ---- #region getInefficientCouples ! // #region areAllNeededMarketValuesAvailableForTheCurrentCouple ! // private bool areAllNeededMarketValuesAvailableForTheCurrentCouple( ! // TestingPositions currentCouple , // DateTime dateTimeToClosePositions , ! // HistoricalMarketValueProvider ! // historicalMarketValueProviderForChosingPositionsOutOfSample ) ! // { ! // bool areAllAvailable = true; ! // foreach ( WeightedPosition weightedPosition in ! // currentCouple.WeightedPositions.Values ) ! // areAllAvailable = ! // ( ! // areAllAvailable && ! // // attention! we are looking in the future here, but we do it ! // // just to avoid picking a ticker for which we don't have ! // // the market value when we will close the positions ! // historicalMarketValueProviderForChosingPositionsOutOfSample.WasExchanged( ! // weightedPosition.Ticker , dateTimeToClosePositions ) ! // ); ! // return areAllAvailable; ! // } ! // private bool areAllNeededMarketValuesAvailableForTheCurrentCouple( ! // TestingPositions[] bestTestingPositionsInSample , ! // int currentTestingPositionsIndex , ! //// DateTime dateTimeToClosePositions , ! // HistoricalMarketValueProvider ! // historicalMarketValueProviderForChosingPositionsOutOfSample ) ! // { ! // TestingPositions currentCouple = ! // bestTestingPositionsInSample[ currentTestingPositionsIndex ]; ! // this.areAllNeededMarketValuesAvailableForTheCurrentCouple( ! // currentCouple , dateTimeToClosePositions , ! // historicalMarketValueProviderForChosingPositionsOutOfSample ); ! // return areAllAvailable; ! // } ! // #endregion areAllNeededMarketValuesAvailableForTheCurrentCouple #region addPositionsIfInefficiencyForCurrentCoupleIsInTheRange *************** *** 231,244 **** #region getPositionsIfInefficiencyIsInTheRange ! private double getReturnForTheLastSecondPhaseInterval( ! ReturnsManager returnsManagerForLastSecondPhaseInterval , WeightedPositions weightedPositions ) { // returnsManager should contain a single ReturnInterval, and // this ReturnInterval should be the last second phase interval ! double returnForTheLastSecondPhaseInterval = weightedPositions.GetReturn( 0 , ! returnsManagerForLastSecondPhaseInterval ); ! return returnForTheLastSecondPhaseInterval; } --- 251,264 ---- #region getPositionsIfInefficiencyIsInTheRange ! private double getReturnToTestInefficiency( ! ReturnsManager returnsManagerToTestInefficiency , WeightedPositions weightedPositions ) { // returnsManager should contain a single ReturnInterval, and // this ReturnInterval should be the last second phase interval ! double returnToTestInefficiency = weightedPositions.GetReturn( 0 , ! returnsManagerToTestInefficiency ); ! return returnToTestInefficiency; } *************** *** 248,253 **** // satisfy the thresholds) this method returns null protected virtual WeightedPositions ! getWeightedPositionsFromCandidate( ! ReturnsManager returnsManagerForLastSecondPhaseInterval , WeightedPositions currentWeightedPositions ) { --- 268,274 ---- // satisfy the thresholds) this method returns null protected virtual WeightedPositions ! getWeightedPositionsIfThereIsInefficiency( ! DateTime currentDateTime , ! ReturnsManager returnsManagerToTestInefficiency , WeightedPositions currentWeightedPositions ) { *************** *** 255,272 **** try { ! double returnForTheLastSecondPhaseInterval = ! this.getReturnForTheLastSecondPhaseInterval( ! returnsManagerForLastSecondPhaseInterval , currentWeightedPositions ); ! if ( ( returnForTheLastSecondPhaseInterval >= this.minThresholdForGoingShort ) && ! ( returnForTheLastSecondPhaseInterval <= this.maxThresholdForGoingShort ) ) // it looks like there has been an inefficiency that // might be recovered, by going short weightedPositionsToBeOpened = currentWeightedPositions.Opposite; ! if ( ( -returnForTheLastSecondPhaseInterval >= this.minThresholdForGoingLong ) && ! ( -returnForTheLastSecondPhaseInterval <= this.maxThresholdForGoingLong ) ) // it looks like there has been an inefficiency that --- 276,293 ---- try { ! double returnForTheIntervalToTestInefficiency = ! this.getReturnToTestInefficiency( ! returnsManagerToTestInefficiency , currentWeightedPositions ); ! if ( ( returnForTheIntervalToTestInefficiency >= this.minThresholdForGoingShort ) && ! ( returnForTheIntervalToTestInefficiency <= this.maxThresholdForGoingShort ) ) // it looks like there has been an inefficiency that // might be recovered, by going short weightedPositionsToBeOpened = currentWeightedPositions.Opposite; ! if ( ( -returnForTheIntervalToTestInefficiency >= this.minThresholdForGoingLong ) && ! ( -returnForTheIntervalToTestInefficiency <= this.maxThresholdForGoingLong ) ) // it looks like there has been an inefficiency that *************** *** 285,289 **** addPositionsIfInefficiencyForCurrentCoupleIsInTheRange( TestingPositions[] bestTestingPositionsInSample , ! ReturnsManager returnsManagerForLastSecondPhaseInterval , int currentTestingPositionsIndex , ArrayList inefficientCouples ) --- 306,311 ---- addPositionsIfInefficiencyForCurrentCoupleIsInTheRange( TestingPositions[] bestTestingPositionsInSample , ! DateTime currentDateTime , ! ReturnsManager returnsManagerToTestInefficiency , int currentTestingPositionsIndex , ArrayList inefficientCouples ) *************** *** 294,299 **** this.getCandidateForPortfolio( currentWeightedPositions ); WeightedPositions weightedPositionsThatMightBeOpended = ! this.getWeightedPositionsFromCandidate( ! returnsManagerForLastSecondPhaseInterval , candidateForPortfolio ); if ( weightedPositionsThatMightBeOpended != null ) // the current couple has not an inefficiency that's in the range --- 316,321 ---- this.getCandidateForPortfolio( currentWeightedPositions ); WeightedPositions weightedPositionsThatMightBeOpended = ! this.getWeightedPositionsIfThereIsInefficiency( ! currentDateTime , returnsManagerToTestInefficiency , candidateForPortfolio ); if ( weightedPositionsThatMightBeOpended != null ) // the current couple has not an inefficiency that's in the range *************** *** 304,308 **** protected ArrayList getInefficientCouples( TestingPositions[] bestTestingPositionsInSample , ! ReturnsManager returnsManagerForLastSecondPhaseInterval , // DateTime dateTimeToClosePositions , HistoricalMarketValueProvider --- 326,331 ---- protected ArrayList getInefficientCouples( TestingPositions[] bestTestingPositionsInSample , ! DateTime currentDateTime , ! ReturnsManager returnsManagerToTestInefficiency , // DateTime dateTimeToClosePositions , HistoricalMarketValueProvider *************** *** 314,327 **** currentTestingPositionsIndex++ ) { ! if ( this.areAllNeededMarketValuesAvailableForTheCurrentCouple( bestTestingPositionsInSample , currentTestingPositionsIndex , ! // dateTimeToClosePositions , ! historicalMarketValueProviderForChosingPositionsOutOfSample ) ) ! this.addPositionsIfInefficiencyForCurrentCoupleIsInTheRange( ! bestTestingPositionsInSample , ! returnsManagerForLastSecondPhaseInterval , ! currentTestingPositionsIndex , ! inefficientCouples ); } return inefficientCouples; --- 337,351 ---- currentTestingPositionsIndex++ ) { ! // if ( this.areAllNeededMarketValuesAvailableForTheCurrentCouple( ! // bestTestingPositionsInSample , ! // currentTestingPositionsIndex , ! //// dateTimeToClosePositions , ! // historicalMarketValueProviderForChosingPositionsOutOfSample ) ) ! this.addPositionsIfInefficiencyForCurrentCoupleIsInTheRange( bestTestingPositionsInSample , + currentDateTime , + returnsManagerToTestInefficiency , currentTestingPositionsIndex , ! inefficientCouples ); } return inefficientCouples; *************** *** 340,344 **** historicalMarketValueProviderForChosingPositionsOutOfSample ) { ! ReturnsManager returnsManagerForLastSecondPhaseInterval = this.getReturnsManagerToTestInefficiency( currentDateTime , --- 364,368 ---- historicalMarketValueProviderForChosingPositionsOutOfSample ) { ! ReturnsManager returnsManagerToTestInefficiency = this.getReturnsManagerToTestInefficiency( currentDateTime , *************** *** 349,353 **** this.getInefficientCouples( bestTestingPositionsInSample , ! returnsManagerForLastSecondPhaseInterval , // dateTimeToClosePositions , historicalMarketValueProviderForChosingPositionsOutOfSample ); --- 373,378 ---- this.getInefficientCouples( bestTestingPositionsInSample , ! currentDateTime , ! returnsManagerToTestInefficiency , // dateTimeToClosePositions , historicalMarketValueProviderForChosingPositionsOutOfSample ); |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:33:47
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a05_Timing In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20860/b4_Business/a05_Timing Modified Files: HistoricalEndOfDayTimer.cs Log Message: - some important properties and method's return value have been changed from DateTime to Time Index: HistoricalEndOfDayTimer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a05_Timing/HistoricalEndOfDayTimer.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** HistoricalEndOfDayTimer.cs 10 Dec 2008 19:31:16 -0000 1.12 --- HistoricalEndOfDayTimer.cs 28 Feb 2009 18:33:41 -0000 1.13 *************** *** 24,27 **** --- 24,28 ---- using QuantProject.ADT; + using QuantProject.ADT.Timing; namespace QuantProject.Business.Timing *************** *** 38,50 **** // private EndOfDayDateTime endDateTime; ! private static DateTime timeForMarketOpen = ! new DateTime( 1900 , 1 , 1 , 9 , 30 , 00 ); ! private static DateTime timeForMarketClose = ! new DateTime( 1900 , 1 , 1 , 16 , 00 , 00 ); /// <summary> /// time when the market opens /// </summary> ! public static DateTime TimeForMarketOpen { get { return HistoricalEndOfDayTimer.timeForMarketOpen; } } --- 39,51 ---- // private EndOfDayDateTime endDateTime; ! private static Time timeForMarketOpen = ! new Time( 9 , 30 , 00 ); ! private static Time timeForMarketClose = ! new Time( 16 , 00 , 00 ); /// <summary> /// time when the market opens /// </summary> ! public static Time TimeForMarketOpen { get { return HistoricalEndOfDayTimer.timeForMarketOpen; } } *************** *** 53,57 **** /// time when the market closes /// </summary> ! public static DateTime TimeForMarketClose { get { return HistoricalEndOfDayTimer.timeForMarketClose; } } --- 54,58 ---- /// time when the market closes /// </summary> ! public static Time TimeForMarketClose { get { return HistoricalEndOfDayTimer.timeForMarketClose; } } *************** *** 60,64 **** /// time for one hour after market closes /// </summary> ! public static DateTime TimeForOneHourAfterMarketClose { get { return HistoricalEndOfDayTimer.TimeForMarketClose.AddHours( 1 ); } } --- 61,65 ---- /// time for one hour after market closes /// </summary> ! public static Time TimeForOneHourAfterMarketClose { get { return HistoricalEndOfDayTimer.TimeForMarketClose.AddHours( 1 ); } } *************** *** 133,140 **** public static bool IsMarketOpen( DateTime dateTime ) { ! bool returnValue = ! ExtendedDateTime.HaveTheSameTime( ! dateTime , HistoricalEndOfDayTimer.TimeForMarketOpen ); ! return returnValue; } --- 134,140 ---- public static bool IsMarketOpen( DateTime dateTime ) { ! Time time = new Time( dateTime ); ! bool isMarketOpen = ( time == HistoricalEndOfDayTimer.TimeForMarketOpen ); ! return isMarketOpen; } *************** *** 146,153 **** public static bool IsMarketClose( DateTime dateTime ) { ! bool returnValue = ! ExtendedDateTime.HaveTheSameTime( ! dateTime , HistoricalEndOfDayTimer.TimeForMarketClose ); ! return returnValue; } --- 146,152 ---- public static bool IsMarketClose( DateTime dateTime ) { ! Time time = new Time( dateTime ); ! bool isMarketClose = ( time == HistoricalEndOfDayTimer.TimeForMarketClose ); ! return isMarketClose; } *************** *** 159,167 **** public static bool IsOneHourAfterMarketClose( DateTime dateTime ) { ! bool returnValue = ! ExtendedDateTime.HaveTheSameTime( ! dateTime , ! HistoricalEndOfDayTimer.TimeForOneHourAfterMarketClose ); ! return returnValue; } --- 158,165 ---- public static bool IsOneHourAfterMarketClose( DateTime dateTime ) { ! Time time = new Time( dateTime ); ! bool isOneHourAfterMarketClose = ! ( time == HistoricalEndOfDayTimer.TimeForOneHourAfterMarketClose ); ! return isOneHourAfterMarketClose; } *************** *** 210,220 **** #region GetNextMarketStatusSwitch - // private void getNextMarketStatusSwitch_checkParameters( - // DateTime dateTime) - // { - // if ( !HistoricalEndOfDayTimer.IsMarketOpen( dateTime ) && - // !HistoricalEndOfDayTimer.IsMarketClose( dateTime ) ) - // throw new Exception( "dateTime must be a - // } /// <summary> /// Returns either the next market close or the next market open, --- 208,211 ---- *************** *** 228,236 **** DateTime dateTime) { ! // this.getNextMarketStatusSwitch_checkParameters( ! // dateTime ); DateTime nextMarketStatusSwitch; ! if ( ExtendedDateTime.IsFirstTimeLessThenSecondTime( ! dateTime , HistoricalEndOfDayTimer.TimeForMarketOpen ) ) // dateTime's time is before market open nextMarketStatusSwitch = new DateTime( --- 219,225 ---- DateTime dateTime) { ! Time time = new Time( dateTime ); DateTime nextMarketStatusSwitch; ! if ( time < HistoricalEndOfDayTimer.TimeForMarketOpen ) // dateTime's time is before market open nextMarketStatusSwitch = new DateTime( *************** *** 242,247 **** { // dateTime's time is equal or after the market open ! if ( ExtendedDateTime.IsFirstTimeLessThenSecondTime( ! dateTime , HistoricalEndOfDayTimer.TimeForMarketClose ) ) // dateTime's time is equal or after the market open // AND dateTime's time is before market close --- 231,235 ---- { // dateTime's time is equal or after the market open ! if ( time < HistoricalEndOfDayTimer.TimeForMarketClose ) // dateTime's time is equal or after the market open // AND dateTime's time is before market close *************** *** 262,284 **** HistoricalEndOfDayTimer.TimeForMarketOpen.Second ); } ! } ! ! // ! // if ( this.EndOfDaySpecificTime < EndOfDaySpecificTime.MarketOpen ) ! // nextMarketStatusSwitch = new EndOfDayDateTime( ! // this.DateTime , EndOfDaySpecificTime.MarketOpen ); ! // else ! // { ! // // this.EndOfDaySpecificTime >= EndOfDaySpecificTime.MarketOpen ! // if ( this.EndOfDaySpecificTime < EndOfDaySpecificTime.MarketClose ) ! // // ( this.EndOfDaySpecificTime >= EndOfDaySpecificTime.MarketOpen ) ! // // AND ( this.EndOfDaySpecificTime < EndOfDaySpecificTime.MarketClose ) ! // nextMarketStatusSwitch = new EndOfDayDateTime( ! // this.DateTime , EndOfDaySpecificTime.MarketClose ); ! // else ! // // ( this.EndOfDaySpecificTime >= EndOfDaySpecificTime.MarketClose ) ! // nextMarketStatusSwitch = new EndOfDayDateTime( ! // this.DateTime.AddDays( 1 ) , EndOfDaySpecificTime.MarketOpen ); ! // } return nextMarketStatusSwitch; } --- 250,254 ---- HistoricalEndOfDayTimer.TimeForMarketOpen.Second ); } ! } return nextMarketStatusSwitch; } |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:31:53
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/returnsManagement/time/selectors In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20107/b4_Business/a2_Strategies/returnsManagement/time/selectors Modified Files: FixedLengthTwoPhasesIntervalsSelector.cs Log Message: a To Do comment has been cleaned out Index: FixedLengthTwoPhasesIntervalsSelector.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/returnsManagement/time/selectors/FixedLengthTwoPhasesIntervalsSelector.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FixedLengthTwoPhasesIntervalsSelector.cs 29 Sep 2008 21:16:19 -0000 1.3 --- FixedLengthTwoPhasesIntervalsSelector.cs 28 Feb 2009 18:31:46 -0000 1.4 *************** *** 120,129 **** DateTime startingDateTime ) { - // qui!!!! fai un ciclo while non exchanged (trova - // il primo - // successivo - // in cui il - // benchmark e' - // scambiato) DateTime firstIntervalBegin = this.benchmark.GetThisOrNextMarketStatusSwitch( --- 120,123 ---- |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:30:18
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19480/b7_Scripts Modified Files: Scripts_SD.csproj Log Message: - WalkForwardTesting\PairsTrading\ExitStrategies\TakeProfitStrategyOrOnMarketClose.cs has been added - WalkForwardTesting\PairsTrading\Logging\TesterForPairsTradingTestingPositionsEndOfDayInSample.cs has been added - WalkForwardTesting\PairsTrading\OutOfSampleChoosers\InefficiencyCorrectionDetecion\ConsecutiveMinutesOfCorrectionDetector.cs has been added - WalkForwardTesting\PairsTrading\OutOfSampleChoosers\InefficiencyCorrectionDetecion\IInefficiencyCorrectionDetector.cs has been added - WalkForwardTesting\PairsTrading\ExitStrategies\IExitStrategy.cs has been added Index: Scripts_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/Scripts_SD.csproj,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Scripts_SD.csproj 18 Feb 2009 20:05:34 -0000 1.35 --- Scripts_SD.csproj 28 Feb 2009 18:30:11 -0000 1.36 *************** *** 118,121 **** --- 118,122 ---- <Compile Include="WalkForwardTesting\FixedLengthTwoPhases\OutOfSampleChoosers\RankBasedOutOfSampleChooser.cs" /> <Compile Include="WalkForwardTesting\MSFTwalkForward\TsMSFTwalkForward.cs" /> + <Compile Include="WalkForwardTesting\PairsTrading\ExitStrategies\TakeProfitStrategyOrOnMarketClose.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\InSample\InSampleChoosers\BruteForce\PairsTradingBruteForceChooser.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\InSample\InSampleChoosers\BruteForce\PairsTradingBruteForceOptimizableParametersManager.cs" /> *************** *** 125,129 **** --- 126,133 ---- <Compile Include="WalkForwardTesting\PairsTrading\InSample\PairsTradingFitnessEvaluator.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\Logging\PairsTradingLogItem.cs" /> + <Compile Include="WalkForwardTesting\PairsTrading\Logging\TesterForPairsTradingTestingPositionsEndOfDayInSample.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\Logging\TesterForPairsTradingTestingPositions.cs" /> + <Compile Include="WalkForwardTesting\PairsTrading\OutOfSampleChoosers\InefficiencyCorrectionDetecion\ConsecutiveMinutesOfCorrectionDetector.cs" /> + <Compile Include="WalkForwardTesting\PairsTrading\OutOfSampleChoosers\InefficiencyCorrectionDetecion\IInefficiencyCorrectionDetector.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\OutOfSampleChoosers\OutOfSampleChooser.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\OutOfSampleChoosers\OutOfSampleChooserForAlreadyClosing.cs" /> *************** *** 132,135 **** --- 136,140 ---- <Compile Include="WalkForwardTesting\PairsTrading\PairsTradingMain.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\PairsTradingTestingPositions.cs" /> + <Compile Include="WalkForwardTesting\PairsTrading\ExitStrategies\IExitStrategy.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\Strategies\PairsTradingIntradayStrategy.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\Strategies\PairsTradingStrategy.cs" /> *************** *** 302,306 **** --- 307,313 ---- <Folder Include="WalkForwardTesting\PairsTrading\InSample\InSampleChoosers\Genetic" /> <Folder Include="WalkForwardTesting\PairsTrading\Logging" /> + <Folder Include="WalkForwardTesting\PairsTrading\ExitStrategies" /> <Folder Include="WalkForwardTesting\PairsTrading\OutOfSampleChoosers" /> + <Folder Include="WalkForwardTesting\PairsTrading\OutOfSampleChoosers\InefficiencyCorrectionDetecion" /> <Folder Include="WalkForwardTesting\PairsTrading\Strategies" /> <Folder Include="WalkForwardTesting\WalkForwardLag\WeightedPositionsChoosers\BruteForce" /> |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:27:47
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/ExitStrategies In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18366/WalkForwardTesting/PairsTrading/ExitStrategies Added Files: TakeProfitStrategyOrOnMarketClose.cs Log Message: This exit strategy closes positions if the gain is above the given threshold; in any case, positions are closed at the end of the market day --- NEW FILE: TakeProfitStrategyOrOnMarketClose.cs --- /* QuantProject - Quantitative Finance Library TakeProfitStrategyOrOnMarketClose.cs Copyright (C) 2009 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License 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; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.ReturnsManagement; using QuantProject.Business.Strategies.ReturnsManagement.Time; using QuantProject.Business.Timing; namespace QuantProject.Scripts.WalkForwardTesting.PairsTrading { /// <summary> /// This exit strategy closes positions if the gain is above the given /// threshold; in any case, positions are closed at the end of the market day /// </summary> [Serializable] public class TakeProfitStrategyOrOnMarketClose : IExitStrategy { private double minGainToTakeProfitOn; private HistoricalMarketValueProvider historicalMarketValueProvider; /// <summary> /// This exit strategy closes positions if the gain is above the given /// threshold; in any case, positions are closed at the end of the market day /// </summary> /// <param name="minGainToTakeProfitOn">percentage gain above wich /// positions are closed</param> /// <param name="historicalBarProvider"></param> public TakeProfitStrategyOrOnMarketClose( double minGainToTakeProfitOn , HistoricalMarketValueProvider historicalMarketValueProvider ) { this.minGainToTakeProfitOn = minGainToTakeProfitOn; this.historicalMarketValueProvider = historicalMarketValueProvider; } #region DoWeClosePositions private void arePositionsToBeClosed_checkParameters( DateTime currentDateTime, Account account ) { if ( account.Portfolio.Count == 0 ) throw new Exception( "the method DoWeClosePositions() cannot be invoked if the " + "account has no open positions" ); } #region arePositionsToBeClosed_actually #region arePositionsToBeClosed_evenThoughItsNotMarketClose #region getCurrentGain #region getReturnsManagerForCurrentGain #region getReturnIntervalsForCurrentGain private ReturnInterval getReturnIntervalForCurrentGain( DateTime currentDateTime , Account account ) { DateTime intervalBegin = account.Transactions.LastDateTime; DateTime intervalEnd = currentDateTime; ReturnInterval returnIntervalForCurrentGain = new ReturnInterval( intervalBegin , intervalEnd ); return returnIntervalForCurrentGain; } private ReturnIntervals getReturnIntervalsForCurrentGain( DateTime currentDateTime , Account account ) { ReturnInterval returnIntervalForCurrentGain = this.getReturnIntervalForCurrentGain( currentDateTime , account ); ReturnIntervals returnIntervalsForCurrentGain = new ReturnIntervals( returnIntervalForCurrentGain ); return returnIntervalsForCurrentGain; } #endregion getReturnIntervalsForCurrentGain private ReturnsManager getReturnsManagerForCurrentGain( DateTime currentDateTime , Account account ) { ReturnIntervals returnIntervalsForCurrentGain = this.getReturnIntervalsForCurrentGain( currentDateTime , account ); ReturnsManager returnsManagerForCurrentGain = new ReturnsManager( returnIntervalsForCurrentGain , this.historicalMarketValueProvider ); return returnsManagerForCurrentGain; } #endregion getReturnsManagerForCurrentGain private float getCurrentGain( ReturnsManager returnsManagerForCurrentGain , Account account ) { WeightedPositions weightedPositions = AccountManager.GetWeightedPositions( account ); float currentGain = weightedPositions.GetReturn( 0 , returnsManagerForCurrentGain ) ; return currentGain; } private float getCurrentGain( DateTime currentDateTime , Account account ) { ReturnsManager returnsManagerForCurrentGain = this.getReturnsManagerForCurrentGain( currentDateTime, account ); float currentGain = this.getCurrentGain( returnsManagerForCurrentGain , account ); return currentGain; } #endregion getCurrentGain private bool arePositionsToBeClosed_evenThoughItsNotMarketClose( DateTime currentDateTime, Account account ) { bool arePositionsToBeClosed = false; try { float currentGain = this.getCurrentGain( currentDateTime , account ); arePositionsToBeClosed = arePositionsToBeClosed || ( currentGain >= this.minGainToTakeProfitOn ); } catch( TickerNotExchangedException tickerNotExchangedException ) { string toAvoidCompileWarning = tickerNotExchangedException.Message; } return arePositionsToBeClosed; } #endregion arePositionsToBeClosed_evenThoughItsNotMarketClose private bool arePositionsToBeClosed_actually( DateTime currentDateTime, Account account ) { bool arePositionsToBeClosed = HistoricalEndOfDayTimer.IsMarketClose( currentDateTime ); arePositionsToBeClosed = arePositionsToBeClosed || this.arePositionsToBeClosed_evenThoughItsNotMarketClose( currentDateTime, account ); return arePositionsToBeClosed; } #endregion arePositionsToBeClosed_actually public bool ArePositionsToBeClosed( DateTime currentDateTime, Account account ) { this.arePositionsToBeClosed_checkParameters( currentDateTime , account ); bool arePositionsToBeClosed = this.arePositionsToBeClosed_actually( currentDateTime , account ); return arePositionsToBeClosed; } #endregion DoWeClosePositions } } |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:27:18
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/InefficiencyCorrectionDetecion In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18114/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/InefficiencyCorrectionDetecion Added Files: IInefficiencyCorrectionDetector.cs Log Message: detects if a pairs trading inefficiency is getting back --- NEW FILE: IInefficiencyCorrectionDetector.cs --- /* QuantProject - Quantitative Finance Library IInefficiencyCorrectionDetector.cs Copyright (C) 2009 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License 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; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.ReturnsManagement.Time; namespace QuantProject.Scripts.WalkForwardTesting.PairsTrading { /// <summary> /// detects if a pairs trading inefficiency is getting back /// </summary> public interface IInefficiencyCorrectionDetector { bool IsInefficiencyCorrectionHappening( DateTime currentDateTime , ReturnInterval returnInterval , WeightedPositions weightedPositions ); } } |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:26:52
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17866/WalkForwardTesting/PairsTrading/Logging Added Files: TesterForPairsTradingTestingPositionsEndOfDayInSample.cs Log Message: Tests a PairsTradingTestingPositions object looking in sample and using end of day quotes --- NEW FILE: TesterForPairsTradingTestingPositionsEndOfDayInSample.cs --- /* QuantProject - Quantitative Finance Library TesterForPairsTradingTestingPositions_old.cs Copyright (C) 2008 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License 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; using System.Drawing; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting.AccountProviding; using QuantProject.Business.Financial.Accounting.Reporting; using QuantProject.Business.Scripting; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.Eligibles; using QuantProject.Business.Strategies.OutOfSample; using QuantProject.Business.Strategies.ReturnsManagement.Time.IntervalsSelectors; using QuantProject.Business.Timing; using QuantProject.Presentation.Reporting.WindowsForm; using QuantProject.Scripts.General.Strategies; namespace QuantProject.Scripts.WalkForwardTesting.PairsTrading { [Serializable] /// <summary> /// Tests a PairsTradingTestingPositions object looking in sample and using end of day quotes /// </summary> public class TesterForPairsTradingTestingPositionsEndOfDayInSample : IExecutable { private PairsTradingTestingPositions testingPositions; private int numberOfInSampleDays; private DateTime dateTimeWhenThisObjectWasLogged; /// <summary> /// Generation when the TestingPositions object has been created /// (if genetically optimized) /// </summary> public int Generation { get { return this.testingPositions.Generation; } } public double FitnessInSample { get { return this.testingPositions.FitnessInSample; } } public string ShortDescription { get { return this.testingPositions.WeightedPositions.Description; } } public PairsTradingTestingPositions TestingPositions { get { return this.testingPositions; } } public TesterForPairsTradingTestingPositionsEndOfDayInSample( TestingPositions testingPositions , int numberOfInSampleDays , DateTime dateTimeWhenThisObjectWasLogged ) { this.checkParameters( testingPositions ); this.testingPositions = (PairsTradingTestingPositions)testingPositions; this.numberOfInSampleDays = numberOfInSampleDays; this.dateTimeWhenThisObjectWasLogged = dateTimeWhenThisObjectWasLogged; } private void checkParameters( TestingPositions testingPositions ) { if ( ! ( testingPositions is PairsTradingTestingPositions ) ) throw new Exception( "The given testingPositions is NOT a " + "PairsTradingTestingPositions!" ); } #region Run private AccountReport getAccountReport( WeightedPositions weightedPositions , IIntervalsSelector intervalsSelector , HistoricalMarketValueProvider historicalMarketValueProvider , Benchmark benchmark , double cashToStart ) { SimpleStrategy simpleStrategy = new SimpleStrategy( weightedPositions , intervalsSelector , historicalMarketValueProvider ); IAccountProvider accountProvider = new SimpleAccountProvider(); DateTime firstDateTime = this.dateTimeWhenThisObjectWasLogged.AddDays( - this.numberOfInSampleDays ); DateTime lastDateTime = this.dateTimeWhenThisObjectWasLogged; double maxRunningHours = 0.3; 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; endOfDayStrategyBackTester.Run(); return endOfDayStrategyBackTester.AccountReport; } private double getWeightedPositions_getWeight( WeightedPosition weightedPosition ) { double weight = 1; if ( weightedPosition.IsShort ) // the current WeightedPosition is short in the couple correlation weight = -1; return weight; } private WeightedPositions getWeightedPositions( WeightedPosition weightedPosition ) { // double[] weights = { 1 }; double[] weights = { this.getWeightedPositions_getWeight( weightedPosition ) }; string[] tickers = { weightedPosition.Ticker }; WeightedPositions weightedPositions = new WeightedPositions( weights , tickers ); return weightedPositions; } public void Run() { // string backTestId = "SimplePairsTrading"; // double cashToStart = 30000; Benchmark benchmark = new Benchmark( "MSFT" ); HistoricalMarketValueProvider historicalMarketValueProvider = new HistoricalAdjustedQuoteProvider(); // IInSampleChooser inSampleChooser = // (IInSampleChooser)new ConstantWeightedPositionsChooser( // this.BestWeightedPositionsInSample ); IIntervalsSelector intervalsSelector = new OddIntervalsSelector( 1 , 1 , benchmark ); IEligiblesSelector eligiblesSelector = new DummyEligibleSelector(); WeightedPositions weightedPositions = this.testingPositions.WeightedPositions; WeightedPositions firstPosition = this.getWeightedPositions( weightedPositions[ 0 ] ); WeightedPositions secondPosition = this.getWeightedPositions( weightedPositions[ 1 ] ); 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 = new Report( accountReportForFirstPosition , false ); DateTime lastDateTimeForReport = HistoricalEndOfDayTimer.GetOneHourAfterMarketClose( accountReportForFirstPosition.EquityLine.LastDateTime ); // new EndOfDayDateTime( // accountReportForFirstPosition.EquityLine.LastDateTime , // EndOfDaySpecificTime.OneHourAfterMarketClose ); // report.Create( "PearsonDebug" , 1 , // lastEndOfDayDateTimeForReport , // benchmark.Ticker , false ); report.AddEquityLine( accountReportForSecondPosition.EquityLine , Color.Brown ); report.ShowDialog(); } #endregion Run } } |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:25:39
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/ExitStrategies In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17413/WalkForwardTesting/PairsTrading/ExitStrategies Added Files: IExitStrategy.cs Log Message: decides if current positions have to be closed --- NEW FILE: IExitStrategy.cs --- /* QuantProject - Quantitative Finance Library IExitStrategy.cs Copyright (C) 2009 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License 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; using QuantProject.Business.Financial.Accounting; namespace QuantProject.Scripts.WalkForwardTesting.PairsTrading { /// <summary> /// decides if current positions have to be closed /// </summary> public interface IExitStrategy { bool ArePositionsToBeClosed( DateTime currentDateTime , Account account ); } } |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:25:14
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/InefficiencyCorrectionDetecion In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17168/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/InefficiencyCorrectionDetecion Added Files: ConsecutiveMinutesOfCorrectionDetector.cs Log Message: Detects if a the inefficiency gap has been closing for n times in the last n minutes --- NEW FILE: ConsecutiveMinutesOfCorrectionDetector.cs --- /* QuantProject - Quantitative Finance Library ConsecutiveMinutesOfCorrectionDetector.cs Copyright (C) 2009 Glauco Siliprandi This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License 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; using QuantProject.Business.DataProviders; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.ReturnsManagement; using QuantProject.Business.Strategies.ReturnsManagement.Time; namespace QuantProject.Scripts.WalkForwardTesting.PairsTrading { /// <summary> /// Detects if a the inefficiency gap has been closing for /// n times in the last n minutes /// </summary> [Serializable] public class ConsecutiveMinutesOfCorrectionDetector : IInefficiencyCorrectionDetector { private HistoricalMarketValueProvider historicalMarketValueProvider; private int numberOfConsecutiveMinutesToSayTheInefficiencyIsClosing; public ConsecutiveMinutesOfCorrectionDetector( HistoricalMarketValueProvider historicalMarketValueProvider , int numberOfConsecutiveMinutesToSayTheInefficiencyIsClosing ) { this.historicalMarketValueProvider = historicalMarketValueProvider; this.numberOfConsecutiveMinutesToSayTheInefficiencyIsClosing = numberOfConsecutiveMinutesToSayTheInefficiencyIsClosing; } #region IsInefficiencyCorrectionHappening #region getReturnsManagerToCheckForConsecutiveInefficiencyClosing #region getReturnIntervalsToCheckForConsecutiveInefficiencyClosing #region addReturnIntervalForMinute private ReturnInterval getReturnIntervalForCurrentMinute( int minuteIndex , DateTime currentDateTime ) { DateTime returnIntervalBegin = currentDateTime.AddMinutes( minuteIndex - this.numberOfConsecutiveMinutesToSayTheInefficiencyIsClosing ); DateTime returnIntervalEnd = returnIntervalBegin.AddMinutes( 1 ); ReturnInterval returnIntervalForCurrentMinute = new ReturnInterval( returnIntervalBegin , returnIntervalEnd ); return returnIntervalForCurrentMinute; } private void addReturnIntervalForMinute( int minuteIndex , DateTime currentDateTime , ReturnIntervals returnIntervalsToCheckForConsecutiveInefficiencyClosing ) { ReturnInterval returnInterval = this.getReturnIntervalForCurrentMinute( minuteIndex , currentDateTime ); returnIntervalsToCheckForConsecutiveInefficiencyClosing.Add( returnInterval ); } #endregion addReturnIntervalForMinute private ReturnIntervals getReturnIntervalsToCheckForConsecutiveInefficiencyClosing( DateTime currentDateTime ) { ReturnIntervals returnIntervalsToCheckForConsecutiveInefficiencyClosing = new ReturnIntervals(); for ( int minuteIndex = 0 ; minuteIndex < this.numberOfConsecutiveMinutesToSayTheInefficiencyIsClosing ; minuteIndex++ ) this.addReturnIntervalForMinute( minuteIndex , currentDateTime , returnIntervalsToCheckForConsecutiveInefficiencyClosing ); return returnIntervalsToCheckForConsecutiveInefficiencyClosing; } #endregion getReturnIntervalsToCheckForConsecutiveInefficiencyClosing private ReturnsManager getReturnsManagerToCheckForConsecutiveInefficiencyClosing( DateTime currentDateTime ) { ReturnIntervals returnIntervalsToCheckForConsecutiveInefficiencyClosing = this.getReturnIntervalsToCheckForConsecutiveInefficiencyClosing( currentDateTime ); ReturnsManager returnsManager = new ReturnsManager( returnIntervalsToCheckForConsecutiveInefficiencyClosing , this.historicalMarketValueProvider ); return returnsManager; } #endregion getReturnsManagerToCheckForConsecutiveInefficiencyClosing #region areAllPositiveReturns private bool areAllPositiveReturns( float[] returns ) { bool areAllPositive = true; int currentReturnIndex = 0; while ( areAllPositive && ( currentReturnIndex < returns.Length ) ) { float currentReturn = returns[ currentReturnIndex ]; areAllPositive = ( currentReturn > 0 ); currentReturnIndex++; } return areAllPositive; } private bool areAllPositiveReturns( ReturnsManager returnsManager , WeightedPositions weightedPositions ) { bool areAllNegative = false; try { float[] returns = weightedPositions.GetReturns( returnsManager ); areAllNegative = this.areAllPositiveReturns( returns ); } catch( TickerNotExchangedException tickerNotExchangedException ) { string toAvoidCompileWarning = tickerNotExchangedException.Message; } return areAllNegative; } #endregion areAllPositiveReturns public bool IsInefficiencyCorrectionHappening( DateTime currentDateTime , ReturnInterval returnIntervalWhereInefficiencyWasFound , WeightedPositions weightedPositions ) { ReturnsManager returnManagerToCheckForConsecutiveInefficiencyClosing = this.getReturnsManagerToCheckForConsecutiveInefficiencyClosing( currentDateTime ); bool isInefficiencyCorrectionHappening = this.areAllPositiveReturns( returnManagerToCheckForConsecutiveInefficiencyClosing , weightedPositions ); return isInefficiencyCorrectionHappening; } #endregion IsInefficiencyCorrectionHappening } } |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:22:05
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/ExitStrategies In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15851/ExitStrategies Log Message: Directory /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/ExitStrategies added to the repository |
|
From: Glauco S. <gla...@us...> - 2009-02-28 18:20:46
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/InefficiencyCorrectionDetecion In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15375/InefficiencyCorrectionDetecion Log Message: Directory /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/OutOfSampleChoosers/InefficiencyCorrectionDetecion added to the repository |