Historical market query examples  Tick query examples

Chapter 3: Sample Queries

TAQ data queries

The real-time price TAQ data includes price quotations and trade prices that are updated frequently during a trading day. Queries against these tables require knowledge of intra-day price fluctuations.

Script name

TAQ query description

tick_qry1.sql

Get all ticks for a specified set of 100 securities for a specified three-hour time period on a specified trade date.

tick_qry2.sql

Determine the volume weighted price of a security considering only the ticks in a specified three hour interval.

tick_qry3.sql

Determine the top 10 percentage losers for the specified date on the specified exchanges sorted by percentage loss. The loss is calculated as a percentage of the last trade price of the previous day.

tick_qry4.sql

Determine the top 10 most active stocks for a specified date sorted by cumulative trade volume by considering all trades.

tick_qry5.sql

Find the most active stocks in the COMPUTER industry (use SIC code).

tick_qry6.sql

Find 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).





Copyright © 2005. Sybase Inc. All rights reserved. Tick query examples

View this book as PDF