bloomberg
Bloomberg桌面连接v3
描述
Thebloomberg
function creates abloomberg
object. Thebloomberg
object represents a Bloomberg®使用Bloomberg V3 C ++ API的桌面连接。
其他DataFeed Toolbox™功能连接到其他彭博服务:彭博服务器(bloombergServer
) and Bloomberg B-PIPE®(Bloombergbpipe
)。For details about these services, seeComparing Bloomberg Connections。
有关彭博连接要求的详细信息,请参阅数据服务器连接要求。以确保一个成功的彭博连接,每form the required steps before executingbloomberg
。有关详细信息,请参阅Installing Bloomberg and Configuring Connections。
Creation
描述
c = bloomberg
creates a Bloomberg connection object with the Bloomberg Desktop C++ interface. You need a Bloomberg Desktop software license for the machine running the Datafeed Toolbox and MATLAB®。
c = bloomberg(port,
设置Port和暂停properties, and uses the IP address of the local machine running Bloomberg to create a Bloomberg connection.IP
,timeout)
警告
To refer to a Bloomberg connection in other functions, use the connection object created by thebloomberg
function. Otherwise, usingbloomberg
as an input argument opens multiple Bloomberg connections, causing unexpected behavior and exhausting memory resources.
输入参数
IP
—IP地址
[]
(默认)|character vector|string scalar
IP地址that identifies the local machine running Bloomberg, specified as a character vector or string scalar.
例子:“ Local主持”
Data Types:char
|string
Properties
会议
—彭博V3会话
彭博V3 API会话对象
此属性仅阅读。
彭博V3会话, specified as a Bloomberg V3 API Session object.
例子:[1x1 datafeed.internal.blpsession]
Port
—Port number of local machine
[]
(默认)|数字标量
Port number of the local machine running Bloomberg, specified as a numeric scalar.
例子:8194
Data Types:双倍的
IPAddress
—本地机器的IP地址
[]
(默认)|character vector
IP地址of the local machine running Bloomberg, specified as a character vector.
Thebloomberg
功能使用IP
输入参数。
例子:“ Local主持”
Data Types:char
暂停
—暂停
数字标量
暂停specifying the time in milliseconds that MATLAB attempts to connect to Bloomberg Desktop before timing out, specified as a numeric scalar.
例子:10000
Data Types:双倍的
数据电视
—Date and time data type
''
(默认)|'datetime'
日期和时间数据类型,指定为这些值之一。
价值 | 描述 |
---|---|
'' (默认) |
Return date and time values as MATLAB date numbers. |
'datetime' |
返回日期和时间值作为一个约会时间 array. |
You can specify these values using a character vector or string (for example,"datetime"
)。
When you create abloomberg
object, thebloomberg
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';
得到bulkdata
GetData
历史
tahistory
timeseries
Note
如果是
datareturnformat
property value is'桌子'
和the数据电视
property value is'datetime'
,然后返回的数据是包含日期和时间值的表约会时间
array. If thedatareturnformat
属性值是一个空的字符向量,然后设置数据电视
property to'datetime'
返回汇总tick和历史请求的日期和时间值作为MATLAB日期编号。
datareturnformat
—Data return format
'细胞'
|'结构体'
|'桌子'
|'时间表'
Data return format, specified as one of these values, which determine the data type of the returned data.
价值 | Data Type of Returned Data |
---|---|
'细胞' |
单元阵列 |
'桌子' |
桌子 |
'时间表' |
timetable |
'结构体' |
结构体 |
Note
The default data type of the returned data depends on the executed function. To specify the default data type, set thedatareturnformat
property to''
。有关默认数据类型,请参见“支持的功能列表”。万博1manbetx
You can specify these values using a character vector or string (for example,"table"
)。
When you create abloomberg
object, thebloomberg
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 ='结构';
万博1manbetx支持的功能 | 返回数据的有效数据类型 |
---|---|
类别 |
|
等式 |
|
fieldinfo |
|
fieldsearch |
|
抬头 |
|
文件夹 |
|
得到bulkdata |
|
GetData |
|
历史 |
|
tahistory |
|
timeseries |
|
Note
不管数据电视
property value, if thedatareturnformat
property value is'时间表'
, then theGetData
和得到bulkdata
functions return a table that contains date and time values as约会时间
arrays.
Object Functions
BloombergDesktop Connection
close |
CloseBloomberg桌面连接v3 |
ISCONNECTION |
决定Bloomberg桌面连接v3 |
BloombergDesktop Data Retrieval
等式 |
股权筛选数据Bloomberg桌面连接v3 |
得到 |
Properties ofBloomberg桌面连接v3 |
得到bulkdata |
Bulk data with header information forBloomberg桌面连接v3 |
GetData |
当前数据Bloomberg桌面连接v3 |
历史 |
Historical data forBloomberg桌面连接v3 |
文件夹 |
当前的投资组合数据Bloomberg桌面连接v3 |
即时的 |
Real-time data forBloomberg桌面连接v3 |
tahistory |
Historical technical analysis forBloomberg桌面连接v3 |
timeseries |
Intraday tick data forBloomberg桌面连接v3 |
RetrieveBloomberg桌面信息
类别 |
Field category search forBloomberg桌面连接v3 |
fieldinfo |
现场信息Bloomberg桌面连接v3 |
fieldsearch |
现场搜索Bloomberg桌面连接v3 |
抬头 |
查找有关证券的信息Bloomberg桌面连接v3 |
例子
创造BloombergDesktop Connection
首先,创建一个彭博桌面连接。然后,请求最后和开放价格以确保安全。您在运行此代码时看到的当前数据可能与此处的输出数据不同。
使用Bloomberg桌面C ++接口创建Bloomberg连接。
c = bloomberg
c = bloomberg with properties: Session: [1×1 datafeed.internal.BLPSession] IPAddress: "localhost" Port: 8194.00 TimeOut: 0 DatetimeType: '' DataReturnFormat: ''
Thebloomberg
function creates abloomberg
objectc
with these properties:
彭博V3 API会话对象
IP地址of the local machine
Port number of the local machine
指定MATLAB®尝试连接到彭博桌面的毫秒数量
Date and time data type
Data return format
要求Microsoft的最后和开放价格®。
[d,sec] = getData(c,'MSFT US Equity',{'LAST_PRICE';'OPEN'})
d = last_price:33.3401 Open:33.6000 sec ='MSFT US Equity'
GetData
返回结构d
最后和开放价格。还,GetData
returns the name of the security insec
。
关闭彭博连接。
close(c)
创造BloombergDesktop Connection with Timeout
首先,创建具有超时值的彭博桌面连接。然后,请求最后和开放价格以确保安全。您在运行此代码时看到的当前数据可能与此处的输出数据不同。
使用Bloomberg桌面C ++接口创建Bloomberg连接。指定10,000毫秒的超时值。
c = bloomberg([],[],10000)
c = bloomberg with properties: Session: [1×1 datafeed.internal.BLPSession] IPAddress: "localhost" Port: 8194.00 TimeOut: 10000 DatetimeType: '' DataReturnFormat: ''
Thebloomberg
function creates abloomberg
objectc
with these properties:
彭博V3 API会话对象
IP地址of the local machine
Port number of the local machine
指定MATLAB®尝试连接到彭博桌面的毫秒数量
Date and time data type
Data return format
要求Microsoft的最后和开放价格。
[d,sec] = getData(c,'MSFT US Equity',{'LAST_PRICE';'OPEN'})
d = last_price:33.3401 Open:33.6000 sec ='MSFT US Equity'
GetData
返回结构d
最后和开放价格。还,GetData
returns the name of the security insec
。
关闭彭博连接。
close(c)
Version History
See Also
matlab命令
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择一个网站
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:。
您还可以从以下列表中选择一个网站:
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.
美洲
- AméricaLatina(Español)
- 加拿大(英语)
- 美国(英语)