[Quantproject-developers] QuantProject/b7_Scripts/TickerSelectionTesting GenomeMeaning.cs, 1.3, 1.
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2007-04-09 17:58:08
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting
In directory sc8-pr-cvs16:/tmp/cvs-serv2061/b7_Scripts/TickerSelectionTesting
Modified Files:
GenomeMeaning.cs
Log Message:
Added HashCodeForTickerComposition property, in order to create a unique identifier for genomes that are made of the same tickers
Index: GenomeMeaning.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TickerSelectionTesting/GenomeMeaning.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** GenomeMeaning.cs 17 Sep 2006 21:45:33 -0000 1.3
--- GenomeMeaning.cs 9 Apr 2007 17:58:04 -0000 1.4
***************
*** 22,25 ****
--- 22,26 ----
using System;
+ using System.Collections;
namespace QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios
***************
*** 37,40 ****
--- 38,42 ----
private double averageReturnInSample;
private double varianceReturnInSample;
+ private string hashCodeForTickerComposition;
public string[] Tickers
***************
*** 63,66 ****
--- 65,73 ----
}
+ public string HashCodeForTickerComposition
+ {
+ get{return this.hashCodeForTickerComposition;}
+ }
+
private void setDefaultTickersPortfolioWeights()
{
***************
*** 70,76 ****
}
public GenomeMeaning(string[] tickers)
{
! this.tickers = tickers;
this.setDefaultTickersPortfolioWeights();
}
--- 77,97 ----
}
+ private void genomeMeaning_setHashCodeForTickerComposition()
+ {
+ ArrayList listOfTickers = new ArrayList(this.tickers);
+ listOfTickers.Sort();
+ foreach(string tickerCode in listOfTickers)
+ this.hashCodeForTickerComposition += tickerCode;
+ }
+
+ private void genomeMeaning(string[] tickers)
+ {
+ this.tickers = tickers;
+ this.genomeMeaning_setHashCodeForTickerComposition();
+ }
+
public GenomeMeaning(string[] tickers)
{
! this.genomeMeaning(tickers);
this.setDefaultTickersPortfolioWeights();
}
***************
*** 78,82 ****
public GenomeMeaning(string[] tickers, double[] tickersPortfolioWeights)
{
! this.tickers = tickers;
this.tickersPortfolioWeights = tickersPortfolioWeights;
}
--- 99,103 ----
public GenomeMeaning(string[] tickers, double[] tickersPortfolioWeights)
{
! this.genomeMeaning(tickers);
this.tickersPortfolioWeights = tickersPortfolioWeights;
}
***************
*** 87,91 ****
double varianceReturnInSample)
{
! this.tickers = tickers;
this.returnAtLastDayInSample = returnAtLastDayInSample;
this.averageReturnInSample = averageReturnInSample;
--- 108,112 ----
double varianceReturnInSample)
{
! this.genomeMeaning(tickers);
this.returnAtLastDayInSample = returnAtLastDayInSample;
this.averageReturnInSample = averageReturnInSample;
***************
*** 100,104 ****
double varianceReturnInSample)
{
! this.tickers = tickers;
this.tickersPortfolioWeights = tickersPortfolioWeights;
this.returnAtLastDayInSample = returnAtLastDayInSample;
--- 121,125 ----
double varianceReturnInSample)
{
! this.genomeMeaning(tickers);
this.tickersPortfolioWeights = tickersPortfolioWeights;
this.returnAtLastDayInSample = returnAtLastDayInSample;
|