[Quantproject-developers] QuantProject/b2_DataAccess/Tables Quotes.cs, 1.31, 1.32
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2007-04-08 18:59:48
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables
In directory sc8-pr-cvs16:/tmp/cvs-serv14966/b2_DataAccess/Tables
Modified Files:
Quotes.cs
Log Message:
Added GetTickersByRawOpenPrice on overload, for returning tickers ordered only by average raw open price that is greater
than a given minimum, at a given time interval
Index: Quotes.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Quotes.cs,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** Quotes.cs 17 Sep 2006 21:36:09 -0000 1.31
--- Quotes.cs 8 Apr 2007 18:59:45 -0000 1.32
***************
*** 600,603 ****
--- 600,629 ----
/// <summary>
+ /// returns tickers ordered by the average raw open price that is over
+ /// a given minimum, at a given time interval
+ /// </summary>
+ public static DataTable GetTickersByRawOpenPrice( bool orderInASCMode, string groupID,
+ DateTime firstQuoteDate,
+ DateTime lastQuoteDate,
+ long maxNumOfReturnedTickers, double minPrice )
+ {
+ string sql = "SELECT TOP " + maxNumOfReturnedTickers + " quotes.quTicker, tickers.tiCompanyName, " +
+ "Avg(quotes.quOpen) AS AverageRawOpenPrice " +
+ "FROM (quotes INNER JOIN tickers ON quotes.quTicker=tickers.tiTicker) " +
+ "INNER JOIN tickers_tickerGroups ON tickers.tiTicker=tickers_tickerGroups.ttTiId " +
+ "WHERE quotes.quDate Between " + SQLBuilder.GetDateConstant(firstQuoteDate) + " " +
+ "AND " + SQLBuilder.GetDateConstant(lastQuoteDate) + " " +
+ "AND " + "tickers_tickerGroups.ttTgId='" + groupID + "' " +
+ "GROUP BY quotes.quTicker, tickers.tiCompanyName " +
+ "HAVING Avg(quotes.quOpen) >= " + minPrice + " " +
+ "ORDER BY Avg(quotes.quOpen)";
+ string sortDirection = " DESC";
+ if(orderInASCMode)
+ sortDirection = " ASC";
+ sql = sql + sortDirection;
+ return SqlExecutor.GetDataTable( sql );
+ }
+
+ /// <summary>
/// returns tickers ordered by average raw open price level,
/// with a given standard deviation, in a given time interval
|