Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4733/b7_Scripts/WalkForwardTesting/WalkForwardLag
Modified Files:
WFLagGenomeManagerWithWeights.cs
Log Message:
- an int seedForRandomGenerator parameter has been added to the constructor
- now the fitness value for the invalid genomes is set to -0.2, it was set to double.MinValue before, but it gave problems with the roulette selection algorithm
Index: WFLagGenomeManagerWithWeights.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomeManagerWithWeights.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** WFLagGenomeManagerWithWeights.cs 8 Aug 2006 09:37:57 -0000 1.2
--- WFLagGenomeManagerWithWeights.cs 21 Aug 2006 21:17:32 -0000 1.3
***************
*** 1,2 ****
--- 1,24 ----
+ /*
+ QuantProject - Quantitative Finance Library
+
+ WFLagGenomeManagerWithWeights.cs
+ Copyright (C) 2003
+ 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 System.Collections;
***************
*** 31,36 ****
- private GeneticOptimizer currentGeneticOptimizer;
-
public int GenomeSize
{
--- 53,56 ----
***************
*** 76,80 ****
DateTime lastOptimizationDate ,
int numberOfDrivingPositions ,
! int numberOfTickersInPortfolio )
{
--- 96,101 ----
DateTime lastOptimizationDate ,
int numberOfDrivingPositions ,
! int numberOfTickersInPortfolio ,
! int seedForRandomGenerator )
{
***************
*** 92,98 ****
this.minimumPositionWeight = 0.2; // TO DO this value should become a constructor parameter
! GenomeManagement.SetRandomGenerator(
! QuantProject.ADT.ConstantsProvider.SeedForRandomGenerator
! + this.firstOptimizationDate.DayOfYear );
this.wFLagCandidates = new WFLagCandidates(
--- 113,122 ----
this.minimumPositionWeight = 0.2; // TO DO this value should become a constructor parameter
! // GenomeManagement.SetRandomGenerator(
! // QuantProject.ADT.ConstantsProvider.SeedForRandomGenerator
! // + this.firstOptimizationDate.DayOfYear );
! // GenomeManagement.SetRandomGenerator(
! // 11 );
! GenomeManagement.SetRandomGenerator( seedForRandomGenerator );
this.wFLagCandidates = new WFLagCandidates(
***************
*** 186,195 ****
private double getFitnessValue( double[] strategyReturns )
{
! // double fitnessValue =
! // AdvancedFunctions.GetSharpeRatio(
! // strategyReturns );
! double fitnessValue =
! AdvancedFunctions.GetExpectancyScore(
! strategyReturns );
// double fitnessValue =
// this.getFitnessValue_withGoodFinal( strategyReturns );
--- 210,219 ----
private double getFitnessValue( double[] strategyReturns )
{
! double fitnessValue =
! AdvancedFunctions.GetSharpeRatio(
! strategyReturns );
! // double fitnessValue =
! // AdvancedFunctions.GetExpectancyScore(
! // strategyReturns );
// double fitnessValue =
// this.getFitnessValue_withGoodFinal( strategyReturns );
***************
*** 227,231 ****
// genome contains a duplicate gene either for
// driving positions or for portfolio positions
! fitnessValue = double.MinValue;
else
// all driving positions genes are distinct and
--- 251,256 ----
// genome contains a duplicate gene either for
// driving positions or for portfolio positions
! //fitnessValue = double.MinValue;
! fitnessValue = -0.2;
else
// all driving positions genes are distinct and
|