Dear Statalisters,
I have data of foreign bonds with their trading date and time, and the
bid and ask prices.
The data structure is as follows:
Bond ID Date Time(HHMMSS) Bid_Price Ask_Price
AAA 20090729 090540 100.00
AAA 20090729 092307 100.05
AAA 20090729 093051 101.10
AAA 20090729 093523 101.20
.
.
.
I want to calculate the "closest-in-time" bid-ask spread of the
bonds(in this case, 101.10-100.05 = 1.05). Since it is my first time
to deal with this type of data I don't know how to do that. Could any
of you let me know what command I should use or how to program to get
the bid-ask spread?
Thank you very much.
JHS
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/