bloomberg server connection v3 -凯发k8网页登录
bloomberg server connection v3
description
the blpsrv
function creates a blpsrv
object. the blpsrv
object represents a bloomberg® server connection.
other functions connect to different bloomberg services: bloomberg desktop (blp
), and bloomberg
b-pipe® (bpipe
). for details about these
services, see .
for details about bloomberg connection requirements, see . to ensure a successful bloomberg connection, perform the required steps before executing
blpsrv
. for details, see .
creation
syntax
description
c = blpsrv(uuid,ipaddress,port,timeout)
also sets the
timeout property.
caution
to refer to a bloomberg connection in other functions, use the connection object
created by the blpsrv
function. otherwise, using
blpsrv
as an input argument opens multiple
bloomberg connections, causing unexpected behavior and exhausting
memory resources.
properties
uuid
— bloomberg user identity uuid
numeric scalar
bloomberg user identity uuid, specified as a numeric scalar. to find
your uuid, enter iam
in the bloomberg terminal and press go.
example: 12345678
data types: double
user
— bloomberg user
bloomberg user identity object
this property is read-only.
bloomberg user, specified as a bloomberg user identity object.
example: [1x1
com.bloomberglp.blpapi.impl.at]
userip
— ip address of the machine running matlab®
character vector
this property is read-only.
ip address of the machine running matlab, specified as a character vector.
example:
'111.11.11.111'
data types: char
session
— bloomberg v3 session
bloomberg v3 api session object
this property is read-only.
bloomberg v3 session, specified as a bloomberg v3 api session object.
example: [1x1 com.bloomberglp.blpapi.session]
ipaddress
— bloomberg server ip address
character vector | string scalar
bloomberg server ip address, specified as a character vector or string scalar that identifies the machine running the bloomberg server.
example: '111.11.11.111'
data types: char
| string
port
— port number
numeric scalar
port number, specified as a numeric scalar that identifies the port number of the machine running the bloomberg server.
example: 8194
data types: double
timeout
— timeout
numeric scalar
timeout specifying the time in milliseconds that matlab attempts to connect to the machine running the bloomberg server before timing out, specified as a numeric scalar.
example: 10
data types: double
datetimetype
— date and time data type
''
(default) | 'datetime'
date and time data type, specified as one of these values.
value | description |
---|---|
'' (default) | return date and time values as matlab date numbers. |
'datetime' | return date and time values as a datetime
array. |
you can specify these values using a character vector or string (for example,
"datetime"
).
when you create a blpsrv
object, the
blpsrv
function leaves this property unset. to retrieve
data, you must set this property value manually at the command line or in a script using
dot notation, for example:
c.datetimetype = 'datetime';
note
if the
datareturnformat
property value is'table'
and thedatetimetype
property value is'datetime'
, then the returned data is a table that contains date and time values as adatetime
array. if thedatareturnformat
property value is an empty character vector, then setting thedatetimetype
property to'datetime'
returns date and time values for aggregated ticks and historical requests as matlab date numbers.
datareturnformat
— data return format
'cell'
| 'structure'
| 'table'
| 'timetable'
data return format, specified as one of these values, which determine the data type of the returned data.
value | data type of returned data |
---|---|
'cell' | cell array |
'table' | table |
'timetable' | timetable |
'structure' | structure |
note
the default data type of the returned data depends on the executed function.
to specify the default data type, set the datareturnformat
property to ''
. for default data types, see the supported
function list.
you can specify these values using a character vector or string (for example,
"table"
).
when you create a blpsrv
object, the
blpsrv
function leaves this property unset. to retrieve
data, you must set this property value manually at the command line or in a script using
dot notation, for example:
c.datareturnformat = 'structure';
supported function | valid data types for returned data |
---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
note
regardless of the datetimetype
property value, if the
datareturnformat
property value is
'timetable'
, then the getdata
and
getbulkdata
functions return a table that contains date and
time values as datetime
arrays.
object functions
bloomberg server connection
close bloomberg connection v3 | |
properties of bloomberg connection v3 | |
determine bloomberg connection v3 |
bloomberg server data retrieval
equity screening data for bloomberg connection v3 | |
bulk data with header information for bloomberg connection v3 | |
current data for bloomberg connection v3 | |
historical data for bloomberg connection v3 | |
current portfolio data for bloomberg connection v3 | |
real-time data for bloomberg connection v3 | |
unsubscribe real-time requests for bloomberg connection v3 | |
historical technical analysis for bloomberg connection v3 | |
intraday tick data for bloomberg connection v3 |
bloomberg server data information
field category search for bloomberg connection v3 | |
field information for bloomberg connection v3 | |
field search for bloomberg connection v3 | |
find information about securities for bloomberg connection v3 |
examples
connect to bloomberg server
connect to the bloomberg server using the ip address of the machine running the bloomberg server. this example assumes the following:
the bloomberg uuid is
12345678
.the ip address for the machine running the bloomberg server is
'111.11.11.111'
.
uuid = 12345678;
ipaddress = '111.11.11.111';
c = blpsrv(uuid,ipaddress)
c = blpsrv with properties: uuid: 12345678 user: [1x1 com.bloomberglp.blpapi.impl.at] userip: '111.11.11.112' session: [1x1 com.bloomberglp.blpapi.session] ipaddress: '111.11.11.111' port: 8194 timeout: 0 datetimetype: '' datareturnformat: ''
blpsrv
connects to the machine running the bloomberg server using the default port number 8194
.
blpsrv
creates the bloomberg server connection object c
with these properties:
bloomberg user identity uuid
bloomberg user identity object
ip address of the machine running matlab
bloomberg v3 api session object
ip address of the machine running the bloomberg server
port number of the machine running the bloomberg server
number in milliseconds specifying how long matlab attempts to connect to the machine running the bloomberg server before timing out
date and time data type
data return format
request the last and open prices for microsoft®.
format bank % display data format for currency s = 'msft us equity'; f = {'last_price';'open'}; [d,sec] = getdata(c,s,f)
d = last_price: 33.34 open: 33.60 sec = 'msft us equity'
getdata
returns a
structure d
with the last and open prices. also,
getdata
returns the name of the security in
sec
.
close the bloomberg server connection.
close(c)
connect to bloomberg server with port number
connect to the bloomberg server using the ip address of the machine running the bloomberg server. this example assumes the following:
the bloomberg uuid is
12345678
.the ip address for the machine running the bloomberg server is
'111.11.11.111'
.the port number of the machine running the bloomberg server is
8194
.
uuid = 12345678;
ipaddress = '111.11.11.111';
port = 8194;
c = blpsrv(uuid,ipaddress,port)
c = blpsrv with properties: uuid: 12345678 user: [1x1 com.bloomberglp.blpapi.impl.at] userip: '111.11.11.112' session: [1x1 com.bloomberglp.blpapi.session] ipaddress: '111.11.11.111' port: 8194 timeout: 0 datetimetype: '' datareturnformat: ''
blpsrv
connects to the machine running the bloomberg server using the port number 8194
and
creates the bloomberg server connection object c
with these properties:
bloomberg user identity uuid
bloomberg user identity object
ip address of the machine running matlab
bloomberg v3 api session object
ip address of the machine running the bloomberg server
port number of the machine running the bloomberg server
number in milliseconds specifying how long matlab attempts to connect to the machine running the bloomberg server before timing out
date and time data type
data return format
request the last and open prices for microsoft.
format bank % display data format for currency s = 'msft us equity'; f = {'last_price';'open'}; [d,sec] = getdata(c,s,f)
d = last_price: 33.34 open: 33.60 sec = 'msft us equity'
getdata
returns a
structure d
with the last and open prices. also,
getdata
returns the name of the security in
sec
.
close the bloomberg server connection.
close(c)
connect to bloomberg server with timeout
connect to the bloomberg server using the ip address of the machine running the bloomberg server. this example assumes the following:
the bloomberg uuid is
12345678
.the ip address for the machine running the bloomberg server is
'111.11.11.111'
.the port number of the machine running the bloomberg server is your default port number.
the timeout value is 10 milliseconds.
uuid = 12345678;
ipaddress = '111.11.11.111';
port = [];
timeout = 10;
c = blpsrv(uuid,ipaddress,port,timeout)
c = blpsrv with properties: uuid: 12345678 user: [1x1 com.bloomberglp.blpapi.impl.at] userip: '111.11.11.112' session: [1x1 com.bloomberglp.blpapi.session] ipaddress: '111.11.11.111' port: 8194 timeout: 10 datetimetype: '' datareturnformat: ''
blpsrv
connects to the machine running the bloomberg server using the default port number 8194
and a timeout value of 10 milliseconds. blpsrv
creates
the bloomberg server connection object c
with these properties:
bloomberg user identity uuid
bloomberg user identity object
ip address of the machine running matlab
bloomberg v3 api session object
ip address of the machine running the bloomberg server
port number of the machine running the bloomberg server
number in milliseconds specifying how long matlab attempts to connect to the machine running the bloomberg server before timing out
date and time data type
data return format
request the last and open prices for microsoft.
format bank % display data format for currency s = 'msft us equity'; f = {'last_price';'open'}; [d,sec] = getdata(c,s,f)
d = last_price: 33.34 open: 33.60 sec = 'msft us equity'
getdata
returns a
structure d
with the last and open prices. also,
getdata
returns the name of the security in
sec
.
close the bloomberg server connection.
close(c)
version history
introduced in r2014b
see also
topics
matlab 命令
您点击的链接对应于以下 matlab 命令:
请在 matlab 命令行窗口中直接输入以执行命令。web 浏览器不支持 matlab 命令。
select a web site
choose a web site to get translated content where available and see local events and offers. based on your location, we recommend that you select: .
you can also select a web site from the following list:
how to get best site performance
select the china site (in chinese or english) for best site performance. other mathworks country sites are not optimized for visits from your location.
americas
- (español)
- (english)
- (english)
europe
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
asia pacific
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)