TAQ data tables include real-time price quotes and trade prices that are updated frequently during a trading day. Queries against these tables use intraday price and quote fluctuations.
The tick queries are representative of the query workloads generated in pre-trade analysis and trade order generation. Although this is a partial list of possible queries, these queries constitute a reasonable sample test for use in performance and tuning analysis and also as a template for building a library of queries. The sample TAQ queries can also be modified to build a native Transact-SQL access layer to present data to computational applications.
The TAQ data queries are optimized to run with the Sybase RAP sample data in both RAPStore and RAPCache databases.
The output displayed in this section for the TAQ data queries is derived by running the queries with the large set of sample data provided in the Sybase RAP Samples component.
The TAQ data queries for RAPStore all begin with a commit statement which causes the data to refresh, so the query accesses the most recent data. When you write your own queries for RAPStore, precede the query with a commit statement.
Script name |
Description |
---|---|
tick_qry1.sql |
Gets all ticks for a specified set of 100 securities during a three-hour time period on a specific trade date. |
tick_qry2.sql |
Determines the volume-weighted price of a security considering only the ticks in aselect three-hour interval. |
tick_qry3.sql |
Determines the top 10 percentage losers for a specific date on the selected exchanges, sorted by percentage loss. The loss is calculated as a percentage of the last trade price of the previous day. |
tick_qry4.sql |
Determines the top 10 most active stocks for a specific date, sorted by cumulative trade volume, by considering all trades. |
tick_qry5.sql |
Finds the most active stocks in the COMPUTER industry using SIC code. |
tick_qry6.sql |
Finds the 10 stocks with the highest percentage spreads. Spread is the difference between the last ask-price and the last bid-price. Percentage spread is calculated as a percentage of the bid-point price (average of ask and bid price). |
Sybase suggests that you run setup_tick_qry3_last_price.sqlon RAPCache at the end of each trading day to capture the last price of that day. This data is referenced by tick_qry3.sql.