[Quantproject-developers] QuantProject/b4_Business/a2_Strategies/Eligibles ByPriceLessVolatileOTCA
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-09-29 21:15:15
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14104/Eligibles Modified Files: ByPriceLessVolatileOTCAlwaysQuoted.cs ByPriceMostLiquidAlwaysQuoted.cs ByPriceMostLiquidLessVolatileCTCAlwaysQuoted.cs ByPriceMostLiquidLessVolatileCTOAlwaysQuoted.cs ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.cs Log Message: The new revision moves toward an intraday enabled framework. EndOfDayDate time has been removed, DateTime is used now. The code has been changed accordingly. Index: ByPriceMostLiquidAlwaysQuoted.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles/ByPriceMostLiquidAlwaysQuoted.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ByPriceMostLiquidAlwaysQuoted.cs 8 Apr 2008 21:37:51 -0000 1.5 --- ByPriceMostLiquidAlwaysQuoted.cs 29 Sep 2008 21:14:49 -0000 1.6 *************** *** 24,30 **** using System.Data; using QuantProject.ADT.Messaging; - using QuantProject.Business.Strategies.ReturnsManagement.Time; - using QuantProject.Business.Timing; using QuantProject.Data.Selectors; --- 24,29 ---- using System.Data; + using QuantProject.ADT.Histories; using QuantProject.ADT.Messaging; using QuantProject.Data.Selectors; *************** *** 43,46 **** --- 42,46 ---- /// always quoted at all market days are selected (not more than a given max number); /// </summary> + [Serializable] public class ByPriceMostLiquidAlwaysQuoted : IEligiblesSelector { *************** *** 83,89 **** private EligibleTickers getEligibleTickers_actually( ! EndOfDayHistory endOfDayHistory ) { ! DateTime currentDate = endOfDayHistory.LastEndOfDayDateTime.DateTime; SelectorByGroup group; --- 83,89 ---- private EligibleTickers getEligibleTickers_actually( ! History history ) { ! DateTime currentDate = history.LastDateTime; SelectorByGroup group; *************** *** 109,113 **** SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity( dataTableByPrice , ! false, endOfDayHistory.FirstEndOfDayDateTime.DateTime, currentDate, this.maxNumberOfEligibleTickersToBeChosen); DataTable dataTableMostLiquid = --- 109,113 ---- SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity( dataTableByPrice , ! false, history.FirstDateTime, currentDate, this.maxNumberOfEligibleTickersToBeChosen); DataTable dataTableMostLiquid = *************** *** 120,124 **** SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = new SelectorByQuotationAtEachMarketDay( dataTableMostLiquid , ! false, endOfDayHistory.History, this.maxNumberOfEligibleTickersToBeChosen); DataTable dataTableToBeReturned = --- 120,124 ---- SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = new SelectorByQuotationAtEachMarketDay( dataTableMostLiquid , ! false, history, this.maxNumberOfEligibleTickersToBeChosen); DataTable dataTableToBeReturned = *************** *** 145,152 **** /// <returns></returns> public EligibleTickers GetEligibleTickers( ! EndOfDayHistory endOfDayHistory ) { EligibleTickers eligibleTickers = ! this.getEligibleTickers_actually( endOfDayHistory ); this.getEligibleTickers_sendNewMessage( eligibleTickers ); return eligibleTickers; --- 145,152 ---- /// <returns></returns> public EligibleTickers GetEligibleTickers( ! History history ) { EligibleTickers eligibleTickers = ! this.getEligibleTickers_actually( history ); this.getEligibleTickers_sendNewMessage( eligibleTickers ); return eligibleTickers; Index: ByPriceMostLiquidLessVolatileCTCAlwaysQuoted.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles/ByPriceMostLiquidLessVolatileCTCAlwaysQuoted.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ByPriceMostLiquidLessVolatileCTCAlwaysQuoted.cs 14 Aug 2008 23:36:25 -0000 1.1 --- ByPriceMostLiquidLessVolatileCTCAlwaysQuoted.cs 29 Sep 2008 21:14:49 -0000 1.2 *************** *** 19,30 **** 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.Data; using QuantProject.ADT.Messaging; - using QuantProject.Business.Strategies.ReturnsManagement.Time; - using QuantProject.Business.Timing; using QuantProject.Data.Selectors; --- 19,29 ---- 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.Data; + using QuantProject.ADT.Histories; using QuantProject.ADT.Messaging; using QuantProject.Data.Selectors; *************** *** 43,55 **** /// -step 2: from tickers selected by step 1, the most liquid /// are selected (not more than maxNumberOfMostLiquidTickersToBeChosen); ! /// -step 3: from tickers selected by step 2, the ones that are /// less volatile (CTC returns in the last /// numOfDaysForVolatilityComputation days ! /// are analyzed) are selected /// (not more than maxNumberOfEligibleTickersToBeChosen); /// -step 4: from tickers selected by step 3, the ones that are ! /// always quoted at all market days are selected /// (not more than maxNumberOfEligibleTickersToBeChosen); /// </summary> public class ByPriceMostLiquidLessVolatileCTCAlwaysQuoted : IEligiblesSelector { --- 42,55 ---- /// -step 2: from tickers selected by step 1, the most liquid /// are selected (not more than maxNumberOfMostLiquidTickersToBeChosen); ! /// -step 3: from tickers selected by step 2, the ones that are /// less volatile (CTC returns in the last /// numOfDaysForVolatilityComputation days ! /// are analyzed) are selected /// (not more than maxNumberOfEligibleTickersToBeChosen); /// -step 4: from tickers selected by step 3, the ones that are ! /// always quoted at all market days are selected /// (not more than maxNumberOfEligibleTickersToBeChosen); /// </summary> + [Serializable] public class ByPriceMostLiquidLessVolatileCTCAlwaysQuoted : IEligiblesSelector { *************** *** 74,78 **** private void byPriceMostLiquidLessVolatileCTCAlwaysQuoted_checkParameters() { ! if(this.maxNumberOfMostLiquidTickersToBeChosen <= this.maxNumberOfEligibleTickersToBeChosen) throw new Exception("The set of the most liquid tickers has to " + --- 74,78 ---- private void byPriceMostLiquidLessVolatileCTCAlwaysQuoted_checkParameters() { ! if(this.maxNumberOfMostLiquidTickersToBeChosen <= this.maxNumberOfEligibleTickersToBeChosen) throw new Exception("The set of the most liquid tickers has to " + *************** *** 81,90 **** public ByPriceMostLiquidLessVolatileCTCAlwaysQuoted( ! string tickersGroupID , bool temporizedGroup, int maxNumberOfEligibleTickersToBeChosen, int maxNumberOfMostLiquidTickersToBeChosen, ! int numOfDaysForAverageOpenRawPriceComputation, int numOfDaysForVolatilityComputation, ! double minPrice, double maxPrice) { this.temporizedGroup = temporizedGroup; --- 81,90 ---- public ByPriceMostLiquidLessVolatileCTCAlwaysQuoted( ! string tickersGroupID , bool temporizedGroup, int maxNumberOfEligibleTickersToBeChosen, int maxNumberOfMostLiquidTickersToBeChosen, ! int numOfDaysForAverageOpenRawPriceComputation, int numOfDaysForVolatilityComputation, ! double minPrice, double maxPrice) { this.temporizedGroup = temporizedGroup; *************** *** 92,100 **** this.maxNumberOfEligibleTickersToBeChosen = maxNumberOfEligibleTickersToBeChosen; ! this.maxNumberOfMostLiquidTickersToBeChosen = maxNumberOfMostLiquidTickersToBeChosen; this.numOfDaysForAverageOpenRawPriceComputation = numOfDaysForAverageOpenRawPriceComputation; ! this.numOfDaysForVolatilityComputation = numOfDaysForVolatilityComputation; this.minPrice = minPrice; --- 92,100 ---- this.maxNumberOfEligibleTickersToBeChosen = maxNumberOfEligibleTickersToBeChosen; ! this.maxNumberOfMostLiquidTickersToBeChosen = maxNumberOfMostLiquidTickersToBeChosen; this.numOfDaysForAverageOpenRawPriceComputation = numOfDaysForAverageOpenRawPriceComputation; ! this.numOfDaysForVolatilityComputation = numOfDaysForVolatilityComputation; this.minPrice = minPrice; *************** *** 104,144 **** private EligibleTickers getEligibleTickers_actually( ! EndOfDayHistory endOfDayHistory ) { ! DateTime currentDate = endOfDayHistory.LastEndOfDayDateTime.DateTime; SelectorByGroup group; if(this.temporizedGroup) ! //the group is "temporized": returned set of tickers ! // depends on time group = new SelectorByGroup(this.tickersGroupID, currentDate); ! else//the group is not temporized ! 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, 0.00001, double.MaxValue); ! DataTable dataTableByPrice = byPrice.GetTableOfSelectedTickers(); SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity( dataTableByPrice , ! false, endOfDayHistory.FirstEndOfDayDateTime.DateTime, currentDate, ! this.maxNumberOfMostLiquidTickersToBeChosen); ! DataTable dataTableMostLiquid = mostLiquidSelector.GetTableOfSelectedTickers(); ! SelectorByCloseToCloseVolatility lessVolatileSelector = new SelectorByCloseToCloseVolatility( dataTableMostLiquid , ! true, currentDate.AddDays(-this.numOfDaysForVolatilityComputation), currentDate, ! this.maxNumberOfEligibleTickersToBeChosen); ! ! DataTable dataTableLessVolatile = lessVolatileSelector.GetTableOfSelectedTickers(); // DataSet dataSet = new DataSet(); --- 104,144 ---- private EligibleTickers getEligibleTickers_actually( ! History history ) { ! DateTime currentDate = history.LastDateTime; SelectorByGroup group; if(this.temporizedGroup) ! //the group is "temporized": returned set of tickers ! // depends on time group = new SelectorByGroup(this.tickersGroupID, currentDate); ! else//the group is not temporized ! 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, 0.00001, double.MaxValue); ! DataTable dataTableByPrice = byPrice.GetTableOfSelectedTickers(); SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity( dataTableByPrice , ! false, history.FirstDateTime, currentDate, ! this.maxNumberOfMostLiquidTickersToBeChosen); ! DataTable dataTableMostLiquid = mostLiquidSelector.GetTableOfSelectedTickers(); ! SelectorByCloseToCloseVolatility lessVolatileSelector = new SelectorByCloseToCloseVolatility( dataTableMostLiquid , ! true, currentDate.AddDays(-this.numOfDaysForVolatilityComputation), currentDate, ! this.maxNumberOfEligibleTickersToBeChosen); ! ! DataTable dataTableLessVolatile = lessVolatileSelector.GetTableOfSelectedTickers(); // DataSet dataSet = new DataSet(); *************** *** 146,157 **** // dataSet.WriteXml( "c:\\qpReports\\pairsTrading\\eligiblesCon_ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.xml" ); ! SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = ! new SelectorByQuotationAtEachMarketDay( dataTableLessVolatile , ! false, endOfDayHistory.History, ! this.maxNumberOfEligibleTickersToBeChosen); ! DataTable dataTableToBeReturned = quotedAtEachMarketDayFromLastSelection.GetTableOfSelectedTickers(); ! return new EligibleTickers( dataTableToBeReturned ); } --- 146,157 ---- // dataSet.WriteXml( "c:\\qpReports\\pairsTrading\\eligiblesCon_ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.xml" ); ! SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = ! new SelectorByQuotationAtEachMarketDay( dataTableLessVolatile , ! false, history, ! this.maxNumberOfEligibleTickersToBeChosen); ! DataTable dataTableToBeReturned = quotedAtEachMarketDayFromLastSelection.GetTableOfSelectedTickers(); ! return new EligibleTickers( dataTableToBeReturned ); } *************** *** 173,180 **** /// <returns></returns> public EligibleTickers GetEligibleTickers( ! EndOfDayHistory endOfDayHistory ) { EligibleTickers eligibleTickers = ! this.getEligibleTickers_actually( endOfDayHistory ); this.getEligibleTickers_sendNewMessage( eligibleTickers ); return eligibleTickers; --- 173,180 ---- /// <returns></returns> public EligibleTickers GetEligibleTickers( ! History history ) { EligibleTickers eligibleTickers = ! this.getEligibleTickers_actually( history ); this.getEligibleTickers_sendNewMessage( eligibleTickers ); return eligibleTickers; Index: ByPriceMostLiquidLessVolatileCTOAlwaysQuoted.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles/ByPriceMostLiquidLessVolatileCTOAlwaysQuoted.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ByPriceMostLiquidLessVolatileCTOAlwaysQuoted.cs 14 Aug 2008 23:36:25 -0000 1.1 --- ByPriceMostLiquidLessVolatileCTOAlwaysQuoted.cs 29 Sep 2008 21:14:49 -0000 1.2 *************** *** 24,30 **** using System.Data; using QuantProject.ADT.Messaging; - using QuantProject.Business.Strategies.ReturnsManagement.Time; - using QuantProject.Business.Timing; using QuantProject.Data.Selectors; --- 24,29 ---- using System.Data; + using QuantProject.ADT.Histories; using QuantProject.ADT.Messaging; using QuantProject.Data.Selectors; *************** *** 52,55 **** --- 51,55 ---- /// (not more than maxNumberOfEligibleTickersToBeChosen); /// </summary> + [Serializable] public class ByPriceMostLiquidLessVolatileCTOAlwaysQuoted : IEligiblesSelector { *************** *** 104,110 **** private EligibleTickers getEligibleTickers_actually( ! EndOfDayHistory endOfDayHistory ) { ! DateTime currentDate = endOfDayHistory.LastEndOfDayDateTime.DateTime; SelectorByGroup group; --- 104,110 ---- private EligibleTickers getEligibleTickers_actually( ! History history ) { ! DateTime currentDate = history.LastDateTime; SelectorByGroup group; *************** *** 130,134 **** SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity( dataTableByPrice , ! false, endOfDayHistory.FirstEndOfDayDateTime.DateTime, currentDate, this.maxNumberOfMostLiquidTickersToBeChosen); DataTable dataTableMostLiquid = --- 130,134 ---- SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity( dataTableByPrice , ! false, history.FirstDateTime, currentDate, this.maxNumberOfMostLiquidTickersToBeChosen); DataTable dataTableMostLiquid = *************** *** 148,152 **** SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = new SelectorByQuotationAtEachMarketDay( dataTableLessVolatile , ! false, endOfDayHistory.History, this.maxNumberOfEligibleTickersToBeChosen); DataTable dataTableToBeReturned = --- 148,152 ---- SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = new SelectorByQuotationAtEachMarketDay( dataTableLessVolatile , ! false, history, this.maxNumberOfEligibleTickersToBeChosen); DataTable dataTableToBeReturned = *************** *** 173,180 **** /// <returns></returns> public EligibleTickers GetEligibleTickers( ! EndOfDayHistory endOfDayHistory ) { EligibleTickers eligibleTickers = ! this.getEligibleTickers_actually( endOfDayHistory ); this.getEligibleTickers_sendNewMessage( eligibleTickers ); return eligibleTickers; --- 173,180 ---- /// <returns></returns> public EligibleTickers GetEligibleTickers( ! History history ) { EligibleTickers eligibleTickers = ! this.getEligibleTickers_actually( history ); this.getEligibleTickers_sendNewMessage( eligibleTickers ); return eligibleTickers; Index: ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles/ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.cs 4 May 2008 22:46:33 -0000 1.2 --- ByPriceMostLiquidLessVolatileOTCAlwaysQuoted.cs 29 Sep 2008 21:14:49 -0000 1.3 *************** *** 24,30 **** using System.Data; using QuantProject.ADT.Messaging; - using QuantProject.Business.Strategies.ReturnsManagement.Time; - using QuantProject.Business.Timing; using QuantProject.Data.Selectors; --- 24,29 ---- using System.Data; + using QuantProject.ADT.Histories; using QuantProject.ADT.Messaging; using QuantProject.Data.Selectors; *************** *** 52,55 **** --- 51,55 ---- /// (not more than maxNumberOfEligibleTickersToBeChosen); /// </summary> + [Serializable] public class ByPriceMostLiquidLessVolatileOTCAlwaysQuoted : IEligiblesSelector { *************** *** 104,110 **** private EligibleTickers getEligibleTickers_actually( ! EndOfDayHistory endOfDayHistory ) { ! DateTime currentDate = endOfDayHistory.LastEndOfDayDateTime.DateTime; SelectorByGroup group; --- 104,110 ---- private EligibleTickers getEligibleTickers_actually( ! History history ) { ! DateTime currentDate = history.LastDateTime; SelectorByGroup group; *************** *** 130,134 **** SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity( dataTableByPrice , ! false, endOfDayHistory.FirstEndOfDayDateTime.DateTime, currentDate, this.maxNumberOfMostLiquidTickersToBeChosen); DataTable dataTableMostLiquid = --- 130,134 ---- SelectorByLiquidity mostLiquidSelector = new SelectorByLiquidity( dataTableByPrice , ! false, history.FirstDateTime, currentDate, this.maxNumberOfMostLiquidTickersToBeChosen); DataTable dataTableMostLiquid = *************** *** 148,152 **** SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = new SelectorByQuotationAtEachMarketDay( dataTableLessVolatile , ! false, endOfDayHistory.History, this.maxNumberOfEligibleTickersToBeChosen); DataTable dataTableToBeReturned = --- 148,152 ---- SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = new SelectorByQuotationAtEachMarketDay( dataTableLessVolatile , ! false, history, this.maxNumberOfEligibleTickersToBeChosen); DataTable dataTableToBeReturned = *************** *** 173,180 **** /// <returns></returns> public EligibleTickers GetEligibleTickers( ! EndOfDayHistory endOfDayHistory ) { EligibleTickers eligibleTickers = ! this.getEligibleTickers_actually( endOfDayHistory ); this.getEligibleTickers_sendNewMessage( eligibleTickers ); return eligibleTickers; --- 173,180 ---- /// <returns></returns> public EligibleTickers GetEligibleTickers( ! History history ) { EligibleTickers eligibleTickers = ! this.getEligibleTickers_actually( history ); this.getEligibleTickers_sendNewMessage( eligibleTickers ); return eligibleTickers; Index: ByPriceLessVolatileOTCAlwaysQuoted.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/Eligibles/ByPriceLessVolatileOTCAlwaysQuoted.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ByPriceLessVolatileOTCAlwaysQuoted.cs 25 Apr 2008 17:22:11 -0000 1.1 --- ByPriceLessVolatileOTCAlwaysQuoted.cs 29 Sep 2008 21:14:49 -0000 1.2 *************** *** 19,30 **** 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.Data; using QuantProject.ADT.Messaging; - using QuantProject.Business.Strategies.ReturnsManagement.Time; - using QuantProject.Business.Timing; using QuantProject.Data.Selectors; --- 19,29 ---- 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.Data; + using QuantProject.ADT.Histories; using QuantProject.ADT.Messaging; using QuantProject.Data.Selectors; *************** *** 43,46 **** --- 42,46 ---- /// always quoted at all market days are selected (not more than a given max number); /// </summary> + [Serializable] public class ByPriceLessVolatileOTCAlwaysQuoted : IEligiblesSelector { *************** *** 60,64 **** this.temporizedGroup.ToString() + ")\n" + "MaxNumOfEligibles_" + this.maxNumberOfEligibleTickersToBeChosen.ToString() + "\n" + ! "AverageRawOpenPriceRange(computed for the last " + this.numOfDaysForAverageOpenRawPriceComputation.ToString() + "):\n" + "From_" + this.minPrice + "_to_" + this.maxPrice + "\n" + --- 60,64 ---- this.temporizedGroup.ToString() + ")\n" + "MaxNumOfEligibles_" + this.maxNumberOfEligibleTickersToBeChosen.ToString() + "\n" + ! "AverageRawOpenPriceRange(computed for the last " + this.numOfDaysForAverageOpenRawPriceComputation.ToString() + "):\n" + "From_" + this.minPrice + "_to_" + this.maxPrice + "\n" + *************** *** 66,74 **** } } ! public ByPriceLessVolatileOTCAlwaysQuoted( ! string tickersGroupID , bool temporizedGroup, int maxNumberOfEligibleTickersToBeChosen, ! int numOfDaysForAverageOpenRawPriceComputation, double minPrice, double maxPrice) { this.temporizedGroup = temporizedGroup; --- 66,74 ---- } } ! public ByPriceLessVolatileOTCAlwaysQuoted( ! string tickersGroupID , bool temporizedGroup, int maxNumberOfEligibleTickersToBeChosen, ! int numOfDaysForAverageOpenRawPriceComputation, double minPrice, double maxPrice) { this.temporizedGroup = temporizedGroup; *************** *** 83,115 **** private EligibleTickers getEligibleTickers_actually( ! EndOfDayHistory endOfDayHistory ) { ! DateTime currentDate = endOfDayHistory.LastEndOfDayDateTime.DateTime; SelectorByGroup group; if(this.temporizedGroup) ! //the group is "temporized": returned set of tickers ! // depend on time group = new SelectorByGroup(this.tickersGroupID, currentDate); ! else//the group is not temporized ! 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, 0.00001, double.MaxValue); ! DataTable dataTableByPrice = byPrice.GetTableOfSelectedTickers(); SelectorByOpenToCloseVolatility lessVolatileSelector = new SelectorByOpenToCloseVolatility( dataTableByPrice , ! true, endOfDayHistory.FirstEndOfDayDateTime.DateTime, currentDate, ! this.maxNumberOfEligibleTickersToBeChosen); ! DataTable dataTableLessVolatile = lessVolatileSelector.GetTableOfSelectedTickers(); --- 83,115 ---- private EligibleTickers getEligibleTickers_actually( ! History history ) { ! DateTime currentDate = history.LastDateTime; SelectorByGroup group; if(this.temporizedGroup) ! //the group is "temporized": returned set of tickers ! // depend on time group = new SelectorByGroup(this.tickersGroupID, currentDate); ! else//the group is not temporized ! 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, 0.00001, double.MaxValue); ! DataTable dataTableByPrice = byPrice.GetTableOfSelectedTickers(); SelectorByOpenToCloseVolatility lessVolatileSelector = new SelectorByOpenToCloseVolatility( dataTableByPrice , ! true, history.FirstDateTime, currentDate, ! this.maxNumberOfEligibleTickersToBeChosen); ! DataTable dataTableLessVolatile = lessVolatileSelector.GetTableOfSelectedTickers(); *************** *** 118,129 **** // dataSet.WriteXml( "c:\\qpReports\\pairsTrading\\eligiblesCon_ByPriceLessVolatileOTCAlwaysQuoted.xml" ); ! SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = ! new SelectorByQuotationAtEachMarketDay( dataTableLessVolatile , ! false, endOfDayHistory.History, ! this.maxNumberOfEligibleTickersToBeChosen); ! DataTable dataTableToBeReturned = quotedAtEachMarketDayFromLastSelection.GetTableOfSelectedTickers(); ! return new EligibleTickers( dataTableToBeReturned ); } --- 118,131 ---- // dataSet.WriteXml( "c:\\qpReports\\pairsTrading\\eligiblesCon_ByPriceLessVolatileOTCAlwaysQuoted.xml" ); ! SelectorByQuotationAtEachMarketDay quotedAtEachMarketDayFromLastSelection = ! new SelectorByQuotationAtEachMarketDay( ! dataTableLessVolatile , ! false , ! history , ! this.maxNumberOfEligibleTickersToBeChosen ); ! DataTable dataTableToBeReturned = quotedAtEachMarketDayFromLastSelection.GetTableOfSelectedTickers(); ! return new EligibleTickers( dataTableToBeReturned ); } *************** *** 145,152 **** /// <returns></returns> public EligibleTickers GetEligibleTickers( ! EndOfDayHistory endOfDayHistory ) { EligibleTickers eligibleTickers = ! this.getEligibleTickers_actually( endOfDayHistory ); this.getEligibleTickers_sendNewMessage( eligibleTickers ); return eligibleTickers; --- 147,154 ---- /// <returns></returns> public EligibleTickers GetEligibleTickers( ! History history ) { EligibleTickers eligibleTickers = ! this.getEligibleTickers_actually( history ); this.getEligibleTickers_sendNewMessage( eligibleTickers ); return eligibleTickers; |