[Quantproject-developers] QuantProject/b4_Business/a2_Strategies/Eligibles ByPriceMostLiquidAlways
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-04-07 20:42:22
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2231/b4_Business/a2_Strategies/Eligibles Modified Files: ByPriceMostLiquidAlwaysQuoted.cs Log Message: - the code has been slightly refactored to make debugging easier (some intermediate assignment have been added) - some commented code has been added: it allows to write a DataTable to a .xml file (it can be helpful for debugging) Index: ByPriceMostLiquidAlwaysQuoted.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles/ByPriceMostLiquidAlwaysQuoted.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ByPriceMostLiquidAlwaysQuoted.cs 5 Apr 2008 22:57:16 -0000 1.3 --- ByPriceMostLiquidAlwaysQuoted.cs 7 Apr 2008 20:42:13 -0000 1.4 *************** *** 86,89 **** --- 86,90 ---- { DateTime currentDate = endOfDayHistory.LastEndOfDayDateTime.DateTime; + SelectorByGroup group; if(this.temporizedGroup) *************** *** 95,116 **** group = new SelectorByGroup(this.tickersGroupID); DataTable tickersFromGroup = group.GetTableOfSelectedTickers(); int numOfTickersInGroupAtCurrentDate = tickersFromGroup.Rows.Count; SelectorByAverageRawOpenPrice byPrice = ! new SelectorByAverageRawOpenPrice(tickersFromGroup,false, ! currentDate.AddDays(-this.numOfDaysForAverageOpenRawPriceComputation), ! currentDate, ! numOfTickersInGroupAtCurrentDate, ! this.minPrice,this.maxPrice, double.MinValue,double.MaxValue); ! SelectorByLiquidity mostLiquidSelector = ! new SelectorByLiquidity(byPrice.GetTableOfSelectedTickers(), false, endOfDayHistory.FirstEndOfDayDateTime.DateTime, currentDate, this.maxNumberOfEligibleTickersToBeChosen); SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = ! new SelectorByQuotationAtEachMarketDay(mostLiquidSelector.GetTableOfSelectedTickers(), false, endOfDayHistory.History, this.maxNumberOfEligibleTickersToBeChosen); return ! new EligibleTickers( quotedAtEachMarketDayFromLastSelection.GetTableOfSelectedTickers() ); } --- 96,130 ---- group = new SelectorByGroup(this.tickersGroupID); DataTable tickersFromGroup = group.GetTableOfSelectedTickers(); + int numOfTickersInGroupAtCurrentDate = tickersFromGroup.Rows.Count; SelectorByAverageRawOpenPrice byPrice = ! new SelectorByAverageRawOpenPrice(tickersFromGroup,false, ! currentDate.AddDays(-this.numOfDaysForAverageOpenRawPriceComputation), ! currentDate, ! numOfTickersInGroupAtCurrentDate, ! this.minPrice,this.maxPrice, double.MinValue,double.MaxValue); ! DataTable dataTableByPrice = ! byPrice.GetTableOfSelectedTickers(); ! ! SelectorByLiquidity mostLiquidSelector = ! new SelectorByLiquidity( dataTableByPrice , false, endOfDayHistory.FirstEndOfDayDateTime.DateTime, currentDate, this.maxNumberOfEligibleTickersToBeChosen); + DataTable dataTableMostLiquid = + mostLiquidSelector.GetTableOfSelectedTickers(); + + // DataSet dataSet = new DataSet(); + // dataSet.Tables.Add( dataTableMostLiquid ); + // dataSet.WriteXml( "c:\\qpReports\\pairsTrading\\eligiblesCon_ByPriceMostLiquidAlwaysQuoted.xml" ); + SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = ! new SelectorByQuotationAtEachMarketDay( dataTableMostLiquid , false, endOfDayHistory.History, this.maxNumberOfEligibleTickersToBeChosen); + DataTable dataTableToBeReturned = + quotedAtEachMarketDayFromLastSelection.GetTableOfSelectedTickers(); return ! new EligibleTickers( dataTableToBeReturned ); } |