[Quantproject-developers] QuantProject/b3_Data/Selectors SelectionType.cs,1.6,1.7 TickerSelector.cs,
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-01-06 18:40:54
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/Selectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8976/b3_Data/Selectors Modified Files: SelectionType.cs TickerSelector.cs Log Message: Added QuotedInEachMarketDay type of selection for the TickerSelector: it is now possible to retrieve tickers that have the same number of quotes (effectively traded) as a given market index (specified as a string property of the TickerSelector) Index: SelectionType.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/Selectors/SelectionType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SelectionType.cs 22 Aug 2004 16:56:26 -0000 1.6 --- SelectionType.cs 6 Jan 2005 18:40:45 -0000 1.7 *************** *** 37,41 **** CloseToOpenVolatility, CloseToOpenLinearCorrelation, ! CloseToCloseLinearCorrelation } } \ No newline at end of file --- 37,42 ---- CloseToOpenVolatility, CloseToOpenLinearCorrelation, ! CloseToCloseLinearCorrelation, ! QuotedInEachMarketDay } } \ No newline at end of file Index: TickerSelector.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/Selectors/TickerSelector.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TickerSelector.cs 28 Aug 2004 16:41:53 -0000 1.9 --- TickerSelector.cs 6 Jan 2005 18:40:45 -0000 1.10 *************** *** 41,44 **** --- 41,45 ---- private SelectionType typeOfSelection; private string groupID = ""; + private string marketIndex = ""; private DateTime firstQuoteDate = QuantProject.ADT.ConstantsProvider.InitialDateTimeForDownload; private DateTime lastQuoteDate = DateTime.Now; *************** *** 93,96 **** --- 94,106 ---- } + /// <summary> + /// It gets / sets the market index for the current ticker selector + /// </summary> + public string MarketIndex + { + get{return this.marketIndex;} + set{this.marketIndex = value;} + } + #endregion *************** *** 153,156 **** --- 163,168 ---- case SelectionType.CloseToOpenLinearCorrelation: return this.getTickersByCloseToOpenLinearCorrelation(); + case SelectionType.QuotedInEachMarketDay: + return this.getTickersQuotedInEachMarketDay(); //this line should never be reached! default: *************** *** 280,283 **** --- 292,311 ---- } + private DataTable getTickersQuotedInEachMarketDay() + { + if(this.marketIndex == "") + throw new Exception("You first need to set TickerSelection's property <<MarketIndex>>!"); + + if(this.setOfTickersToBeSelected == null) + return QuantProject.Data.DataTables.TickerDataTable.GetTickersQuotedInEachMarketDay( + this.marketIndex, this.groupID, this.firstQuoteDate, this.lastQuoteDate, + this.maxNumOfReturnedTickers); + + else + return QuantProject.Data.DataTables.TickerDataTable.GetTickersQuotedInEachMarketDay( + this.marketIndex, this.setOfTickersToBeSelected, this.firstQuoteDate, this.lastQuoteDate, + this.maxNumOfReturnedTickers); + } + private void launchExceptionIfGroupIDIsNotEmpty() { |