quantproject-developers Mailing List for QuantProject
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...> - 2014-05-27 21:06:22
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31811/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Modified Files: AnnualSystemPercentageReturn.cs Log Message: test after having changed the user psw on sourceforge Index: AnnualSystemPercentageReturn.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/AnnualSystemPercentageReturn.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AnnualSystemPercentageReturn.cs 19 Jun 2005 14:55:09 -0000 1.4 --- AnnualSystemPercentageReturn.cs 27 May 2014 21:06:19 -0000 1.5 *************** *** 6,10 **** namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryRows ! { /// <summary> /// Summary description for TotalNumberOfTrades. --- 6,10 ---- namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryRows ! { /// <summary> /// Summary description for TotalNumberOfTrades. |
|
From: Glauco S. <gla...@us...> - 2013-12-17 20:24:52
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28939 Modified Files: ExtendedMath.cs Log Message: Another test to see if notification goes to a new address Index: ExtendedMath.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ExtendedMath.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ExtendedMath.cs 17 Dec 2013 18:49:37 -0000 1.3 --- ExtendedMath.cs 17 Dec 2013 20:24:50 -0000 1.4 *************** *** 1,3 **** ! using System; namespace QuantProject.ADT --- 1,3 ---- ! using System; namespace QuantProject.ADT |
|
From: Glauco S. <gla...@us...> - 2013-12-17 18:49:40
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22830/b1_ADT Modified Files: ExtendedMath.cs Log Message: test to see if notification goes to my new sf email Index: ExtendedMath.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ExtendedMath.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExtendedMath.cs 14 Jan 2008 23:11:19 -0000 1.2 --- ExtendedMath.cs 17 Dec 2013 18:49:37 -0000 1.3 *************** *** 1,3 **** ! using System; namespace QuantProject.ADT --- 1,3 ---- ! using System; namespace QuantProject.ADT |
|
From: Marco M. <mi...@us...> - 2013-05-09 21:28:08
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv14566 Modified Files: DataBaseVersionManager.cs Log Message: Added some text in order to test if commit is still working after the upgrade to Allura platform on sourceforge Index: DataBaseVersionManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** DataBaseVersionManager.cs 30 Dec 2008 00:11:44 -0000 1.16 --- DataBaseVersionManager.cs 9 May 2013 21:28:06 -0000 1.17 *************** *** 38,42 **** /// This object updates database's structure in order to /// assure complete compatibility in case the user still uses an ! /// old database version /// </summary> /// <remarks> --- 38,42 ---- /// This object updates database's structure in order to /// assure complete compatibility in case the user still uses an ! /// old database version - [test for commit] /// </summary> /// <remarks> |
|
From: Glauco S. <gla...@us...> - 2013-05-08 21:28:45
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Collections In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23159 Modified Files: Set.cs Log Message: Test to see if a commit still works with the new sourceforge engine Allura Index: Set.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Collections/Set.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Set.cs 29 Sep 2008 21:12:26 -0000 1.3 --- Set.cs 8 May 2013 21:28:42 -0000 1.4 *************** *** 1,4 **** /* ! QuantProject - Quantitative Finance Library Set.cs --- 1,4 ---- /* ! QuantProject - Quantitative Finance Library Set.cs |
|
From: Glauco S. <gla...@us...> - 2013-04-15 22:08:18
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25659/b91_QuantProject Modified Files: Main.cs Log Message: Test Index: Main.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b91_QuantProject/Main.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Main.cs 28 Mar 2010 17:15:34 -0000 1.25 --- Main.cs 15 Apr 2013 22:08:15 -0000 1.26 *************** *** 1,4 **** /* ! QuantProject - Quantitative Finance Library Main.cs --- 1,4 ---- /* ! QuantProject - Quantitative Finance Library Main.cs |
|
From: Marco M. <mi...@us...> - 2012-12-30 23:41:19
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21878 Modified Files: TickerDownloader.cs Log Message: The calls to the methods for parsing strings to numbers have been written in a more logical and flexible way (there is no change at all). Index: TickerDownloader.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerDownloader.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** TickerDownloader.cs 29 Sep 2011 21:46:52 -0000 1.25 --- TickerDownloader.cs 30 Dec 2012 23:41:16 -0000 1.26 *************** *** 3,6 **** --- 3,7 ---- using System.Data; using System.Data.Common; + using System.Globalization; using System.IO; using System.Net; *************** *** 255,265 **** myRow[ "quTicker" ] = this.currentTicker; ! myRow[ "quDate" ]=DateTime.Parse( LineIn[0] ); ! myRow[ "quOpen" ]=Double.Parse( LineIn[1] ); ! myRow[ "quHigh" ]=Double.Parse( LineIn[2] ); ! myRow[ "quLow" ]=Double.Parse( LineIn[3] ); ! myRow[ "quClose" ]=Double.Parse( LineIn[4] ); ! myRow[ "quVolume" ]=Math.Min(Double.Parse( LineIn[5]),Convert.ToDouble(Int32.MaxValue)); ! myRow[ "quAdjustedClose" ]=Double.Parse( LineIn[6] ); this.downloadedValuesFromSource.Rows.Add(myRow); --- 256,266 ---- myRow[ "quTicker" ] = this.currentTicker; ! myRow[ "quDate" ]= DateTime.Parse( LineIn[0] ); ! myRow[ "quOpen" ]= doubleParseFromEnglishString( LineIn[1] ); ! myRow[ "quHigh" ]= doubleParseFromEnglishString( LineIn[2] ); ! myRow[ "quLow" ]= doubleParseFromEnglishString( LineIn[3] ); ! myRow[ "quClose" ]= doubleParseFromEnglishString( LineIn[4] ); ! myRow[ "quVolume" ]= Math.Min(doubleParseFromEnglishString( LineIn[5]),Convert.ToDouble(Int32.MaxValue)); ! myRow[ "quAdjustedClose" ]= doubleParseFromEnglishString( LineIn[6] ); this.downloadedValuesFromSource.Rows.Add(myRow); *************** *** 520,524 **** LineIn=Line.Split(','); } ! return Single.Parse(LineIn[6]); } --- 521,525 ---- LineIn=Line.Split(','); } ! return singleParseFromEnglishString(LineIn[6]); } *************** *** 791,794 **** --- 792,809 ---- } } + private double doubleParseFromEnglishString(string stringToParse) + { + double returnValue; + CultureInfo culture = new CultureInfo("en-US"); + returnValue = Double.Parse(stringToParse, culture.NumberFormat); + return returnValue; + } + private float singleParseFromEnglishString(string stringToParse) + { + float returnValue; + CultureInfo culture = new CultureInfo("en-US"); + returnValue = Single.Parse(stringToParse, culture.NumberFormat); + return returnValue; + } } } |
|
From: Glauco S. <gla...@us...> - 2012-05-01 00:11:00
|
Update of /cvsroot/quantproject/QuantProject/t5_Testing/b1_ADT/Econometrics In directory vz-cvs-3.sog:/tmp/cvs-serv1120/t5_Testing/b1_ADT/Econometrics Modified Files: TestLinearRegression.cs Log Message: Tests have been added, for the following properties: QuantProject.ADT.Econometrics.LinearRegression.Residuals QuantProject.ADT.Econometrics.LinearRegression.CenteredTotalSumOfSquares QuantProject.ADT.Econometrics.LinearRegression.HatMatrixDiagonal Index: TestLinearRegression.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/t5_Testing/b1_ADT/Econometrics/TestLinearRegression.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestLinearRegression.cs 28 Mar 2010 16:40:34 -0000 1.1 --- TestLinearRegression.cs 1 May 2012 00:10:58 -0000 1.2 *************** *** 60,63 **** --- 60,71 ---- Assert.AreEqual( 0.999876323 , linearRegression.CenteredRSquare , 0.0000000001 ); + + Assert.AreEqual( 0.033928571 , linearRegression.Residuals[ 0 ] , 0.000000001 ); + Assert.AreEqual( -0.079166667 , linearRegression.Residuals[ 2 ] , 0.000000001 ); + + Assert.AreEqual( 86.871875 , linearRegression.CenteredTotalSumOfSquares , 0.0000000000001 ); + + Assert.AreEqual( 0.892857143 , linearRegression.HatMatrixDiagonal[ 0 ] , 0.000000001 ); + Assert.AreEqual( 0.702380952 , linearRegression.HatMatrixDiagonal[ 3 ] , 0.000000001 ); } } |
|
From: Glauco S. <gla...@us...> - 2012-05-01 00:09:23
|
Update of /cvsroot/quantproject/QuantProject/t5_Testing/b1_ADT/Econometrics
In directory vz-cvs-3.sog:/tmp/cvs-serv32743/t5_Testing/b1_ADT/Econometrics
Added Files:
TestPSquareAndPressStatistic.cs
Log Message:
It tests the following properties:
QuantProject.ADT.Econometrics.LinearRegression.PredictedResidualsSumOfSquares
QuantProject.ADT.Econometrics.LinearRegression.PredictedCenteredTotalSumOfSquares
QuantProject.ADT.Econometrics.LinearRegression.CenteredPSquare
--- NEW FILE: TestPSquareAndPressStatistic.cs ---
/*
QuantProject - Quantitative Finance Library
TestPSquareAndPressStatistic.cs
Copyright (C) 2011
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 NUnit.Framework;
using QuantProject.ADT.Econometrics;
namespace QuantTesting.ADT.Econometrics
{
[TestFixture]
/// <summary>
/// Test for the class QuantProject.ADT.Econometrics.LinearRegression
/// </summary>
public class TestPSquareAndPressStatistic
{
[Test]
public void TestMethod()
{
double[] y = new double[] { 20.10 , 13.30 , 24.40 , 24.95 , 33.30 };
double[,] X = new double[,] {
{ 1 , 1 , 4 } ,
{ 1 , 3 , 1 } ,
{ 1 , 5 , 3 } ,
{ 1 , 7 , 2 } ,
{ 1 , 4 , 6 } };
LinearRegression linearRegression = new LinearRegression();
linearRegression.RunRegression( y , X );
Assert.AreEqual( 0.047736797 , linearRegression.PredictedResidualsSumOfSquares , 0.000000001 );
Assert.AreEqual( 334.58125 , linearRegression.PredictedCenteredTotalSumOfSquares , 0.000000000001 );
Assert.AreEqual( 0.999857324 , linearRegression.CenteredPSquare , 0.000000001 );
}
}
}
|
|
From: Glauco S. <gla...@us...> - 2012-05-01 00:07:22
|
Update of /cvsroot/quantproject/QuantProject/t5_Testing
In directory vz-cvs-3.sog:/tmp/cvs-serv32614/t5_Testing
Modified Files:
QPTesting.csproj
Log Message:
the test
b1_ADT\Econometrics\LinearRegressionWithoutCovarianceMatrix.cs
has been removed
the test
b1_ADT\Econometrics\TestPSquareAndPressStatistic.cs
has been added
Index: QPTesting.csproj
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/t5_Testing/QPTesting.csproj,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** QPTesting.csproj 13 Feb 2011 19:23:30 -0000 1.5
--- QPTesting.csproj 1 May 2012 00:07:20 -0000 1.6
***************
*** 39,44 ****
<Compile Include="a5_FakeImplementations\FakeHistoricalMarketValueProvider.cs" />
<Compile Include="AssemblyInfo.cs" />
- <Compile Include="b1_ADT\Econometrics\LinearRegressionWithoutCovarianceMatrix.cs" />
<Compile Include="b1_ADT\Econometrics\TestLinearRegression.cs" />
<Compile Include="b1_ADT\LinearAlgebra\TestCholeskyDecomposition.cs" />
<Compile Include="b1_ADT\LinearAlgebra\TestLinearSystemSolver.cs" />
--- 39,44 ----
<Compile Include="a5_FakeImplementations\FakeHistoricalMarketValueProvider.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="b1_ADT\Econometrics\TestLinearRegression.cs" />
+ <Compile Include="b1_ADT\Econometrics\TestPSquareAndPressStatistic.cs" />
<Compile Include="b1_ADT\LinearAlgebra\TestCholeskyDecomposition.cs" />
<Compile Include="b1_ADT\LinearAlgebra\TestLinearSystemSolver.cs" />
|
|
From: Glauco S. <gla...@us...> - 2012-05-01 00:06:04
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/Logging
In directory vz-cvs-3.sog:/tmp/cvs-serv32509/b7_Scripts/WalkForwardTesting/LinearRegression/Logging
Modified Files:
AnalyzerForLinearRegressionTestingPositions.cs
Log Message:
The read only property
public double CenteredRSquare
is logged now
Index: AnalyzerForLinearRegressionTestingPositions.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/Logging/AnalyzerForLinearRegressionTestingPositions.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** AnalyzerForLinearRegressionTestingPositions.cs 3 Aug 2011 22:36:42 -0000 1.4
--- AnalyzerForLinearRegressionTestingPositions.cs 1 May 2012 00:06:02 -0000 1.5
***************
*** 64,67 ****
--- 64,71 ----
get { return this.linearRegressionTestingPositions.FitnessInSample; }
}
+ public double CenteredRSquare
+ {
+ get { return this.linearRegressionTestingPositions.LinearRegression.CenteredRSquare; }
+ }
#region ShortDescription
|
|
From: Glauco S. <gla...@us...> - 2012-05-01 00:05:02
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/InSampleChoosers/FitnessEvaluation
In directory vz-cvs-3.sog:/tmp/cvs-serv32444/b7_Scripts/WalkForwardTesting/LinearRegression/InSampleChoosers/FitnessEvaluation
Modified Files:
LinearRegressionFitnessEvaluator.cs
Log Message:
The method
protected virtual double getFitnessValue( ILinearRegression linearRegression )
has been added, so that it can be overridden and an alternative fitness can be used (by default, CenteredRSquare is used, but for instance CenteredPSquared can be used now, overriding this method)
Index: LinearRegressionFitnessEvaluator.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/InSampleChoosers/FitnessEvaluation/LinearRegressionFitnessEvaluator.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** LinearRegressionFitnessEvaluator.cs 3 Aug 2011 22:33:27 -0000 1.5
--- LinearRegressionFitnessEvaluator.cs 1 May 2012 00:04:58 -0000 1.6
***************
*** 74,78 ****
}
! public string Description
{
get
--- 74,78 ----
}
! public virtual string Description
{
get
***************
*** 129,132 ****
--- 129,138 ----
#region getFitnessValue
+
+ protected virtual double getFitnessValue( ILinearRegression linearRegression )
+ {
+ double fitnessValue = linearRegression.CenteredRSquare;
+ return fitnessValue;
+ }
private double getFitnessValue( LinearRegressionTestingPositions testingPositions )
***************
*** 134,145 ****
QuantProject.ADT.Econometrics.ILinearRegression linearRegression =
this.SetUpAndRunLinearRegression( testingPositions );
! double fitnessValue = linearRegression.CenteredRSquare;
return fitnessValue;
- //
- // double fitnessValue;
- // fitnessValue = this.getFitnessValue(
- // testingPositions.TradingPortfolio ,
- // testingPositions.SignalingPortfolios );
- // return fitnessValue;
}
#endregion getFitnessValue
--- 140,146 ----
QuantProject.ADT.Econometrics.ILinearRegression linearRegression =
this.SetUpAndRunLinearRegression( testingPositions );
! // double fitnessValue = linearRegression.CenteredRSquare;
! double fitnessValue = this.getFitnessValue( linearRegression );
return fitnessValue;
}
#endregion getFitnessValue
|
|
From: Glauco S. <gla...@us...> - 2012-04-30 23:41:52
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression
In directory vz-cvs-3.sog:/tmp/cvs-serv30408/b7_Scripts/WalkForwardTesting/LinearRegression
Modified Files:
LinearRegressionMain.cs
Log Message:
Some code has been added to the script, to test a linear regression fitness, based on the PRESS statistics (this fitness is much more robust than RSquare to the outliers)
Index: LinearRegressionMain.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/LinearRegressionMain.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** LinearRegressionMain.cs 22 Sep 2011 19:43:55 -0000 1.6
--- LinearRegressionMain.cs 30 Apr 2012 23:41:50 -0000 1.7
***************
*** 67,73 ****
// uncomment the following instruction in order to test the strategy
// using CSCO as a perfect predictor for MSFT
! this.historicalMarketValueProviderForInSample =
! new LookingAtTheFutureQuoteProvider(
! this.historicalMarketValueProviderForInSample , "MSFT" , "CSCO" );
this.historicalMarketValueProviderForChosingPositionsOutOfSample =
this.historicalMarketValueProviderForInSample;
--- 67,73 ----
// uncomment the following instruction in order to test the strategy
// using CSCO as a perfect predictor for MSFT
! // this.historicalMarketValueProviderForInSample =
! // new LookingAtTheFutureQuoteProvider(
! // this.historicalMarketValueProviderForInSample , "MSFT" , "CSCO" );
this.historicalMarketValueProviderForChosingPositionsOutOfSample =
this.historicalMarketValueProviderForInSample;
***************
*** 140,154 ****
protected override IInSampleChooser getInSampleChooser()
{
! int numberOfBestTestingPositionsToBeReturned = 50;
// uncomment the following line for a faster script
// numberOfBestTestingPositionsToBeReturned = 20;
// numberOfBestTestingPositionsToBeReturned = 6;
! numberOfBestTestingPositionsToBeReturned = 1;
int numberOfTickersForTrading = 1;
int[] numberOfTickersInEachSignalingPortfolio =
! // new int[] { 1 , 1 , 1 };
! new int[] { 1 };
DecoderForLinearRegressionTestingPositions decoderForWeightedPositions =
--- 140,154 ----
protected override IInSampleChooser getInSampleChooser()
{
! int numberOfBestTestingPositionsToBeReturned = 3;
// uncomment the following line for a faster script
// numberOfBestTestingPositionsToBeReturned = 20;
// numberOfBestTestingPositionsToBeReturned = 6;
! // numberOfBestTestingPositionsToBeReturned = 1;
int numberOfTickersForTrading = 1;
int[] numberOfTickersInEachSignalingPortfolio =
! new int[] { 1 , 1 , 1 };
! // new int[] { 1 };
DecoderForLinearRegressionTestingPositions decoderForWeightedPositions =
***************
*** 175,178 ****
--- 175,180 ----
this.fitnessEvaluator =
new LinearRegressionFitnessEvaluator( new LinearRegressionSetupManager() );
+ this.fitnessEvaluator =
+ new PRESSBasedFitnessEvaluator( new LinearRegressionSetupManager() );
// parameters for the genetic optimizer
***************
*** 187,192 ****
populationSizeForGeneticOptimizer = 300;
generationNumberForGeneticOptimizer = 2;
! populationSizeForGeneticOptimizer = 1000;
! generationNumberForGeneticOptimizer = 3;
--- 189,194 ----
populationSizeForGeneticOptimizer = 300;
generationNumberForGeneticOptimizer = 2;
! // populationSizeForGeneticOptimizer = 10000;
! generationNumberForGeneticOptimizer = 6;
***************
*** 272,276 ****
maxTimeSpanToLookAhead );
! double minForecastedReturn = 0.00002F;
IEntryStrategy longAndShortBasedOnAverageExpectedReturn =
new EntryStrategyBasedOnForecastedReturn(
--- 274,278 ----
maxTimeSpanToLookAhead );
! double minForecastedReturn = 0.003F;
IEntryStrategy longAndShortBasedOnAverageExpectedReturn =
new EntryStrategyBasedOnForecastedReturn(
***************
*** 332,338 ****
// lastDateTime = new DateTime( 2006 , 4 , 5 );
firstDateTime = new DateTime( 2004 , 5 , 1 );
! lastDateTime = new DateTime( 2004 , 6 , 30 );
! double maxRunningHours = 1.5;
EndOfDayStrategyBackTester endOfDayStrategyBackTester =
--- 334,340 ----
// lastDateTime = new DateTime( 2006 , 4 , 5 );
firstDateTime = new DateTime( 2004 , 5 , 1 );
! lastDateTime = new DateTime( 2004 , 5 , 31 );
! double maxRunningHours = 2;
EndOfDayStrategyBackTester endOfDayStrategyBackTester =
|
|
From: Glauco S. <gla...@us...> - 2012-04-30 23:39:25
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts
In directory vz-cvs-3.sog:/tmp/cvs-serv30332/b7_Scripts
Modified Files:
Scripts_SD.csproj
Log Message:
WalkForwardTesting\LinearRegression\InSampleChoosers\FitnessEvaluation\PRESSBasedFitnessEvaluator.cs has been added
Index: Scripts_SD.csproj
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/Scripts_SD.csproj,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** Scripts_SD.csproj 22 Sep 2011 19:43:02 -0000 1.49
--- Scripts_SD.csproj 30 Apr 2012 23:39:23 -0000 1.50
***************
*** 179,182 ****
--- 179,183 ----
<Compile Include="WalkForwardTesting\LinearRegression\InSampleChoosers\FitnessEvaluation\LinearRegressionSetUpManager.cs" />
<Compile Include="WalkForwardTesting\LinearRegression\InSampleChoosers\FitnessEvaluation\LinearRegressionValues.cs" />
+ <Compile Include="WalkForwardTesting\LinearRegression\InSampleChoosers\FitnessEvaluation\PRESSBasedFitnessEvaluator.cs" />
<Compile Include="WalkForwardTesting\LinearRegression\InSampleChoosers\FitnessEvaluation\ReturnIntervalsBuilderForTradingAndForSignaling.cs" />
<Compile Include="WalkForwardTesting\LinearRegression\InSampleChoosers\Genetic\GenomeManagerForLinearRegression.cs" />
|
|
From: Glauco S. <gla...@us...> - 2012-04-30 23:37:49
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Econometrics
In directory vz-cvs-3.sog:/tmp/cvs-serv30293/b1_ADT/Econometrics
Modified Files:
LinearRegression.cs
Log Message:
The read only property
public double[] Residuals
has been added.
The read only property
public double CenteredTotalSumOfSquares
has been added
IMPORTANT: the read only property
public double PredictedResidualsSumOfSquares
has been added.
It is the PRESS statistic, a statistic based on the leave-one-out technique. This statistic is much more robust than Rsquare, to outliers.
The read only property
public double PredictedCenteredTotalSumOfSquares
has been added.
IMPORTANT: the read only property
public double CenteredPSquare
has been added.
It is a normalized version of the the PRESS statistics, and it can be used as a fitness alternative the CenteredRSquare: the CenteredPSquare is much more robust with respect to outliers.
Index: LinearRegression.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Econometrics/LinearRegression.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** LinearRegression.cs 6 Jan 2011 18:31:18 -0000 1.2
--- LinearRegression.cs 30 Apr 2012 23:37:46 -0000 1.3
***************
*** 34,37 ****
--- 34,39 ----
public class LinearRegression : ILinearRegression
{
+ private double[] regressand;
+ private double[,] regressors;
private double[,] covarianceMatrix; // (XTransposeX)^-1
private double sumOfSquareResiduals;
***************
*** 51,54 ****
--- 53,116 ----
}
+ #region HatMatrixDiagonal
+ private double[] hatMatrixDiagonal;
+
+ #region setHatMatrixDiagonal
+
+ #region getHatMatrixDiagonal
+
+ #region get_i_th_row_of_X_XtransposeX_inverse
+ private double get_i_th_row_of_X_XtransposeX_inverse( int i , int j )
+ {
+ double partialSum = 0;
+ for( int q = 0 ; q < this.regressors.GetLength( 1 ) ; q++ )
+ partialSum += this.regressors[ i , q ] *
+ this.covarianceMatrix[ q , j ];
+ return partialSum;
+ }
+
+ private double[] get_i_th_row_of_X_XtransposeX_inverse( int i )
+ {
+ double[] i_th_row_of_X_XtransposeX_inverse = new double[ this.regressors.GetLength( 1 ) ];
+ for( int j = 0 ; j < this.regressors.GetLength( 1 ) ; j++ )
+ i_th_row_of_X_XtransposeX_inverse[ j ] =
+ this.get_i_th_row_of_X_XtransposeX_inverse( i , j );
+ return i_th_row_of_X_XtransposeX_inverse;
+ }
+ #endregion get_i_th_row_of_X_XtransposeX_inverse
+
+ private double getHatMatrixDiagonal( int i )
+ {
+ double[] i_th_row_of_X_XtransposeX_inverse =
+ this.get_i_th_row_of_X_XtransposeX_inverse( i );
+ double partialSum = 0;
+ for( int j = 0 ; j < this.regressors.GetLength( 1 ) ; j++ )
+ partialSum += i_th_row_of_X_XtransposeX_inverse[ j ] *
+ this.regressors[ i , j ];
+ return partialSum;
+ }
+ #endregion getHatMatrixDiagonal
+
+ private void setHatMatrixDiagonal()
+ {
+ this.hatMatrixDiagonal = new double[ this.regressand.Length ];
+ for( int i = 0 ; i < hatMatrixDiagonal.Length ; i++ )
+ this.hatMatrixDiagonal[ i ] = this.getHatMatrixDiagonal( i );
+ }
+ #endregion setHatMatrixDiagonal
+
+ /// <summary>
+ /// returns the diagonal of the hat matrix
+ /// </summary>
+ public double[] HatMatrixDiagonal
+ {
+ get{
+ if ( this.hatMatrixDiagonal == null )
+ this.setHatMatrixDiagonal();
+ return this.hatMatrixDiagonal;
+ }
+ }
+ #endregion HatMatrixDiagonal
+
private double centeredRSquare;
***************
*** 57,62 ****
--- 119,261 ----
}
+ #region Residuals
+
+ private double[] residuals;
+
+ #region setResiduals
+
+ #region setResidual
+
+ private double getPredictedValue( int i )
+ {
+ double predictedValue = 0;
+ for ( int j = 0 ; j < this.EstimatedCoefficients.Length ; j++ )
+ predictedValue +=
+ this.estimatedCoefficients[ j ] * this.regressors[ i , j ];
+ return predictedValue;
+ }
+
+ private void setResidual( int i )
+ {
+ double predictedValue = this.getPredictedValue( i );
+ this.residuals[ i ] = this.regressand[ i ] - predictedValue;
+ }
+ #endregion setResidual
+
+ private void setResiduals()
+ {
+ this.residuals = new double[ this.regressand.Length ];
+ for( int i = 0 ; i < this.regressand.Length ; i++ )
+ this.setResidual( i );
+ }
+ #endregion setResiduals
+
+ public double[] Residuals {
+ get {
+ if ( this.residuals == null )
+ this.setResiduals();
+ return this.residuals; }
+ }
+ #endregion Residuals
+
+
+ #region CenteredTotalSumOfSquares
+
+ #region setCenteredTotalSumOfSquares
+ private double getYBar()
+ {
+ double partialSum = 0;
+ for( int i = 0 ; i < this.regressand.Length ; i++ )
+ partialSum += this.regressand[ i ];
+
+ double yBar = partialSum / this.regressand.Length;
+ return yBar;
+ }
+ private void setCenteredTotalSumOfSquares()
+ {
+ double partialSum = 0;
+ double yBar = this.getYBar();
+ for( int i = 0 ; i < this.regressand.Length ; i++ )
+ partialSum += Math.Pow( this.regressand[ i ] - yBar , 2 );
+ this.centeredTotalSumOfSquares = partialSum;
+ }
+ #endregion setCenteredTotalSumOfSquares
+
+ public double CenteredTotalSumOfSquares
+ {
+ get
+ {
+ if ( this.centeredTotalSumOfSquares == double.MinValue )
+ this.setCenteredTotalSumOfSquares();
+ return this.centeredTotalSumOfSquares;
+ }
+ }
+ #endregion CenteredTotalSumOfSquares
+
+ #region PredictedResidualsSumOfSquares
+
+ private double predictedResidualsSumOfSquares;
+
+ #region setPredictedResidualsSumOfSquares
+ private double getExternalResidual( int i )
+ {
+ double externalResidual = this.Residuals[ i ] / ( 1 - this.HatMatrixDiagonal[ i ] );
+ return externalResidual;
+ }
+ private void setPredictedResidualsSumOfSquares()
+ {
+ double partialSum = 0;
+ for( int i = 0 ; i < this.regressand.Length ; i++ )
+ partialSum += Math.Pow( this.getExternalResidual( i ) , 2 );
+ this.predictedResidualsSumOfSquares = partialSum;
+ }
+ #endregion setPredictedResidualsSumOfSquares
+
+ /// <summary>
+ /// the PRESS statistic, a statistic based on the leave-one-out technique
+ /// </summary>
+ public double PredictedResidualsSumOfSquares {
+ get {
+ if ( this.predictedResidualsSumOfSquares == Double.MinValue )
+ // the PRESS statistic has not been set yet
+ this.setPredictedResidualsSumOfSquares();
+ return this.predictedResidualsSumOfSquares; }
+ }
+ #endregion PredictedResidualsSumOfSquares
+
+
+ /// <summary>
+ /// similar to the Total Sum of Squares, but each observation is subtracted
+ /// the mean of the other observations: in other words, the current observation
+ /// does not partecipate to the computationo of the current mean. It has been
+ /// proven that the Prodicted Total Sum Of Squares (defined as above) is equal to
+ /// the (usual) Centered Total Sum of Squares times (n/(n-1))^2
+ /// </summary>
+ public double PredictedCenteredTotalSumOfSquares
+ {
+ get
+ {
+ double n = Convert.ToDouble( this.regressand.Length );
+ double predictedTotalSumOfSquares =
+ this.CenteredTotalSumOfSquares * Math.Pow( n / ( n - 1 ) , 2 );
+ return predictedTotalSumOfSquares;
+ }
+ }
+
+ /// <summary>
+ /// a normalized version of the the PRESS statistics
+ /// </summary>
+ public double CenteredPSquare {
+ get
+ {
+ double centerdPSquare = 1 - this.PredictedResidualsSumOfSquares /
+ this.PredictedCenteredTotalSumOfSquares;
+ return centerdPSquare;
+ }
+ }
+
public LinearRegression()
{
+ this.predictedResidualsSumOfSquares = double.MinValue;
}
***************
*** 159,162 ****
--- 358,363 ----
{
this.runRegression_checkParameters( regressand , regressors );
+ this.regressand = regressand;
+ this.regressors = regressors;
double[,] xTransposeX = this.getXtransposeX( regressors );
this.covarianceMatrix = PositiveDefiniteMatrix.GetInverse( xTransposeX );
|
|
From: Glauco S. <gla...@us...> - 2012-04-30 23:29:43
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Econometrics
In directory vz-cvs-3.sog:/tmp/cvs-serv30011/b1_ADT/Econometrics
Modified Files:
ILinearRegression.cs
Log Message:
The CenteredPSquare statistics has been added to the interface
Index: ILinearRegression.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Econometrics/ILinearRegression.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ILinearRegression.cs 27 Mar 2010 17:05:51 -0000 1.1
--- ILinearRegression.cs 30 Apr 2012 23:29:41 -0000 1.2
***************
*** 20,23 ****
--- 20,24 ----
double[] EstimatedCoefficients{ get; }
double CenteredRSquare{ get; }
+ double CenteredPSquare{ get; }
void RunRegression( double[] regressand , double[,] regressors );
}
|
|
From: Glauco S. <gla...@us...> - 2012-04-30 23:28:05
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Econometrics In directory vz-cvs-3.sog:/tmp/cvs-serv29965/Econometrics Removed Files: LinearRegressionWithoutCovarianceMatrix.cs Log Message: Econometrics\LinearRegressionWithoutCovarianceMatrix.cs has been removed --- LinearRegressionWithoutCovarianceMatrix.cs DELETED --- |
|
From: Glauco S. <gla...@us...> - 2012-04-30 23:27:15
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT
In directory vz-cvs-3.sog:/tmp/cvs-serv29934/b1_ADT
Modified Files:
ADT_SD.csproj
Log Message:
Econometrics\LinearRegressionWithoutCovarianceMatrix.cs has been removed
Index: ADT_SD.csproj
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ADT_SD.csproj,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ADT_SD.csproj 21 Aug 2011 09:59:42 -0000 1.17
--- ADT_SD.csproj 30 Apr 2012 23:27:11 -0000 1.18
***************
*** 51,55 ****
<Compile Include="ConstantsProvider.cs" />
<Compile Include="Econometrics\ILinearRegression.cs" />
- <Compile Include="Econometrics\LinearRegressionWithoutCovarianceMatrix.cs" />
<Compile Include="Econometrics\LinearRegression.cs" />
<Compile Include="ExtendedDataTable.cs" />
--- 51,54 ----
|
|
From: Glauco S. <gla...@us...> - 2012-02-26 19:38:34
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/InSampleChoosers/FitnessEvaluation
In directory vz-cvs-3.sog:/tmp/cvs-serv21833/b7_Scripts/WalkForwardTesting/LinearRegression/InSampleChoosers/FitnessEvaluation
Added Files:
PRESSBasedFitnessEvaluator.cs
Log Message:
Computes (in sample) the PSquare statistic
--- NEW FILE: PRESSBasedFitnessEvaluator.cs ---
/*
QuantProject - Quantitative Finance Library
PRESSBasedFitnessEvaluator.cs
Copyright (C) 2010
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.Econometrics;
using QuantProject.ADT.Statistics;
using QuantProject.Business.DataProviders;
using QuantProject.Business.Strategies;
using QuantProject.Business.Strategies.EquityEvaluation;
using QuantProject.Business.Strategies.OutOfSample;
using QuantProject.Business.Strategies.Optimizing.FitnessEvaluation;
using QuantProject.Business.Strategies.ReturnsManagement;
using QuantProject.Business.Strategies.ReturnsManagement.Time;
namespace QuantProject.Scripts.WalkForwardTesting.LinearRegression
{
/// <summary>
/// Computes (in sample) the PSquare statistic
/// </summary>
[Serializable]
public class PRESSBasedFitnessEvaluator : LinearRegressionFitnessEvaluator
{
public override string Description
{
get
{
return "lnrRgrssnPRESS";
}
}
public PRESSBasedFitnessEvaluator(
ILinearRegressionSetupManager linearRegressionSetupManger ) :
base( linearRegressionSetupManger )
{
}
protected override double getFitnessValue( ILinearRegression linearRegression )
{
double fitnessValue = linearRegression.CenteredPSquare;
return fitnessValue;
}
}
}
|
|
From: Marco M. <mi...@us...> - 2011-10-02 19:11:38
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors
In directory vz-cvs-3.sog:/tmp/cvs-serv13698/Downloader/TickerSelectors
Modified Files:
TickerSelectorForm.cs
Log Message:
The call to SelectorByCloseToCloseCorrelationToBenchmark has been commented out, in order to let the project be compiled.
Index: TickerSelectorForm.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors/TickerSelectorForm.cs,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** TickerSelectorForm.cs 17 Aug 2008 22:20:12 -0000 1.22
--- TickerSelectorForm.cs 2 Oct 2011 19:11:36 -0000 1.23
***************
*** 750,763 ****
else if (this.comboBoxAvailableSelectionRules.Text == "CloseToCloseCorrelationToBenchmark")
{
! if(this.textBoxGroupID.Text != "")
! returnValue = new SelectorByCloseToCloseCorrelationToBenchmark(this.textBoxGroupID.Text, this.textBoxMarketIndex.Text,
! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value,
! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text),
! false);
! else
! returnValue = new SelectorByCloseToCloseCorrelationToBenchmark(this.tableOfSelectedTickers, this.textBoxMarketIndex.Text,
! this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value,
! this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text),
! false);
}
else if (this.comboBoxAvailableSelectionRules.Text == "MaxLinearIndipendence")
--- 750,763 ----
else if (this.comboBoxAvailableSelectionRules.Text == "CloseToCloseCorrelationToBenchmark")
{
! // if(this.textBoxGroupID.Text != "")
! // returnValue = new SelectorByCloseToCloseCorrelationToBenchmark(this.textBoxGroupID.Text, this.textBoxMarketIndex.Text,
! // this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value,
! // this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text),
! // false);
! // else
! // returnValue = new SelectorByCloseToCloseCorrelationToBenchmark(this.tableOfSelectedTickers, this.textBoxMarketIndex.Text,
! // this.checkBoxASCMode.Checked, this.dateTimePickerFirstDate.Value,
! // this.dateTimePickerLastDate.Value, Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text),
! // false);
}
else if (this.comboBoxAvailableSelectionRules.Text == "MaxLinearIndipendence")
|
|
From: Marco M. <mi...@us...> - 2011-09-29 21:48:48
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory vz-cvs-3.sog:/tmp/cvs-serv28186/b2_DataAccess/Tables Modified Files: Quotes.cs Log Message: Fixed bug in tickerDownloader (now adjusted close quotes are properly checked) Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Quotes.cs,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Quotes.cs 21 Aug 2011 10:06:55 -0000 1.39 --- Quotes.cs 29 Sep 2011 21:48:46 -0000 1.40 *************** *** 322,326 **** adjustedCloseInDatabase = (double)(tableOfSingleRow.Rows[0]["quAdjustedClose"]); absoluteDifference = Math.Abs(currentAdjustedValueFromSource - adjustedCloseInDatabase); ! if(absoluteDifference>ConstantsProvider.MaxDifferenceForAdjustedValues) isAdjustedCloseChanged = true; return isAdjustedCloseChanged; --- 322,327 ---- adjustedCloseInDatabase = (double)(tableOfSingleRow.Rows[0]["quAdjustedClose"]); absoluteDifference = Math.Abs(currentAdjustedValueFromSource - adjustedCloseInDatabase); ! if(currentAdjustedValueFromSource != float.MaxValue && ! absoluteDifference>ConstantsProvider.MaxDifferenceForAdjustedValues) isAdjustedCloseChanged = true; return isAdjustedCloseChanged; |
|
From: Marco M. <mi...@us...> - 2011-09-29 21:46:55
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader
In directory vz-cvs-3.sog:/tmp/cvs-serv28084/Downloader
Modified Files:
TickerDownloader.cs
Log Message:
Fixed bug in tickerDownloader (now adjusted close quotes are properly checked)
Index: TickerDownloader.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerDownloader.cs,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** TickerDownloader.cs 16 Jan 2011 11:21:29 -0000 1.24
--- TickerDownloader.cs 29 Sep 2011 21:46:52 -0000 1.25
***************
*** 382,389 ****
QuantProject.Data.DataTables.Quotes tickerQuotes =
new QuantProject.Data.DataTables.Quotes(this.currentTicker);
! // for(
int i = 1;
! // i < this.numberOfQuotesInDatabase && response == false;
! // i += this.numberOfQuotesInDatabase/numberOfRepeatedChecks)
{
DateTime dateToCheck = tickerQuotes.GetPrecedingDate(this.startDate, i);
--- 382,389 ----
QuantProject.Data.DataTables.Quotes tickerQuotes =
new QuantProject.Data.DataTables.Quotes(this.currentTicker);
! for(
int i = 1;
! i < this.numberOfQuotesInDatabase && response == false;
! i += this.numberOfQuotesInDatabase/numberOfRepeatedChecks)
{
DateTime dateToCheck = tickerQuotes.GetPrecedingDate(this.startDate, i);
|
|
From: Glauco S. <gla...@us...> - 2011-09-22 19:45:46
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/EntryStrategies
In directory vz-cvs-3.sog:/tmp/cvs-serv21574/WalkForwardTesting/LinearRegression/EntryStrategies
Modified Files:
EntryStrategyBasedOnForecastedReturn.cs
Log Message:
code has been refactored and a new virtual method tryThisCandidate() has been defined, such that it can be overridden by derived entry strategies
Index: EntryStrategyBasedOnForecastedReturn.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/EntryStrategies/EntryStrategyBasedOnForecastedReturn.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** EntryStrategyBasedOnForecastedReturn.cs 3 Aug 2011 22:30:32 -0000 1.2
--- EntryStrategyBasedOnForecastedReturn.cs 22 Sep 2011 19:45:44 -0000 1.3
***************
*** 37,41 ****
public class EntryStrategyBasedOnForecastedReturn : IEntryStrategy
{
! private double minAverageExpectedReturn;
private ILinearRegressionFitnessEvaluator fitnessEvaluator;
private IReturnIntervalSelectorForSignaling returnIntervalSelectorForSignaling;
--- 37,41 ----
public class EntryStrategyBasedOnForecastedReturn : IEntryStrategy
{
! protected double minAverageExpectedReturn;
private ILinearRegressionFitnessEvaluator fitnessEvaluator;
private IReturnIntervalSelectorForSignaling returnIntervalSelectorForSignaling;
***************
*** 85,90 ****
( this.historicalMarketValueProvider.WereAllExchanged(
candidate.SignalingTickers , outOfSampleReturnIntervalForSignaling.Begin )
! && this.historicalMarketValueProvider.WereAllExchanged(
! candidate.SignalingTickers , outOfSampleReturnIntervalForSignaling.End ) );
return wereExchanged;
}
--- 85,90 ----
( this.historicalMarketValueProvider.WereAllExchanged(
candidate.SignalingTickers , outOfSampleReturnIntervalForSignaling.Begin )
! && this.historicalMarketValueProvider.WereAllExchanged(
! candidate.SignalingTickers , outOfSampleReturnIntervalForSignaling.End ) );
return wereExchanged;
}
***************
*** 137,140 ****
--- 137,149 ----
#endregion computeForecastedReturn
+ protected virtual WeightedPositions tryThisCandidate(
+ LinearRegressionTestingPositions candidate , double expectedReturn )
+ {
+ WeightedPositions weightedPositionsToBeOpened = null;
+ if ( expectedReturn >= this.minAverageExpectedReturn )
+ weightedPositionsToBeOpened = candidate.WeightedPositions;
+ return weightedPositionsToBeOpened;
+ }
+
private WeightedPositions tryThisCandidate(
LinearRegressionTestingPositions candidate ,
***************
*** 147,152 ****
double expectedReturn = this.computeForecastedReturn(
candidate , outOfSampleReturnIntervalForSignaling );
! if ( expectedReturn >= this.minAverageExpectedReturn )
! weightedPositionsToBeOpened = candidate.WeightedPositions;
}
return weightedPositionsToBeOpened;
--- 156,162 ----
double expectedReturn = this.computeForecastedReturn(
candidate , outOfSampleReturnIntervalForSignaling );
! weightedPositionsToBeOpened = this.tryThisCandidate( candidate , expectedReturn );
! // if ( expectedReturn >= this.minAverageExpectedReturn )
! // weightedPositionsToBeOpened = candidate.WeightedPositions;
}
return weightedPositionsToBeOpened;
|
|
From: Glauco S. <gla...@us...> - 2011-09-22 19:43:57
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression In directory vz-cvs-3.sog:/tmp/cvs-serv20460/WalkForwardTesting/LinearRegression Modified Files: LinearRegressionMain.cs Log Message: The script has been change to use EntryStrategyBasedOnForecastedReturnInBothDirections Index: LinearRegressionMain.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/LinearRegressionMain.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LinearRegressionMain.cs 3 Aug 2011 22:29:23 -0000 1.5 --- LinearRegressionMain.cs 22 Sep 2011 19:43:55 -0000 1.6 *************** *** 112,116 **** groupIdForTradingTickers = "fastTest"; groupIdForAdditionalSignalingTickers = "fastTest"; ! maxNumberOfEligiblesForTrading = 13; // groupIdForTradingTickers = "win_leg"; // groupIdForAdditionalSignalingTickers = "win_leg"; --- 112,116 ---- groupIdForTradingTickers = "fastTest"; groupIdForAdditionalSignalingTickers = "fastTest"; ! maxNumberOfEligiblesForTrading = 14; // groupIdForTradingTickers = "win_leg"; // groupIdForAdditionalSignalingTickers = "win_leg"; *************** *** 272,276 **** maxTimeSpanToLookAhead ); ! double minForecastedReturn = 0.002F; IEntryStrategy longAndShortBasedOnAverageExpectedReturn = new EntryStrategyBasedOnForecastedReturn( --- 272,276 ---- maxTimeSpanToLookAhead ); ! double minForecastedReturn = 0.00002F; IEntryStrategy longAndShortBasedOnAverageExpectedReturn = new EntryStrategyBasedOnForecastedReturn( *************** *** 278,281 **** --- 278,286 ---- this.returnIntervalSelectorForSignaling , this.historicalMarketValueProviderForChosingPositionsOutOfSample ); + longAndShortBasedOnAverageExpectedReturn = + new EntryStrategyBasedOnForecastedReturnInBothDirections( + minForecastedReturn , this.fitnessEvaluator , + this.returnIntervalSelectorForSignaling , + this.historicalMarketValueProviderForChosingPositionsOutOfSample ); IExitStrategy exitStrategy = new ExitOnIntervalEnd(); |
|
From: Glauco S. <gla...@us...> - 2011-09-22 19:43:04
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts
In directory vz-cvs-3.sog:/tmp/cvs-serv20400
Modified Files:
Scripts_SD.csproj
Log Message:
WalkForwardTesting\LinearRegression\EntryStrategies\EntryStrategyBasedOnForecastedReturnInBothDirections.cs has been added
Index: Scripts_SD.csproj
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/Scripts_SD.csproj,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** Scripts_SD.csproj 21 Aug 2011 14:30:21 -0000 1.48
--- Scripts_SD.csproj 22 Sep 2011 19:43:02 -0000 1.49
***************
*** 166,169 ****
--- 166,170 ----
<Compile Include="WalkForwardTesting\LinearCombination\MainForm.cs" />
<Compile Include="WalkForwardTesting\LinearRegression\eligibles\EligiblesSelectorForLinearRegression.cs" />
+ <Compile Include="WalkForwardTesting\LinearRegression\EntryStrategies\EntryStrategyBasedOnForecastedReturnInBothDirections.cs" />
<Compile Include="WalkForwardTesting\LinearRegression\EntryStrategies\IEntryStrategy.cs" />
<Compile Include="WalkForwardTesting\LinearRegression\EntryStrategies\EntryStrategyBasedOnForecastedReturn.cs" />
|