quantproject-developers Mailing List for QuantProject (Page 53)
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: Marco M. <mi...@us...> - 2008-03-08 09:23:17
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/OutOfSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16003 Removed Files: IGeneticOptimized.cs Log Message: Interface IGeneticOptimized has been renamed to IGeneticallyOptimizable --- IGeneticOptimized.cs DELETED --- |
|
From: Marco M. <mi...@us...> - 2008-03-08 09:19:33
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/OutOfSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12843 Added Files: IGeneticallyOptimizable.cs Log Message: Interface IGeneticOptimized has been renamed to IGeneticallyOptimizable --- NEW FILE: IGeneticallyOptimizable.cs --- /* QuantProject - Quantitative Finance Library IGeneticallyOptimizable.cs Copyright (C) 2008 Marco Milletti 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.Collections; namespace QuantProject.Business.Strategies.OutOfSample { /// <summary> /// Interface to be implemented by TestingPositions objects /// </summary> public interface IGeneticallyOptimizable { int Generation{get;set;} } } |
|
From: Marco M. <mi...@us...> - 2008-03-07 23:28:06
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6645/WalkForwardTesting/PairsTrading Modified Files: PairsTradingTestingPositions.cs Log Message: Interface IGeneticOptimized has been renamed to IGeneticallyOptimizable. Index: PairsTradingTestingPositions.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/PairsTradingTestingPositions.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PairsTradingTestingPositions.cs 6 Mar 2008 19:58:20 -0000 1.1 --- PairsTradingTestingPositions.cs 7 Mar 2008 23:28:01 -0000 1.2 *************** *** 33,37 **** [Serializable] public class PairsTradingTestingPositions : ! TestingPositions , IGeneticOptimized { private int generation; --- 33,37 ---- [Serializable] public class PairsTradingTestingPositions : ! TestingPositions , IGeneticallyOptimizable { private int generation; |
|
From: Marco M. <mi...@us...> - 2008-03-07 23:27:24
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6290/a2_Strategies/InSample Modified Files: GeneticChooser.cs Log Message: Interface IGeneticOptimized has been renamed to IGeneticallyOptimizable. TestingPositions does not implement this interface (that should be implemented by TestingPositions created for specific strategies) Index: GeneticChooser.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample/GeneticChooser.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GeneticChooser.cs 5 Mar 2008 17:15:17 -0000 1.7 --- GeneticChooser.cs 7 Mar 2008 23:27:13 -0000 1.8 *************** *** 205,209 **** ((TestingPositions)this.bestTestingPositions[addedTestingPositions]).FitnessInSample = currentGenome.Fitness; ! ((IGeneticOptimized)this.bestTestingPositions[addedTestingPositions]).Generation = currentGenome.Generation; genomesCollector.Add(currentGenomeHashcode, null); --- 205,209 ---- ((TestingPositions)this.bestTestingPositions[addedTestingPositions]).FitnessInSample = currentGenome.Fitness; ! ((IGeneticallyOptimizable)this.bestTestingPositions[addedTestingPositions]).Generation = currentGenome.Generation; genomesCollector.Add(currentGenomeHashcode, null); |
|
From: Marco M. <mi...@us...> - 2008-03-07 23:27:24
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/OutOfSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6290/a2_Strategies/OutOfSample Modified Files: TestingPositions.cs Log Message: Interface IGeneticOptimized has been renamed to IGeneticallyOptimizable. TestingPositions does not implement this interface (that should be implemented by TestingPositions created for specific strategies) Index: TestingPositions.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/OutOfSample/TestingPositions.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestingPositions.cs 5 Mar 2008 17:13:41 -0000 1.3 --- TestingPositions.cs 7 Mar 2008 23:27:13 -0000 1.4 *************** *** 40,50 **** private string hashCodeForTickerComposition; private double fitnessInSample; ! public WeightedPositions WeightedPositions { get{return this.weightedPositions;} } ! ! public double FitnessInSample { get{return this.fitnessInSample;} --- 40,49 ---- private string hashCodeForTickerComposition; private double fitnessInSample; ! public WeightedPositions WeightedPositions { get{return this.weightedPositions;} } ! public double FitnessInSample { get{return this.fitnessInSample;} *************** *** 52,56 **** } - public string HashCodeForTickerComposition { --- 51,54 ---- *************** *** 76,80 **** this.weightedPositions = weightedPositions; this.fitnessInSample = double.MinValue; ! } public TestingPositions(WeightedPositions weightedPositions, --- 74,78 ---- this.weightedPositions = weightedPositions; this.fitnessInSample = double.MinValue; ! } public TestingPositions(WeightedPositions weightedPositions, *************** *** 83,87 **** this.weightedPositions = weightedPositions; this.fitnessInSample = fitnessInSample; ! } //it creates an empty TestingPositions --- 81,85 ---- this.weightedPositions = weightedPositions; this.fitnessInSample = fitnessInSample; ! } //it creates an empty TestingPositions |
|
From: Marco M. <mi...@us...> - 2008-03-07 23:27:24
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6290/a2_Strategies Modified Files: EndOfDayStrategyBackTester.cs Log Message: Interface IGeneticOptimized has been renamed to IGeneticallyOptimizable. TestingPositions does not implement this interface (that should be implemented by TestingPositions created for specific strategies) Index: EndOfDayStrategyBackTester.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/EndOfDayStrategyBackTester.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** EndOfDayStrategyBackTester.cs 10 Feb 2008 14:17:51 -0000 1.5 --- EndOfDayStrategyBackTester.cs 7 Mar 2008 23:27:13 -0000 1.6 *************** *** 58,62 **** private BackTestLog backTestLog; private DateTime realDateTimeWhenTheBackTestIsStopped; ! public IHistoricalQuoteProvider HistoricalQuoteProvider { --- 58,62 ---- private BackTestLog backTestLog; private DateTime realDateTimeWhenTheBackTestIsStopped; ! public IHistoricalQuoteProvider HistoricalQuoteProvider { |
|
From: Marco M. <mi...@us...> - 2008-03-07 23:27:24
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6290 Modified Files: b4_Business.csproj Business_SD.csproj Log Message: Interface IGeneticOptimized has been renamed to IGeneticallyOptimizable. TestingPositions does not implement this interface (that should be implemented by TestingPositions created for specific strategies) Index: Business_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/Business_SD.csproj,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Business_SD.csproj 6 Mar 2008 20:05:25 -0000 1.15 --- Business_SD.csproj 7 Mar 2008 23:27:12 -0000 1.16 *************** *** 90,95 **** <Compile Include="a2_Strategies\Optimizing\GenomeManagers\GenomeManagerWithDuplicateGenes.cs" /> <Compile Include="a2_Strategies\Optimizing\GenomeManagers\GenomeManagerType.cs" /> <Compile Include="a2_Strategies\OutOfSample\TestingPositions.cs" /> - <Compile Include="a2_Strategies\OutOfSample\IGeneticOptimized.cs" /> <Compile Include="a2_Strategies\returnsManagement\time\CloseToCloseIntervals.cs" /> <Compile Include="a2_Strategies\returnsManagement\time\CloseToOpenIntervals.cs" /> --- 90,95 ---- <Compile Include="a2_Strategies\Optimizing\GenomeManagers\GenomeManagerWithDuplicateGenes.cs" /> <Compile Include="a2_Strategies\Optimizing\GenomeManagers\GenomeManagerType.cs" /> + <Compile Include="a2_Strategies\OutOfSample\IGeneticallyOptimizable.cs" /> <Compile Include="a2_Strategies\OutOfSample\TestingPositions.cs" /> <Compile Include="a2_Strategies\returnsManagement\time\CloseToCloseIntervals.cs" /> <Compile Include="a2_Strategies\returnsManagement\time\CloseToOpenIntervals.cs" /> Index: b4_Business.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** b4_Business.csproj 6 Mar 2008 19:57:04 -0000 1.57 --- b4_Business.csproj 7 Mar 2008 23:27:12 -0000 1.58 *************** *** 823,827 **** /> <File ! RelPath = "a2_Strategies\OutOfSample\IGeneticOptimized.cs" SubType = "Code" BuildAction = "Compile" --- 823,827 ---- /> <File ! RelPath = "a2_Strategies\OutOfSample\IGeneticallyOptimizable.cs" SubType = "Code" BuildAction = "Compile" |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:23:10
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8690/b5_Presentation/Reporting/WindowsForm Modified Files: Report.cs Log Message: Bug fixed: in the previous version it was allowed to create the report twice. Now, an exception thrown if the Create() method is invoked and the report has already been previously created Index: Report.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/Report.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Report.cs 27 Jan 2008 02:35:15 -0000 1.18 --- Report.cs 6 Mar 2008 20:23:04 -0000 1.19 *************** *** 50,53 **** --- 50,55 ---- private System.Windows.Forms.MenuItem saveTransactions; private SaveFileDialog saveFileDialog; + + private bool alreadyCreated = false; public AccountReport AccountReport *************** *** 136,139 **** --- 138,142 ---- showBenchmark ); this.Controls.Add( this.reportTabControl ); + this.alreadyCreated = true; } /// <summary> *************** *** 150,156 **** --- 153,166 ---- benchmark , true ); } + private void checkAlreadyCreated() + { + if ( this.alreadyCreated ) + throw new Exception( "The form content has already been " + + "created! You can create it just once!" ); + } public void Create( string reportName , int numDaysForInterval , EndOfDayDateTime endDateTime , string benchmark , bool showBenchmark ) { + this.checkAlreadyCreated(); create_set_accountReport( reportName , numDaysForInterval , endDateTime , benchmark ); |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:21:02
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6251/b7_Scripts/WalkForwardTesting/PairsTrading Modified Files: PairsTradingStrategy.cs Log Message: the arePositionsToBeClosed() method has been fixed (it was completely buggy) Index: PairsTradingStrategy.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/PairsTradingStrategy.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PairsTradingStrategy.cs 27 Feb 2008 21:12:36 -0000 1.1 --- PairsTradingStrategy.cs 6 Mar 2008 20:20:50 -0000 1.2 *************** *** 85,95 **** } private bool arePositionsToBeClosed() { ! bool endsTheLastInterval = ! ( this.now().IsEqualTo( ! this.lastIntervalAppended().End ) ); ! return ( endsTheLastInterval ); } protected override bool marketOpenEventHandler_arePositionsToBeOpened() --- 85,111 ---- } + #region arePositionsToBeClosed + private ReturnInterval getSecondLastReturnInterval() + { + int indexForTheSecondLastReturnInterval = + this.returnIntervals.Count - 2; + ReturnInterval secondLastReturnInterval = + this.returnIntervals[ indexForTheSecondLastReturnInterval ]; + return secondLastReturnInterval; + } private bool arePositionsToBeClosed() { ! bool areToBeClosed = false; ! if ( this.returnIntervals.Count > 1 ) ! // at least two intervals have already been ! // added, out of sample ! { ! ReturnInterval secondLastReturnInterval = ! this.getSecondLastReturnInterval(); ! areToBeClosed = this.now().IsEqualTo( secondLastReturnInterval.End ); ! } ! return ( areToBeClosed ); } + #endregion arePositionsToBeClosed protected override bool marketOpenEventHandler_arePositionsToBeOpened() |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:19:56
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5144/b7_Scripts/WalkForwardTesting/PairsTrading Modified Files: PairsTradingMain.cs Log Message: - a DecoderForPairsTradingTestingPositionsWithBalancedWeights object is now used instead of a DecoderForTestingPositionsWithBalancedWeights object - other minor changes Index: PairsTradingMain.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/PairsTradingMain.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PairsTradingMain.cs 27 Feb 2008 21:12:00 -0000 1.1 --- PairsTradingMain.cs 6 Mar 2008 20:19:50 -0000 1.2 *************** *** 75,79 **** { string defaultFolderPath = ! "C:\\qpReports\\"; // this.wFLagLog.TransactionHistory = this.account.Transactions; LogArchiver.Save( backTestLog , --- 75,79 ---- { string defaultFolderPath = ! "C:\\qpReports\\pairsTrading\\"; // this.wFLagLog.TransactionHistory = this.account.Transactions; LogArchiver.Save( backTestLog , *************** *** 85,89 **** public void Run1() { ! BackTestLog backTestLog = LogArchiver.Load( "C:\\qpReports\\" ); LogViewer logViewer = new LogViewer( backTestLog ); --- 85,89 ---- public void Run1() { ! BackTestLog backTestLog = LogArchiver.Load( "C:\\qpReports\\pairsTrading\\" ); LogViewer logViewer = new LogViewer( backTestLog ); *************** *** 96,110 **** double cashToStart = 30000; ! int inSampleDays = 90; string tickersGroupId = "SP500"; // uncomment the following two lines for faster scripts ! // int inSampleDays = 30; // string tickersGroupId = "fastTest"; ! Benchmark benchmark = new Benchmark( "MSFT" ); int maxNumberOfEligiblesToBeChosen = 100; IDecoderForTestingPositions decoderForWeightedPositions ! = new DecoderForTestingPositionsWithBalancedWeights(); IHistoricalQuoteProvider historicalQuoteProvider = new HistoricalAdjustedQuoteProvider(); --- 96,110 ---- double cashToStart = 30000; ! int inSampleDays = 180; string tickersGroupId = "SP500"; // uncomment the following two lines for faster scripts ! // int inSampleDays = 5; // string tickersGroupId = "fastTest"; ! Benchmark benchmark = new Benchmark( "BMC" ); int maxNumberOfEligiblesToBeChosen = 100; IDecoderForTestingPositions decoderForWeightedPositions ! = new DecoderForPairsTradingTestingPositionsWithBalancedWeights(); IHistoricalQuoteProvider historicalQuoteProvider = new HistoricalAdjustedQuoteProvider(); *************** *** 119,124 **** double mutationRate = 0.02; double elitismRate = 0.001; ! int populationSizeForGeneticOptimizer = 20000; ! int generationNumberForGeneticOptimizer = 8; int seedForRandomGenerator = QuantProject.ADT.ConstantsProvider.SeedForRandomGenerator; --- 119,124 ---- double mutationRate = 0.02; double elitismRate = 0.001; ! int populationSizeForGeneticOptimizer = 30000; ! int generationNumberForGeneticOptimizer = 12; int seedForRandomGenerator = QuantProject.ADT.ConstantsProvider.SeedForRandomGenerator; *************** *** 148,154 **** 0.003 , 0.99 , 0.003 , 0.99 ); ! DateTime firstDateTime = new DateTime( 2002 , 1 , 29 ); ! DateTime lastDateTime = new DateTime( 2002 , 2 , 28 ); ! double maxRunningHours = 8; EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( --- 148,154 ---- 0.003 , 0.99 , 0.003 , 0.99 ); ! DateTime firstDateTime = new DateTime( 2001 , 1 , 1 ); ! DateTime lastDateTime = new DateTime( 2001 , 1 , 6 ); ! double maxRunningHours = 0.9; EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:18:46
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3774/b7_Scripts/WalkForwardTesting/PairsTrading/Logging Modified Files: PairsTradingLogItem.cs Log Message: The Run method has been completely implemented, now Index: PairsTradingLogItem.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging/PairsTradingLogItem.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PairsTradingLogItem.cs 27 Feb 2008 21:16:53 -0000 1.1 --- PairsTradingLogItem.cs 6 Mar 2008 20:18:40 -0000 1.2 *************** *** 22,27 **** --- 22,29 ---- using System; + using System.Drawing; using QuantProject.Business.DataProviders; + using QuantProject.Business.Financial.Accounting.Reporting; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.Eligibles; *************** *** 31,34 **** --- 33,37 ---- using QuantProject.Business.Strategies.ReturnsManagement.Time.IntervalsSelectors; using QuantProject.Business.Timing; + using QuantProject.Presentation.Reporting.WindowsForm; using QuantProject.Scripts.General.Reporting; *************** *** 75,116 **** this.numberOfEligibleTickers = numberOfEligibleTickers; } public override void Run() { ! // string backTestId = "SimpleFLTP"; // double cashToStart = 30000; ! // ! // Benchmark benchmark = new Benchmark( "MSFT" ); ! // ! // IHistoricalQuoteProvider historicalQuoteProvider = ! // new HistoricalAdjustedQuoteProvider(); ! // // IInSampleChooser inSampleChooser = ! // (IInSampleChooser)new ConstantWeightedPositionsChooser( this.BestWeightedPositionsInSample ); ! // ! // IIntervalsSelector intervalsSelector = ! // new FixedLengthTwoPhasesIntervalsSelector( ! // 1 , 1 , benchmark ); ! // IEligiblesSelector eligiblesSelector = new DummyEligibleSelector(); ! // ! // FixedLengthTwoPhasesStrategy fixedLengthTwoPhasesStrategy = ! // new FixedLengthTwoPhasesStrategy( ! // this.BestWeightedPositionsInSample.Count , ! // 9999 , 9 , benchmark , intervalsSelector , ! // eligiblesSelector , inSampleChooser , historicalQuoteProvider ); ! // ! // DateTime firstDateTime = this.simulatedCreationTime.DateTime.AddDays( -90 ); ! // DateTime lastDateTime = this.simulatedCreationTime.DateTime; ! // double maxRunningHours = 0.3; ! // EndOfDayStrategyBackTester endOfDayStrategyBackTester = ! // new EndOfDayStrategyBackTester( ! // backTestId , fixedLengthTwoPhasesStrategy , ! // historicalQuoteProvider , firstDateTime , ! // lastDateTime , benchmark , cashToStart , maxRunningHours ); ! // ! // fixedLengthTwoPhasesStrategy.Account = endOfDayStrategyBackTester.Account; ! // ! // endOfDayStrategyBackTester.Run(); ! // BackTesterReportViewer.ShowReport( lastDateTime , ! // endOfDayStrategyBackTester ); } } --- 78,164 ---- this.numberOfEligibleTickers = numberOfEligibleTickers; } + private AccountReport getAccountReport( + WeightedPositions weightedPositions , + IIntervalsSelector intervalsSelector , + IHistoricalQuoteProvider historicalQuoteProvider , + Benchmark benchmark , + double cashToStart ) + { + SimpleStrategy simpleStrategy = + new SimpleStrategy( weightedPositions , + intervalsSelector , historicalQuoteProvider ); + + DateTime firstDateTime = this.simulatedCreationTime.DateTime.AddDays( -90 ); + DateTime lastDateTime = this.simulatedCreationTime.DateTime; + double maxRunningHours = 0.3; + EndOfDayStrategyBackTester endOfDayStrategyBackTester = + new EndOfDayStrategyBackTester( + "SinglePosition" , simpleStrategy , + historicalQuoteProvider , firstDateTime , + lastDateTime , benchmark , cashToStart , maxRunningHours ); + + simpleStrategy.Account = endOfDayStrategyBackTester.Account; + + endOfDayStrategyBackTester.Run(); + return endOfDayStrategyBackTester.AccountReport; + } + private WeightedPositions getWeightedPositions( + WeightedPosition weightedPosition ) + { + double[] weights = { 1 }; + string[] tickers = { weightedPosition.Ticker }; + WeightedPositions weightedPositions = + new WeightedPositions( weights , tickers ); + return weightedPositions; + } public override void Run() { ! // string backTestId = "SimplePairsTrading"; // double cashToStart = 30000; ! ! Benchmark benchmark = new Benchmark( "MSFT" ); ! ! IHistoricalQuoteProvider historicalQuoteProvider = ! new HistoricalAdjustedQuoteProvider(); ! // IInSampleChooser inSampleChooser = ! // (IInSampleChooser)new ConstantWeightedPositionsChooser( ! // this.BestWeightedPositionsInSample ); ! ! IIntervalsSelector intervalsSelector = ! new OddIntervalsSelector( 1 , 1 , benchmark ); ! IEligiblesSelector eligiblesSelector = new DummyEligibleSelector(); ! ! WeightedPositions weightedPositions = ! this.bestTestingPositionsInSample[ 0 ].WeightedPositions; ! ! WeightedPositions firstPosition = ! this.getWeightedPositions( weightedPositions[ 0 ] ); ! WeightedPositions secondPosition = ! this.getWeightedPositions( weightedPositions[ 1 ] ); ! AccountReport accountReportForFirstPosition = ! this.getAccountReport( firstPosition , intervalsSelector , ! historicalQuoteProvider , ! benchmark , 30000 ); ! AccountReport accountReportForSecondPosition = ! this.getAccountReport( secondPosition , intervalsSelector , ! historicalQuoteProvider , ! benchmark , ! 30000 * weightedPositions[ 1 ].Weight / ! weightedPositions[ 0 ].Weight ); ! ! Report report = ! new Report( accountReportForFirstPosition , false ); ! EndOfDayDateTime lastEndOfDayDateTimeForReport = ! new EndOfDayDateTime( ! accountReportForFirstPosition.EquityLine.LastDateTime , ! EndOfDaySpecificTime.OneHourAfterMarketClose ); ! ! // report.Create( "PearsonDebug" , 1 , ! // lastEndOfDayDateTimeForReport , ! // benchmark.Ticker , false ); ! report.AddEquityLine( accountReportForSecondPosition.EquityLine , ! Color.Brown ); ! report.ShowDialog(); } } |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:13:56
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Statistics In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30066/b1_ADT/Statistics Modified Files: BasicFunctions.cs Log Message: Some code has been added to test the method that computes the Pearson correlation coefficient Index: BasicFunctions.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Statistics/BasicFunctions.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** BasicFunctions.cs 27 Feb 2008 22:26:44 -0000 1.10 --- BasicFunctions.cs 6 Mar 2008 20:13:49 -0000 1.11 *************** *** 321,324 **** --- 321,333 ---- currentValueFromSecondDataSet * currentValueFromSecondDataSet; } + double n1 = n*sumOfProduct; + double n2 = sumOfFirst*sumOfSecond; + double numerator = n*sumOfProduct - sumOfFirst*sumOfSecond; + double d1 = n*sumOfSquaredFirst; + double d2 = sumOfFirst*sumOfFirst; + double d3 = n*sumOfSquaredSecond; + double d4 = sumOfSecond*sumOfSecond; + double d5 = d1 - d2; + double d6 = d3 - d4; return (n*sumOfProduct - sumOfFirst*sumOfSecond)/ Math.Sqrt( (n*sumOfSquaredFirst - sumOfFirst*sumOfFirst)* |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:12:51
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/EndOfDayStrategies In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28650/b4_Business/a2_Strategies/EndOfDayStrategies Modified Files: BasicEndOfDayStrategyForBacktester.cs Log Message: The Account property is also readable, now Index: BasicEndOfDayStrategyForBacktester.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/EndOfDayStrategies/BasicEndOfDayStrategyForBacktester.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicEndOfDayStrategyForBacktester.cs 27 Feb 2008 21:39:03 -0000 1.1 --- BasicEndOfDayStrategyForBacktester.cs 6 Mar 2008 20:12:44 -0000 1.2 *************** *** 65,68 **** --- 65,69 ---- public Account Account { + get { return this.account; } set { this.account = value; } } |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:11:47
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Optimizing/Decoding In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27838/b4_Business/a2_Strategies/Optimizing/Decoding Modified Files: BasicDecoderForTestingPositions.cs Log Message: A new virtual method getTestingPositions() has been added: it allows a derived classes to be more specific about what to override Index: BasicDecoderForTestingPositions.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Optimizing/Decoding/BasicDecoderForTestingPositions.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BasicDecoderForTestingPositions.cs 2 Mar 2008 10:04:06 -0000 1.4 --- BasicDecoderForTestingPositions.cs 6 Mar 2008 20:11:38 -0000 1.5 *************** *** 143,146 **** --- 143,155 ---- return weights; } + + protected virtual TestingPositions + getTestingPositions( double[] weights , + string[] tickers ) + { + TestingPositions testingPositions = new TestingPositions( + new WeightedPositions( weights , tickers ) ); + return testingPositions; + } protected virtual TestingPositions decodeDecodable() *************** *** 148,153 **** SignedTickers signedTickers = this.decodeSignedTickers(); double[] weights = this.getWeights(); ! TestingPositions testingPositions = new TestingPositions( ! new WeightedPositions( weights , signedTickers.Tickers ) ); return testingPositions; --- 157,163 ---- SignedTickers signedTickers = this.decodeSignedTickers(); double[] weights = this.getWeights(); ! TestingPositions testingPositions = ! this.getTestingPositions( ! weights , signedTickers.Tickers ); return testingPositions; |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:09:28
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/General/Reporting In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24934/b7_Scripts/General/Reporting Modified Files: BackTesterReportViewer.cs Log Message: Bug fixed: the report was created twice Index: BackTesterReportViewer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/General/Reporting/BackTesterReportViewer.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BackTesterReportViewer.cs 10 Feb 2008 14:16:12 -0000 1.2 --- BackTesterReportViewer.cs 6 Mar 2008 20:09:20 -0000 1.3 *************** *** 52,59 **** endOfDayStrategyBackTester.AccountReport , true ); ! report.Create( endOfDayStrategyBackTester.Description , 1 , ! new EndOfDayDateTime( lastReportDateTime , ! EndOfDaySpecificTime.OneHourAfterMarketClose ) , ! endOfDayStrategyBackTester.Benchmark.Ticker ); report.Show(); } --- 52,59 ---- endOfDayStrategyBackTester.AccountReport , true ); ! // report.Create( endOfDayStrategyBackTester.Description , 1 , ! // new EndOfDayDateTime( lastReportDateTime , ! // EndOfDaySpecificTime.OneHourAfterMarketClose ) , ! // endOfDayStrategyBackTester.Benchmark.Ticker ); report.Show(); } |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:07:57
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22703/b7_Scripts Modified Files: Scripts_SD.csproj Log Message: - WalkForwardTesting\PairsTrading\InSample\InSampleChoosers\Genetic\DecoderForPairsTradingTestingPositionsWithBalancedWeights.cs has been added - WalkForwardTesting\PairsTrading\Logging\SimpleStrategy.cs has been added - WalkForwardTesting\PairsTrading\PairsTradingTestingPositions.cs has been added Index: Scripts_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/Scripts_SD.csproj,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Scripts_SD.csproj 27 Feb 2008 22:50:35 -0000 1.14 --- Scripts_SD.csproj 6 Mar 2008 20:07:48 -0000 1.15 *************** *** 76,84 **** --- 76,87 ---- <Compile Include="WalkForwardTesting\FixedLengthTwoPhases\Logging\FixedLengthTwoPhasesLogItem.cs" /> <Compile Include="WalkForwardTesting\MSFTwalkForward\TsMSFTwalkForward.cs" /> + <Compile Include="WalkForwardTesting\PairsTrading\InSample\InSampleChoosers\Genetic\DecoderForPairsTradingTestingPositionsWithBalancedWeights.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\InSample\InSampleChoosers\Genetic\PairsTradingGeneticChooser.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\InSample\PairsTradingFitnessEvaluator.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\Logging\PairsTradingLogItem.cs" /> + <Compile Include="WalkForwardTesting\PairsTrading\Logging\SimpleStrategy.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\PairsTradingMain.cs" /> <Compile Include="WalkForwardTesting\PairsTrading\PairsTradingStrategy.cs" /> + <Compile Include="WalkForwardTesting\PairsTrading\PairsTradingTestingPositions.cs" /> <Compile Include="WalkForwardTesting\WalkForwardLag\RunSimpleLag.cs" /> <Compile Include="WalkForwardTesting\WalkForwardLag\WeightedPositionsChoosers\BruteForce\WFLagBruteForceWeightedPositionsChooserForBalancedFixedPortfolioAndBalancedDriving.cs" /> |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:05:32
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19681/b4_Business Modified Files: Business_SD.csproj Log Message: a2_Strategies\InSample\DummyInSampleChooser.cs has been added Index: Business_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/Business_SD.csproj,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Business_SD.csproj 5 Mar 2008 17:16:38 -0000 1.14 --- Business_SD.csproj 6 Mar 2008 20:05:25 -0000 1.15 *************** *** 75,78 **** --- 75,79 ---- <Compile Include="a2_Strategies\IInSampleChooser.cs" /> <Compile Include="a2_Strategies\InSample\ConstantWeightedPositionsChooser.cs" /> + <Compile Include="a2_Strategies\InSample\DummyInSampleChooser.cs" /> <Compile Include="a2_Strategies\InSample\GeneticChooser.cs" /> <Compile Include="a2_Strategies\Logging\BackTestLog.cs" /> |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:04:26
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18322/b7_Scripts Modified Files: b7_Scripts.csproj Log Message: - WalkForwardTesting\PairsTrading\PairsTradingTestingPositions.cs has been added - WalkForwardTesting\PairsTrading\InSample\InSampleChoosers\Genetic\DecoderForPairsTradingTestingPositionsWithBalancedWeights.cs has been added - WalkForwardTesting\PairsTrading\Logging\SimpleStrategy.cs has been added Index: b7_Scripts.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/b7_Scripts.csproj,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** b7_Scripts.csproj 27 Feb 2008 21:19:25 -0000 1.84 --- b7_Scripts.csproj 6 Mar 2008 20:04:18 -0000 1.85 *************** *** 830,833 **** --- 830,838 ---- /> <File + RelPath = "WalkForwardTesting\PairsTrading\PairsTradingTestingPositions.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "WalkForwardTesting\PairsTrading\InSample\PairsTradingFitnessEvaluator.cs" SubType = "Code" *************** *** 835,838 **** --- 840,848 ---- /> <File + RelPath = "WalkForwardTesting\PairsTrading\InSample\InSampleChoosers\Genetic\DecoderForPairsTradingTestingPositionsWithBalancedWeights.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "WalkForwardTesting\PairsTrading\InSample\InSampleChoosers\Genetic\PairsTradingGeneticChooser.cs" SubType = "Code" *************** *** 845,848 **** --- 855,863 ---- /> <File + RelPath = "WalkForwardTesting\PairsTrading\Logging\SimpleStrategy.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "WalkForwardTesting\WalkForwardLag\RunSimpleLag.cs" SubType = "Code" |
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:03:29
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/Logging In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16851/b7_Scripts/WalkForwardTesting/PairsTrading/Logging Added Files: SimpleStrategy.cs Log Message: Strategy without optimization, that opens positions when a new interval begins and closes positions when the interval ends --- NEW FILE: SimpleStrategy.cs --- /* QuantProject - Quantitative Finance Library SimpleStrategy.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 QuantProject.Business.DataProviders; using QuantProject.Business.Strategies; using QuantProject.Business.Strategies.Eligibles; using QuantProject.Business.Strategies.InSample; using QuantProject.Business.Strategies.Logging; using QuantProject.Business.Strategies.OutOfSample; using QuantProject.Business.Strategies.ReturnsManagement.Time.IntervalsSelectors; namespace QuantProject.Scripts.WalkForwardTesting.PairsTrading { /// <summary> /// Strategy without optimization, that opens positions when a new /// interval begins and closes positions when the interval ends /// </summary> public class SimpleStrategy : BasicEndOfDayStrategyForBacktester { private WeightedPositions weightedPositions; public SimpleStrategy( WeightedPositions weightedPositions , IIntervalsSelector intervalsSelector , IHistoricalQuoteProvider historicalQuoteProvider ) : base( 999 , 1 , intervalsSelector , new DummyEligibleSelector() , new DummyInSampleChooser() , historicalQuoteProvider ) { this.weightedPositions = weightedPositions; } protected override bool marketOpenEventHandler_arePositionsToBeClosed() { // true iif the current EndOfDayDateTime falls on the end of either the last // interval or the second last interval bool arePositionsToBeClosed = ( ( this.Account.Portfolio.Count > 0 ) && ( this.returnIntervals[ this.returnIntervals.Count - 1 ].End.IsEqualTo( this.now() ) || ( ( this.returnIntervals.Count > 1 ) && ( this.returnIntervals[ this.returnIntervals.Count - 2 ].End.IsEqualTo( this.now() ) ) ) ) ); return arePositionsToBeClosed; } protected override bool marketCloseEventHandler_arePositionsToBeClosed() { return this.marketOpenEventHandler_arePositionsToBeClosed(); } protected override bool marketOpenEventHandler_arePositionsToBeOpened() { // true iif the current EndOfDayDateTime falls on the begin of the last // interval bool arePositionsToBeOpened = ( ( this.Account.Portfolio.Count == 0 ) && this.returnIntervals[ this.returnIntervals.Count - 1 ].Begin.IsEqualTo( this.now() ) ); return arePositionsToBeOpened; } protected override bool marketCloseEventHandler_arePositionsToBeOpened() { return this.marketOpenEventHandler_arePositionsToBeOpened(); } protected override WeightedPositions marketOpenEventHandler_getPositionsToBeOpened() { return this.weightedPositions; } protected override WeightedPositions marketCloseEventHandler_getPositionsToBeOpened() { return this.marketOpenEventHandler_getPositionsToBeOpened(); } protected override LogItem getLogItem( EligibleTickers eligibleTickers ) { PairsTradingLogItem logItem = new PairsTradingLogItem( this.now() , new TestingPositions[ 1 ] , 1 ); // logItem.BestWeightedPositionsInSample = // this.bestTestingPositionsInSample.WeightedPositions; // logItem.NumberOfEligibleTickers = // eligibleTickers.Count; return logItem; } protected override string getTextIdentifier() { return "SmplStrtgy"; } } } |
|
From: Glauco S. <gla...@us...> - 2008-03-06 19:59:31
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/InSample/InSampleChoosers/Genetic In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12325/b7_Scripts/WalkForwardTesting/PairsTrading/InSample/InSampleChoosers/Genetic Added Files: DecoderForPairsTradingTestingPositionsWithBalancedWeights.cs Log Message: Decoder for the Pairs Trading strategy --- NEW FILE: DecoderForPairsTradingTestingPositionsWithBalancedWeights.cs --- /* QuantProject - Quantitative Finance Library DecoderForPairsTradingTestingPositionsWithBalancedWeights.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 QuantProject.Business.Strategies; using QuantProject.Business.Strategies.Optimizing.Decoding; using QuantProject.Business.Strategies.OutOfSample; namespace QuantProject.Scripts.WalkForwardTesting.PairsTrading { /// <summary> /// Decoder for the Pairs Trading strategy /// </summary> public class DecoderForPairsTradingTestingPositionsWithBalancedWeights : DecoderForTestingPositionsWithBalancedWeights { public DecoderForPairsTradingTestingPositionsWithBalancedWeights() { } protected override TestingPositions getTestingPositions(double[] weights, string[] tickers) { WeightedPositions weightedPositions = new WeightedPositions( weights , tickers ); PairsTradingTestingPositions pairsTradingTestingPositions = new PairsTradingTestingPositions( weightedPositions ); return pairsTradingTestingPositions; } } } |
|
From: Glauco S. <gla...@us...> - 2008-03-06 19:58:28
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11329/b7_Scripts/WalkForwardTesting/PairsTrading Added Files: PairsTradingTestingPositions.cs Log Message: Log item for the Pairs Trading strategy --- NEW FILE: PairsTradingTestingPositions.cs --- /* QuantProject - Quantitative Finance Library PairsTradingTestingPositions.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 QuantProject.Business.Strategies; using QuantProject.Business.Strategies.OutOfSample; namespace QuantProject.Scripts.WalkForwardTesting.PairsTrading { /// <summary> /// TestingPositions for the pairs trading strategy /// </summary> [Serializable] public class PairsTradingTestingPositions : TestingPositions , IGeneticOptimized { private int generation; public int Generation { get { return this.generation; } set { this.generation = value; } } public PairsTradingTestingPositions( WeightedPositions weightedPositions ) : base( weightedPositions ) { this.generation = -999; } } } |
|
From: Glauco S. <gla...@us...> - 2008-03-06 19:57:11
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9685/b4_Business Modified Files: b4_Business.csproj Log Message: a2_Strategies\InSample\DummyInSampleChooser.cs has been added Index: b4_Business.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** b4_Business.csproj 5 Mar 2008 17:16:38 -0000 1.56 --- b4_Business.csproj 6 Mar 2008 19:57:04 -0000 1.57 *************** *** 748,751 **** --- 748,756 ---- /> <File + RelPath = "a2_Strategies\InSample\DummyInSampleChooser.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a2_Strategies\InSample\GeneticChooser.cs" SubType = "Code" |
|
From: Glauco S. <gla...@us...> - 2008-03-06 19:56:46
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9435/b4_Business/a2_Strategies/InSample Added Files: DummyInSampleChooser.cs Log Message: Selects no TestingPosition(s) at all. To be used for log item's debugging --- NEW FILE: DummyInSampleChooser.cs --- /* QuantProject - Quantitative Finance Library DummyInSampleChooser.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 QuantProject.ADT; using QuantProject.ADT.Messaging; using QuantProject.Business.Strategies.Eligibles; using QuantProject.Business.Strategies.OutOfSample; using QuantProject.Business.Strategies.ReturnsManagement; namespace QuantProject.Business.Strategies.InSample { /// <summary> /// Selects no TestingPosition(s) at all. To be used for log item's /// debugging /// </summary> public class DummyInSampleChooser : IInSampleChooser { public event NewMessageEventHandler NewMessage; public event NewProgressEventHandler NewProgress; private WeightedPositions weightedPositions; public string Description { get{ return "ConstantWeightedPositions"; } } public DummyInSampleChooser() { this.weightedPositions = weightedPositions; } public object AnalyzeInSample( EligibleTickers eligibleTickers , ReturnsManager returnsManager ) { if ( this.NewMessage != null ) this.NewMessage( this , new NewMessageEventArgs( "New" ) ); if ( this.NewProgress != null ) this.NewProgress( this , new NewProgressEventArgs( 1 , 1 ) ); return new TestingPositions[ 1 ]; } } } |
|
From: Marco M. <mi...@us...> - 2008-03-05 17:16:53
|
Update of /cvsroot/quantproject/QuantProject/b4_Business In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18452 Modified Files: b4_Business.csproj Business_SD.csproj Log Message: Added IGeneticOptimized interface, to be implemented by TestingPositions objects Index: Business_SD.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/Business_SD.csproj,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Business_SD.csproj 27 Feb 2008 22:19:21 -0000 1.13 --- Business_SD.csproj 5 Mar 2008 17:16:38 -0000 1.14 *************** *** 60,63 **** --- 60,64 ---- <Compile Include="a05_Timing\EndOfDayHistory.cs" /> <Compile Include="a07_DataProviders\HistoricalQuoteProvider.cs" /> + <Compile Include="a07_DataProviders\TickerNotExchangedException.cs" /> <Compile Include="a1_Financial\a2_Accounting\h5_Reporting\StatisticsSummaryRows\AverageReturnOnMonday.cs" /> <Compile Include="a1_Financial\a2_Accounting\h5_Reporting\SummaryRows\AverageNumberOfTransactionsPerDay.cs" /> *************** *** 89,92 **** --- 90,94 ---- <Compile Include="a2_Strategies\Optimizing\GenomeManagers\GenomeManagerType.cs" /> <Compile Include="a2_Strategies\OutOfSample\TestingPositions.cs" /> + <Compile Include="a2_Strategies\OutOfSample\IGeneticOptimized.cs" /> <Compile Include="a2_Strategies\returnsManagement\time\CloseToCloseIntervals.cs" /> <Compile Include="a2_Strategies\returnsManagement\time\CloseToOpenIntervals.cs" /> Index: b4_Business.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/b4_Business.csproj,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** b4_Business.csproj 27 Feb 2008 21:43:05 -0000 1.55 --- b4_Business.csproj 5 Mar 2008 17:16:38 -0000 1.56 *************** *** 818,821 **** --- 818,826 ---- /> <File + RelPath = "a2_Strategies\OutOfSample\IGeneticOptimized.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "a2_Strategies\OutOfSample\TestingPositions.cs" SubType = "Code" |
|
From: Marco M. <mi...@us...> - 2008-03-05 17:15:23
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17884 Modified Files: GeneticChooser.cs Log Message: Added IGeneticOptimized interface, to be implemented by TestingPositions objects Added FitnessInSample property to TestingPositions class Index: GeneticChooser.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/InSample/GeneticChooser.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GeneticChooser.cs 27 Feb 2008 22:12:30 -0000 1.6 --- GeneticChooser.cs 5 Mar 2008 17:15:17 -0000 1.7 *************** *** 174,178 **** #endregion newGenerationEventHandler ! //it returns a hashCode for the given genome //normally, it should be overrided in inherited classes protected abstract string getHashCodeForGenome(Genome genome); --- 174,178 ---- #endregion newGenerationEventHandler ! //it returns the inherited HashCode from object //normally, it should be overrided in inherited classes protected abstract string getHashCodeForGenome(Genome genome); *************** *** 184,187 **** --- 184,188 ---- // return returnValue; // } + private void setBestTestingPositions() *************** *** 202,206 **** this.bestTestingPositions[addedTestingPositions] = (TestingPositions)currentGenome.Meaning; ! genomesCollector.Add(currentGenomeHashcode, null); addedTestingPositions++; } --- 203,211 ---- this.bestTestingPositions[addedTestingPositions] = (TestingPositions)currentGenome.Meaning; ! ((TestingPositions)this.bestTestingPositions[addedTestingPositions]).FitnessInSample = ! currentGenome.Fitness; ! ((IGeneticOptimized)this.bestTestingPositions[addedTestingPositions]).Generation = ! currentGenome.Generation; ! genomesCollector.Add(currentGenomeHashcode, null); addedTestingPositions++; } |