bloomberg desktop connection v3 -凯发k8网页登录
bloomberg desktop connection v3
description
the blp
function creates a blp
object.
the blp
object represents a bloomberg® desktop connection.
other functions connect to different bloomberg services: bloomberg server (blpsrv
), 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
blp
. for details, see .
creation
description
c = blp
creates a bloomberg connection object that contains the bloomberg desktop connection. you need a bloomberg desktop software license for the machine running the datafeed toolbox™ and matlab®.
c = blp(port,
sets the
port and timeout properties, and uses the ip address of the local machine
running bloomberg to create a bloomberg connection.ip
,timeout)
caution
to refer to a bloomberg connection in other functions, use the connection object
created by the blp
function. otherwise, using
blp
as an input argument opens multiple
bloomberg connections, causing unexpected behavior and exhausting
memory resources.
input arguments
ip
— ip address
[]
(default) | character vector | string scalar
ip address that identifies the local machine running bloomberg, specified as a character vector or string scalar.
example: 'localhost'
data types: char
| string
properties
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]
port
— port number of local machine
[]
(default) | numeric scalar
port number of the local machine running bloomberg, specified as a numeric scalar.
example: 8194
data types: double
ipaddress
— ip address of local machine
[]
(default) | character vector
ip address of the local machine running bloomberg, specified as a character vector.
the blp
function sets this property using the
ip
input argument.
example: 'localhost'
data types: char
timeout
— timeout
numeric scalar
timeout specifying the time in milliseconds that matlab attempts to connect to bloomberg desktop before timing out, specified as a numeric scalar.
example: 10000
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 blp
object, the
blp
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 blp
object, the
blp
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 desktop connection
close bloomberg connection v3 | |
properties of bloomberg connection v3 | |
determine bloomberg connection v3 |
bloomberg desktop 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 desktop 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 desktop
first, create a bloomberg® connection, and then retrieve current data for a security.
create a connection to the bloomberg desktop.
c = blp
c = blp with properties: session: [1×1 com.bloomberglp.blpapi.session] ipaddress: 'localhost' port: 8194 timeout: 0 datetimetype: '' datareturnformat: ''
c
is a bloomberg connection object with these properties:
bloomberg v3 api session object
ip address of the local machine
port number of the local machine
number in milliseconds specifying how long matlab attempts to connect to bloomberg desktop 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 = struct with fields:
last_price: 72.28
open: 71.61
sec = 1×1 cell array
{'msft us equity'}
getdata
returns a structure d
with the last and open prices. also, getdata
returns the security in sec
.
close the bloomberg desktop connection.
close(c)
connect to bloomberg desktop with timeout
first, create a bloomberg® connection with a timeout value, and then retrieve current data for a security.
create a connection to the bloomberg desktop using the default port and ip address. specify a timeout value of 10,000 milliseconds.
c = blp([],[],10000)
c = blp with properties: session: [1×1 com.bloomberglp.blpapi.session] ipaddress: 'localhost' port: 8194 timeout: 10000 datetimetype: '' datareturnformat: ''
the blp
function creates a bloomberg connection object c
with these properties:
bloomberg v3 api session object
ip address of the local machine
port number of the local machine
number of milliseconds specifying how long matlab® attempts to connect to bloomberg desktop 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 = struct with fields:
last_price: 71.83
open: 71.61
sec = 1×1 cell array
{'msft us equity'}
getdata
returns a structure d
with the last and open prices. also, getdata
returns the security in sec
.
close the bloomberg desktop connection.
close(c)
version history
introduced in r2010a
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)
- 中国
- (日本語)
- (한국어)