Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21167/b7_Scripts/WalkForwardTesting/PairsTrading
Modified Files:
PairsTradingMain.cs
Log Message:
OutOfSampleChooser(s) have been introduced for a more sophisticated out of sample choice, among the most correlated couples
Index: PairsTradingMain.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/PairsTrading/PairsTradingMain.cs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PairsTradingMain.cs 20 Apr 2008 17:08:05 -0000 1.11
--- PairsTradingMain.cs 27 Apr 2008 17:50:53 -0000 1.12
***************
*** 99,102 ****
--- 99,104 ----
{
int numberOfBestTestingPositionsToBeReturned = 50;
+ // uncomment the following line for a faster script
+ // numberOfBestTestingPositionsToBeReturned = 5;
IDecoderForTestingPositions decoderForWeightedPositions =
***************
*** 138,146 ****
int inSampleDays = 180;
// uncomment the following line for a faster script
! // inSampleDays = 5; // inSampleDays = 60;
IIntervalsSelector intervalsSelector =
new OddIntervalsSelector( 1 , 1 , this.benchmark );
IEndOfDayStrategyForBacktester endOfDayStrategyForBacktester =
new PairsTradingStrategy(
--- 140,156 ----
int inSampleDays = 180;
// uncomment the following line for a faster script
! // inSampleDays = 5;
! // inSampleDays = 60;
IIntervalsSelector intervalsSelector =
new OddIntervalsSelector( 1 , 1 , this.benchmark );
+ OutOfSampleChooser outOfSampleChooser =
+ new OutOfSampleChooserForSingleLongAndShort(
+ 0.006 , 0.99 , 0.006 , 0.99 );
+ outOfSampleChooser =
+ new OutOfSampleChooserForExactNumberOfBestLongPositions(
+ 2 , 0.006 , 0.99 , 0.006 , 0.99 );
+
IEndOfDayStrategyForBacktester endOfDayStrategyForBacktester =
new PairsTradingStrategy(
***************
*** 149,160 ****
this.historicalQuoteProviderForInSample ,
this.historicalQuoteProviderForChosingPositionsOutOfSample ,
! 0.006 , 0.99 , 0.006 , 0.99 );
! endOfDayStrategyForBacktester =
! new LongOnlyPairsTradingStrategy(
! 7 , inSampleDays , intervalsSelector ,
! eligiblesSelector , inSampleChooser ,
! this.historicalQuoteProviderForInSample ,
! this.historicalQuoteProviderForChosingPositionsOutOfSample ,
! 0.006 , 0.99 , 0.006 , 0.99 );
return endOfDayStrategyForBacktester;
}
--- 159,177 ----
this.historicalQuoteProviderForInSample ,
this.historicalQuoteProviderForChosingPositionsOutOfSample ,
! outOfSampleChooser );
! // IEndOfDayStrategyForBacktester endOfDayStrategyForBacktester =
! // new PairsTradingStrategy(
! // 7 , inSampleDays , intervalsSelector ,
! // eligiblesSelector , inSampleChooser ,
! // this.historicalQuoteProviderForInSample ,
! // this.historicalQuoteProviderForChosingPositionsOutOfSample ,
! // 0.006 , 0.99 , 0.006 , 0.99 );
! // endOfDayStrategyForBacktester =
! // new LongOnlyPairsTradingStrategy(
! // 7 , inSampleDays , intervalsSelector ,
! // eligiblesSelector , inSampleChooser ,
! // this.historicalQuoteProviderForInSample ,
! // this.historicalQuoteProviderForChosingPositionsOutOfSample ,
! // 0.006 , 0.02 , 0.006 , 0.02 );
return endOfDayStrategyForBacktester;
}
***************
*** 168,172 ****
DateTime firstDateTime = new DateTime( 2001 , 1 , 1 );
DateTime lastDateTime = new DateTime( 2004 , 12 , 31 );
! double maxRunningHours = 5;
EndOfDayStrategyBackTester endOfDayStrategyBackTester =
--- 185,192 ----
DateTime firstDateTime = new DateTime( 2001 , 1 , 1 );
DateTime lastDateTime = new DateTime( 2004 , 12 , 31 );
! // uncomment the following line for a faster script
! // lastDateTime = new DateTime( 2001 , 1 , 31 );
!
! double maxRunningHours = 7;
EndOfDayStrategyBackTester endOfDayStrategyBackTester =
|