[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression LinearRegres
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2011-08-03 22:29:25
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression
In directory vz-cvs-3.sog:/tmp/cvs-serv5950/b7_Scripts/WalkForwardTesting/LinearRegression
Modified Files:
LinearRegressionMain.cs
Log Message:
some code has been added to validate the strategy, using a perfect predictor; using a perfect predictor it can be checked that a) the strategy finds it in sample and b) out of sample the portfolio is opened in the right direction (in other words, using a perfect predictor, draw down must be zero!)
Index: LinearRegressionMain.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/LinearRegressionMain.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** LinearRegressionMain.cs 19 Feb 2011 20:23:21 -0000 1.4
--- LinearRegressionMain.cs 3 Aug 2011 22:29:23 -0000 1.5
***************
*** 65,68 ****
--- 65,73 ----
this.historicalMarketValueProviderForInSample =
new HistoricalAdjustedQuoteProvider();
+ // 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;
***************
*** 104,111 ****
int maxNumberOfEligiblesForTrading = 150;
! // uncomment the followings lines for a faster script
! // groupIdForTradingTickers = "fastTest";
! // groupIdForAdditionalSignalingTickers = "fastTest";
! // maxNumberOfEligiblesForTrading = 8;
IEligiblesSelector eligiblesSelector =
--- 109,119 ----
int maxNumberOfEligiblesForTrading = 150;
! // uncomment the followings three lines for a faster script
! groupIdForTradingTickers = "fastTest";
! groupIdForAdditionalSignalingTickers = "fastTest";
! maxNumberOfEligiblesForTrading = 13;
! // groupIdForTradingTickers = "win_leg";
! // groupIdForAdditionalSignalingTickers = "win_leg";
! // maxNumberOfEligiblesForTrading = 2;
IEligiblesSelector eligiblesSelector =
***************
*** 135,145 ****
// uncomment the following line for a faster script
// numberOfBestTestingPositionsToBeReturned = 20;
! // numberOfBestTestingPositionsToBeReturned = 3;
! // int numberOfTickersForTrading = 1;
! int numberOfTickersForTrading = 4;
int[] numberOfTickersInEachSignalingPortfolio =
// new int[] { 1 , 1 , 1 };
! new int[] { 4 };
DecoderForLinearRegressionTestingPositions decoderForWeightedPositions =
--- 143,154 ----
// 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 =
***************
*** 171,181 ****
double mutationRate = 0.02;
// double elitismRate = 0.00001;
! double elitismRate = 0.2;
int populationSizeForGeneticOptimizer = 60000;
int generationNumberForGeneticOptimizer = 15;
// uncomment the followings line for a faster script
! // populationSizeForGeneticOptimizer = 300;
! // generationNumberForGeneticOptimizer = 2;
int seedForRandomGeneratorForTheGeneticOptimizer =
--- 180,193 ----
double mutationRate = 0.02;
// double elitismRate = 0.00001;
! double elitismRate = 0.01;
int populationSizeForGeneticOptimizer = 60000;
int generationNumberForGeneticOptimizer = 15;
// uncomment the followings line for a faster script
! populationSizeForGeneticOptimizer = 300;
! generationNumberForGeneticOptimizer = 2;
! populationSizeForGeneticOptimizer = 1000;
! generationNumberForGeneticOptimizer = 3;
!
int seedForRandomGeneratorForTheGeneticOptimizer =
***************
*** 236,240 ****
// uncomment the following line for a faster script
// inSampleDays = 20;
! // inSampleDays = 60;
// IIntervalsSelector intervalsSelectorForOutOfSample =
--- 248,252 ----
// uncomment the following line for a faster script
// inSampleDays = 20;
! inSampleDays = 60;
// IIntervalsSelector intervalsSelectorForOutOfSample =
***************
*** 314,319 ****
// firstDateTime = new DateTime( 2006 , 2 , 26 );
// lastDateTime = new DateTime( 2006 , 4 , 5 );
! double maxRunningHours = 12;
EndOfDayStrategyBackTester endOfDayStrategyBackTester =
--- 326,333 ----
// firstDateTime = new DateTime( 2006 , 2 , 26 );
// lastDateTime = new DateTime( 2006 , 4 , 5 );
+ firstDateTime = new DateTime( 2004 , 5 , 1 );
+ lastDateTime = new DateTime( 2004 , 6 , 30 );
! double maxRunningHours = 1.5;
EndOfDayStrategyBackTester endOfDayStrategyBackTester =
|