Statalist


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

st: How to calculate the bid-ask spread in this case?


From   stata help <[email protected]>
To   [email protected]
Subject   st: How to calculate the bid-ask spread in this case?
Date   Thu, 30 Jul 2009 16:19:51 -0400

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index