[Quantproject-developers] QuantProject/t5_Testing/b7_scripts/linearRegression TestEntryStrategyBas
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2011-08-03 22:37:48
|
Update of /cvsroot/quantproject/QuantProject/t5_Testing/b7_scripts/linearRegression
In directory vz-cvs-3.sog:/tmp/cvs-serv9868/t5_Testing/b7_scripts/linearRegression
Modified Files:
TestEntryStrategyBasedOnForecastedReturn.cs
Log Message:
the test has been changed to thest the new GetIndependentVariablesValues() implementation
Index: TestEntryStrategyBasedOnForecastedReturn.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/t5_Testing/b7_scripts/linearRegression/TestEntryStrategyBasedOnForecastedReturn.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestEntryStrategyBasedOnForecastedReturn.cs 28 Mar 2010 17:05:24 -0000 1.1
--- TestEntryStrategyBasedOnForecastedReturn.cs 3 Aug 2011 22:37:46 -0000 1.2
***************
*** 100,104 ****
LinearRegressionTestingPositions mockLinearRegressionTestingPositions2 =
this.getMockLinearRegressionTestingPositions(
! new double[] { 1 , 0 , 2 } ,
new WeightedPositions(
new double[] { 0.4 , -0.6 } , new string[] { "TA2" , "TB2" } ) );
--- 100,104 ----
LinearRegressionTestingPositions mockLinearRegressionTestingPositions2 =
this.getMockLinearRegressionTestingPositions(
! new double[] { 0.3 , 0 , -2 } ,
new WeightedPositions(
new double[] { 0.4 , -0.6 } , new string[] { "TA2" , "TB2" } ) );
***************
*** 120,125 ****
dynamicMockLinearRegressionFitnessEvaluator.ExpectAndReturn(
! "GetIndependentVariablesValues" , new double[] { 2 , 1 , 2 } , // forecasted
! // return should be 1*2+2*1-3*2=-2 (not selected)
new object[] {
mockLinearRegressionTestingPositions1 ,
--- 120,125 ----
dynamicMockLinearRegressionFitnessEvaluator.ExpectAndReturn(
! "GetIndependentVariablesValues" , new double[] { 1 , 2 } , // forecasted
! // return should be 1+2*1-3*2=-3 (not selected)
new object[] {
mockLinearRegressionTestingPositions1 ,
***************
*** 127,132 ****
historicalMarketValueProvider } );
dynamicMockLinearRegressionFitnessEvaluator.ExpectAndReturn(
! "GetIndependentVariablesValues" , new double[] { 0.1 , 3 , 0.2 } , // forecasted
! // return should be 1*0.1+0*3+2*0.2=0.5 (selected!!)
new object[] {
mockLinearRegressionTestingPositions2 ,
--- 127,132 ----
historicalMarketValueProvider } );
dynamicMockLinearRegressionFitnessEvaluator.ExpectAndReturn(
! "GetIndependentVariablesValues" , new double[] { 3 , -0.1 } , // forecasted
! // return should be 0.3+0*3-2*(-0.1)=0.5 (selected!!)
new object[] {
mockLinearRegressionTestingPositions2 ,
***************
*** 134,139 ****
historicalMarketValueProvider } );
dynamicMockLinearRegressionFitnessEvaluator.ExpectAndReturn(
! "GetIndependentVariablesValues" , new double[] { 2 , 1 , 2 } , // forecasted
! // return should be 0.5*2-1*2+3*2=5 (not selected, because the previous one is selected)
new object[] {
mockLinearRegressionTestingPositions3 ,
--- 134,139 ----
historicalMarketValueProvider } );
dynamicMockLinearRegressionFitnessEvaluator.ExpectAndReturn(
! "GetIndependentVariablesValues" , new double[] { 2 , 1 } , // forecasted
! // return should be 0.5-1*2+3*1=1.5 (not selected, because the previous one is selected)
new object[] {
mockLinearRegressionTestingPositions3 ,
***************
*** 158,162 ****
--- 158,164 ----
Assert.AreEqual( "TA2" , positionsToBeOpened[ 0 ].Ticker );
+ Assert.AreEqual( 0.4 , positionsToBeOpened[ 0 ].Weight );
Assert.AreEqual( "TB2" , positionsToBeOpened[ 1 ].Ticker );
+ Assert.AreEqual( -0.6 , positionsToBeOpened[ 1 ].Weight );
}
#endregion Test_GetPositionsToBeOpened
|