[Quantproject-developers] QuantProject/b3_Data/Selectors SelectorByCloseToCloseCorrelationToBenchma
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2008-01-14 23:14:44
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/Selectors In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10304/b3_Data/Selectors Modified Files: SelectorByCloseToCloseCorrelationToBenchmark.cs Log Message: The selector has been simplified Index: SelectorByCloseToCloseCorrelationToBenchmark.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/Selectors/SelectorByCloseToCloseCorrelationToBenchmark.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SelectorByCloseToCloseCorrelationToBenchmark.cs 3 Aug 2006 21:17:16 -0000 1.4 --- SelectorByCloseToCloseCorrelationToBenchmark.cs 14 Jan 2008 23:14:41 -0000 1.5 *************** *** 31,38 **** /// Class for selection on tickers by close to close absolute correlation to /// a given benchmark - /// NOTE that - /// close values are grouped in pairs and the first close value in each group is - /// not the last close in the previous group. There is, in other words, a discontinuity - /// between each group, with length equal to the group's length /// </summary> public class SelectorByCloseToCloseCorrelationToBenchmark : TickerSelector, ITickerSelector --- 31,34 ---- *************** *** 131,143 **** float[] tickerQuotes = QuantProject.Data.DataTables.Quotes.GetArrayOfAdjustedCloseQuotes((string)row[0], firstQuoteDate, lastQuoteDate); ! if(tickerQuotes.Length == benchmarkQuotes.Length) ! { ! if((string)row[0] == benchmark) ! row["CloseToCloseCorrelationToBenchmark"] = 1; ! else ! row["CloseToCloseCorrelationToBenchmark"] = BasicFunctions.PearsonCorrelationCoefficient(benchmarkQuotes, tickerQuotes); - } - } DataTable tableToReturn = ExtendedDataTable.CopyAndSort(setOfTickers, --- 127,132 ---- float[] tickerQuotes = QuantProject.Data.DataTables.Quotes.GetArrayOfAdjustedCloseQuotes((string)row[0], firstQuoteDate, lastQuoteDate); ! row["CloseToCloseCorrelationToBenchmark"] = BasicFunctions.PearsonCorrelationCoefficient(benchmarkQuotes, tickerQuotes); } DataTable tableToReturn = ExtendedDataTable.CopyAndSort(setOfTickers, |