[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/EntryStrategi
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2011-08-03 22:30:34
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/EntryStrategies
In directory vz-cvs-3.sog:/tmp/cvs-serv6100/b7_Scripts/WalkForwardTesting/LinearRegression/EntryStrategies
Modified Files:
EntryStrategyBasedOnForecastedReturn.cs
Log Message:
bug fixed: now the forecasted return is computed properly
Index: EntryStrategyBasedOnForecastedReturn.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/EntryStrategies/EntryStrategyBasedOnForecastedReturn.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EntryStrategyBasedOnForecastedReturn.cs 28 Mar 2010 15:51:40 -0000 1.1
--- EntryStrategyBasedOnForecastedReturn.cs 3 Aug 2011 22:30:32 -0000 1.2
***************
*** 109,114 ****
double[] outOfSampleValuesForSignalingPortfolios )
{
! double forecastedReturn = 0; // the first coefficient is for the constant regressor
! // and it has no return
for ( int i = 1;
i < candidate.LinearRegression.EstimatedCoefficients.Length ;
--- 109,115 ----
double[] outOfSampleValuesForSignalingPortfolios )
{
! // the first coefficient is for the constant regressor
! double forecastedReturn = candidate.LinearRegression.EstimatedCoefficients[ 0 ];
!
for ( int i = 1;
i < candidate.LinearRegression.EstimatedCoefficients.Length ;
***************
*** 116,120 ****
forecastedReturn +=
candidate.LinearRegression.EstimatedCoefficients[ i ] *
! outOfSampleValuesForSignalingPortfolios[ i ];
return forecastedReturn;
}
--- 117,121 ----
forecastedReturn +=
candidate.LinearRegression.EstimatedCoefficients[ i ] *
! outOfSampleValuesForSignalingPortfolios[ i - 1 ];
return forecastedReturn;
}
***************
*** 123,127 ****
ReturnInterval outOfSampleReturnIntervalForSignaling )
{
! double forecastedReturn = double.MinValue;;
double[] outOfSampleValuesForSignalingPortfolios =
this.getOutOfSampleValuesForSignalingPortfolios(
--- 124,128 ----
ReturnInterval outOfSampleReturnIntervalForSignaling )
{
! double forecastedReturn = double.MinValue;
double[] outOfSampleValuesForSignalingPortfolios =
this.getOutOfSampleValuesForSignalingPortfolios(
|