blp
彭博Desktop connection V3
Description
这blp
函数创建ablp
目的。这blp
对象代表彭博社®桌面连接。
Other functions connect to different Bloomberg services: Bloomberg Server (blpsrv
), and Bloomberg B-PIPE®((bpipe
)。有关这些服务的详细信息,请参阅比较彭博连接。
For details about Bloomberg connection requirements, seeData Server Connection Requirements。为确保成功的彭博连接,请在执行之前执行所需的步骤blp
。For details, see安装彭博和配置连接。
创建
Description
输入参数
ip
-IP address
[]
(默认)|角色向量|字符串标量
标识运行彭博社的本地计算机的IP地址,指定为字符向量或字符串标量。
Example:'localhost'
数据类型:Char
|细绳
特性
Session
-彭博V3 session
彭博V3 API Session object
This property is read-only.
彭博V3会话,指定为彭博V3 API会话对象。
Example:[1x1 com.bloomberglp.blpapi.session]
港口
-本地机器的端口号
[]
(默认)|numeric scalar
运行彭博社的本地计算机的端口号,指定为数字标量。
Example:8194
数据类型:double
IP地址
-IP address of local machine
[]
(默认)|角色向量
运行彭博社的本地计算机的IP地址,指定为角色向量。
这blp
function sets this property using theip
input argument.
Example:'localhost'
数据类型:Char
TimeOut
-Timeout
numeric scalar
超时指定MATLAB在计时之前尝试连接到彭博桌面的毫秒的时间,并指定为数字标量。
Example:10000
数据类型:double
DatetimeType
-日期和时间数据类型
''
(默认)|'约会时间'
日期和时间数据类型, specified as one of these values.
Value | Description |
---|---|
'' ((default) |
返回日期和时间值作为MATLAB日期编号。 |
'约会时间' |
Return date and time values as adatetime 大批。 |
您可以使用字符向量或字符串指定这些值(例如,“约会时间”
)。
当您创建一个blp
对象,blp
功能使此属性保持不设置。要检索数据,您必须在命令行或使用点表示法中手动设置此属性值,例如:
c.datetimetype ='dateTime';
-
笔记
如果是
DataReturnFormat
属性值是'table'
和DatetimeType
属性值是'约会时间'
,然后returned data is a table that contains date and time values as adatetime
大批。如果是DataReturnFormat
属性值是an empty character vector, then setting theDatetimeType
财产为'约会时间'
returns date and time values for aggregated ticks and historical requests as MATLAB date numbers.
DataReturnFormat
-数据返回格式
'细胞'
|'structure'
|'table'
|'timetable'
数据返回格式,指定为以下值之一,该值确定返回数据的数据类型。
Value | 返回数据的数据类型 |
---|---|
'细胞' |
Cell array |
'table' |
table |
'timetable' |
时间表 |
'structure' |
structure |
笔记
返回数据的默认数据类型取决于执行的函数。要指定默认数据类型,请设置DataReturnFormat
财产为''
。For default data types, see the supported function list.
您可以使用字符向量或字符串指定这些值(例如,“桌子”
)。
当您创建一个blp
对象,blp
功能使此属性保持不设置。要检索数据,您必须在命令行或使用点表示法中手动设置此属性值,例如:
C。DataReturnFormat = 'structure';
Supported Function | Valid Data Types for Returned Data |
---|---|
Category |
|
eqs |
|
fieldinfo |
|
fieldSearch |
|
lookup |
|
portfolio |
|
getBulkData |
|
getdata |
|
history |
|
tahistory |
|
时间序列 |
|
笔记
Regardless of theDatetimeType
属性值,如果DataReturnFormat
属性值是'timetable'
,然后getdata
andgetBulkData
函数返回包含日期和时间值的表datetime
数组。
对象功能
彭博桌面连接
关 |
关彭博连接v3 |
get |
属性彭博连接v3 |
isconnection |
Determine彭博连接v3 |
彭博桌面数据检索
彭博桌面数据信息
Category |
现场类别搜索彭博连接v3 |
fieldinfo |
Field information for彭博连接v3 |
fieldSearch |
Field search for彭博连接v3 |
lookup |
Find information about securities for彭博连接v3 |
Examples
连接到彭博桌面
首先,创建一个Bloomberg®连接,然后检索当前数据以获得安全性。
Create a connection to the Bloomberg Desktop.
C = BLP
c =带有属性的blp:session:[1×1 com.bloomberglp.blpapi.session] ipaddress:'localhost'端口:8194超时:0 dateTimeType:'dataReturnformat:'''''''''''''''
C
is a Bloomberg connection object with these properties:
彭博V3 API Session object
本地机器的IP地址
本地机器的端口号
在毫秒内指定MATLAB尝试连接到彭博桌面之前的数字
日期和时间数据类型
数据返回格式
Request the last and open prices for Microsoft®.
format银行%显示货币的数据格式s =“ MSFT US权益”;f = {'last_price';'打开'};[d,sec] = getData(c,s,f)
d=struct with fields:last_price:72.28开放:71.61
sec =1×1 cell array{'MSFT US Equity'}
getdata
returns a structured
with the last and open prices. Also,getdata
returns the security in秒
。
关the Bloomberg Desktop connection.
关闭(c)
与超时连接到彭博桌面
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属性:会话:[1×1 com.bloomberglp.blpapi.Session] IPAddress: 'localhost' Port: 8194 TimeOut: 10000 DatetimeType: '' DataReturnFormat: ''
这blp
函数创建彭博连接对象C
这些属性:
彭博V3 API Session object
本地机器的IP地址
本地机器的端口号
Number of milliseconds specifying how long MATLAB® attempts to connect to Bloomberg Desktop before timing out
日期和时间数据类型
数据返回格式
Request the last and open prices for Microsoft®.
format银行%显示货币的数据格式s =“ MSFT US权益”;f = {'last_price';'打开'};[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 structured
with the last and open prices. Also,getdata
returns the security in秒
。
关the Bloomberg Desktop connection.
关闭(c)
版本历史记录
matlabコマンド
Matlabコマンドコマンドにするがクリックされまし。。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
选择一个网站以获取可用的翻译内容,并查看本地事件和优惠。根据您的位置,我们建议您选择:。
You can also select a web site from the following list:
如何获得最佳网站性能
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
Americas
- América Latina((Español)
- Canada((English)
- United States((English)