Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Fwd: Creating an order book using TAQ data

From   "Jon Håkon Findreng" <>
Subject   st: Fwd: Creating an order book using TAQ data
Date   Thu, 17 Oct 2013 06:56:24 +0200

Dear STATA users,
I am trying to create an order book with data from TAQ.
I have market data for several stocks over a one month time period
narroved down to seconds.
I have one data set for Trades and one for quotes.
The task is to match trades with quotes that was posted five seconds
earlier. If there were none quotes posted five seconds earlier, it needs
to matched with the first available (counting backwards). For example 7
seconds earlier. This function will have to stop by the end of each day.
A trade early in the morning on day 2 can not be matched with the last
quote of day 1.
In the data for quotes I have stock_id, bid, ask and
date(MM:DD:YY:HH:MM:SS). For trades I have stock_id, price, and
There are several times where there are no trades or quotes (these
"times" do not appear in my dataset).
There are also several times where there are multiple quotes at the same
second. This creates problems with tsset stock time.
For example: a trade in Stock A at JAN:01:1999:09:10:02 can correspond
to a quote at JAN:01:1999:09:09:47.
The task is then to create the midpoint of the ask and spread
Then create effektive_spread = 2*abs(trade_price-midpoint)
How would I precied?
Best wishes and thank you,

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index