RetrieveBloombergIntraday Tick Data UsingBloombergServer C++ Interface
This example shows how to retrieve intraday tick data from Bloomberg®.
Connect toBloomberg
Connect to the Bloomberg Server using the IP address of the machine running the Bloomberg Server. This example uses the Bloomberg Server C++ interface and assumes the following:
The Bloomberg UUID is
12345678
.The IP address for the machine running the Bloomberg Server is
'111.11.11.111'
.
c
is abloombergServer
object.
uuid = 12345678; ipaddress ='111.11.11.111'; c = bloombergServer(uuid,ipaddress);
弗吉尼亚州lidate the Bloomberg connection.
v = isconnection(c)
v = 1
v
returnstrue
显示,布隆伯格连接是有效的。
Retrieve Intraday Tick Data
Retrieve the trade tick series for the past 50 days for the IBM®security aggregated into 5-minute intervals.
d = timeseries(c,'IBM US Equity',{floor(now)-50,floor(now)},5,'Trade')
ans = Columns 1 through 7 735487.40 187.20 187.60 187.02 187.08 207683.00 560.00 735487.40 187.03 187.13 186.65 186.78 46990.00 349.00 735487.40 186.78 186.78 186.40 186.47 51589.00 399.00 ... Column 8 38902968.00 8779374.00 9626896.00 ...
The columns ind
contain the following:
Numeric representation of date and time
Open price
High price
Low price
Closing price
Volume of ticks
Number of ticks
Total tick value in the bar
The first row of data shows prices and tick data for the current date. The next row shows tick data for 5 minutes later.
CloseBloombergConnection
close(c)