[Quantproject-developers] AverageTraded value
Brought to you by:
glauco_1
|
From: Glauco S. <gl...@my...> - 2004-08-05 09:01:47
|
Ma sei sicuro che abbia senso utilizzare original close * volume? Non ne sono sicuro, ma mi sa che il volume sia un adjustedVolume e quindi debba essere moltiplicato per l'adjustedClose. At 10:55 PM 8/4/2004 +0000, you wrote: >Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables >In directory >sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30278/b2_DataAccess/Tables > >Modified Files: > Quotes.cs >Log Message: >Added new methods; >Fixed minor bugs (note that now the AverageTraded value is equal to: >original close * volume >and not adjustedClose * volume) > >Index: Quotes.cs >=================================================================== >RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Quotes.cs,v >retrieving revision 1.15 >retrieving revision 1.16 >diff -C2 -d -r1.15 -r1.16 >*** Quotes.cs 2 Aug 2004 23:19:02 -0000 1.15 >--- Quotes.cs 4 Aug 2004 22:55:09 -0000 1.16 >*************** >*** 394,398 **** > { > string sql = "SELECT TOP " + maxNumOfReturnedTickers + " > tickers.tiTicker, tickers.tiCompanyName, " + >! "Avg([quVolume]*[quAdjustedClose]) AS >AverageTradedValue " + > "FROM quotes INNER JOIN (tickers INNER JOIN > tickers_tickerGroups " + > "ON tickers.tiTicker = tickers_tickerGroups.ttTiId) " + >--- 394,398 ---- > { > string sql = "SELECT TOP " + maxNumOfReturnedTickers + " > tickers.tiTicker, tickers.tiCompanyName, " + >! "Avg([quVolume]*[quClose]) AS AverageTradedValue " + > "FROM quotes INNER JOIN (tickers INNER JOIN > tickers_tickerGroups " + > "ON tickers.tiTicker = tickers_tickerGroups.ttTiId) " + >*************** >*** 403,407 **** > SQLBuilder.GetDateConstant(lastQuoteDate) + > "GROUP BY tickers.tiTicker, tickers.tiCompanyName " + >! "ORDER BY Avg([quVolume]*[quAdjustedClose])"; > string sortDirection = " DESC"; > if(orderInASCMode) >--- 403,407 ---- > SQLBuilder.GetDateConstant(lastQuoteDate) + > "GROUP BY tickers.tiTicker, tickers.tiCompanyName " + >! "ORDER BY Avg([quVolume]*[quClose])"; > string sortDirection = " DESC"; > if(orderInASCMode) >*************** >*** 474,478 **** > DataTable dt; > string sql = "SELECT quotes.quTicker, " + >! "Avg([quVolume]*[quAdjustedClose]) AS AverageTradedValue " + > "FROM quotes WHERE quTicker ='" + > ticker + "' " + >--- 474,478 ---- > DataTable dt; > string sql = "SELECT quotes.quTicker, " + >! "Avg([quVolume]*[quClose]) AS AverageTradedValue " + > "FROM quotes WHERE quTicker ='" + > ticker + "' " + >*************** >*** 534,537 **** >--- 534,540 ---- > return (double)dt.Rows[0]["AdjCloseToCloseStandDev"]; > } >+ >+ >+ > > >*************** >*** 627,630 **** >--- 630,650 ---- > return SqlExecutor.GetDataTable( sql ); > } >+ >+ /// <summary> >+ /// returns the quotes DataTable for the given ticker >+ /// </summary> >+ /// <param name="instrumentKey">ticker whose quotes are to be >returned</param> >+ /// <param name="firstQuoteDate">The first quote date</param> >+ /// <param name="lastQuoteDate">The last quote date</param> >+ /// <returns></returns> >+ public static DataTable GetTickerQuotes( string instrumentKey, >DateTime firstQuoteDate, >+ DateTime lastQuoteDate) >+ { >+ string sql = "select * from quotes where quTicker='" + >instrumentKey + "' " + >+ "AND quotes.quDate BETWEEN " + >SQLBuilder.GetDateConstant(firstQuoteDate) + >+ " AND " + SQLBuilder.GetDateConstant(lastQuoteDate) + " " + >+ "order by quDate"; >+ return SqlExecutor.GetDataTable( sql ); >+ } > /// <summary> > /// Returns the quotes for the given instrument , since > startDate to endDate > > > >------------------------------------------------------- >This SF.Net email is sponsored by OSTG. Have you noticed the changes on >Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, >one more big change to announce. We are now OSTG- Open Source Technology >Group. Come see the changes on the new OSTG site. www.ostg.com >_______________________________________________ >Quantproject-developers mailing list >Qua...@li... >https://lists.sourceforge.net/lists/listinfo/quantproject-developers |