主要内容

bloomberg

Bloomberg桌面连接v3

描述

Thebloombergfunction creates abloombergobject. Thebloombergobject 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

描述

example

c = bloombergcreates 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®

example

c = bloomberg(port,IP,timeout)设置Port暂停properties, and uses the IP address of the local machine running Bloomberg to create a Bloomberg connection.

警告

To refer to a Bloomberg connection in other functions, use the connection object created by thebloombergfunction. Otherwise, usingbloombergas an input argument opens multiple Bloomberg connections, causing unexpected behavior and exhausting memory resources.

输入参数

展开全部

IP地址that identifies the local machine running Bloomberg, specified as a character vector or string scalar.

例子:“ Local主持”

Data Types:char|string

Properties

展开全部

此属性仅阅读。

彭博V3会话, specified as a Bloomberg V3 API Session object.

例子:[1x1 datafeed.internal.blpsession]

Port number of the local machine running Bloomberg, specified as a numeric scalar.

例子:8194

Data Types:双倍的

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:双倍的

日期和时间数据类型,指定为这些值之一。

价值 描述
''(默认) 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 abloombergobject, thebloombergfunction 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';
然后,您可以使用这些支持的功能:万博1manbetx

  • 得到bulkdata

  • GetData

  • 历史

  • tahistory

  • timeseries

    Note

    如果是datareturnformatproperty value is'桌子'和the数据电视property value is'datetime',然后返回的数据是包含日期和时间值的表约会时间array. If thedatareturnformat属性值是一个空的字符向量,然后设置数据电视property to'datetime'返回汇总tick和历史请求的日期和时间值作为MATLAB日期编号。

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 thedatareturnformatproperty to''。有关默认数据类型,请参见“支持的功能列表”。万博1manbetx

You can specify these values using a character vector or string (for example,"table")。

When you create abloombergobject, thebloombergfunction 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 ='结构';
Then, you can use these supported functions.

万博1manbetx支持的功能 返回数据的有效数据类型
类别
  • 单元阵列(默认)

  • 结构体

  • 桌子

等式
  • 单元阵列(默认)

  • 结构体

  • 桌子

fieldinfo
  • 单元阵列(默认)

  • 结构体

  • 桌子

fieldsearch
  • 单元阵列(默认)

  • 结构体

  • 桌子

抬头
  • 结构体(默认)

  • 桌子

文件夹
  • 结构体(默认)

  • 桌子

得到bulkdata
  • 结构体(默认)

  • 桌子

  • timetable

GetData
  • 结构体(默认)

  • 桌子

  • timetable

历史
  • 数字数组(默认)

  • 桌子

  • timetable

tahistory
  • 结构体(默认)

  • 桌子

  • timetable

timeseries
  • 单元阵列(默认的原始刻度数据)

  • numeric array (default for interval tick data)

  • 桌子

  • timetable

Note

不管数据电视property value, if thedatareturnformatproperty value is'时间表', then theGetData得到bulkdatafunctions return a table that contains date and time values as约会时间arrays.

Object Functions

展开全部

close CloseBloomberg桌面连接v3
ISCONNECTION 决定Bloomberg桌面连接v3
等式 股权筛选数据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
类别 Field category search forBloomberg桌面连接v3
fieldinfo 现场信息Bloomberg桌面连接v3
fieldsearch 现场搜索Bloomberg桌面连接v3
抬头 查找有关证券的信息Bloomberg桌面连接v3

例子

全部收缩

首先,创建一个彭博桌面连接。然后,请求最后和开放价格以确保安全。您在运行此代码时看到的当前数据可能与此处的输出数据不同。

使用Bloomberg桌面C ++接口创建Bloomberg连接。

c = bloomberg
c = bloomberg with properties: Session: [1×1 datafeed.internal.BLPSession] IPAddress: "localhost" Port: 8194.00 TimeOut: 0 DatetimeType: '' DataReturnFormat: ''

Thebloombergfunction creates abloombergobjectcwith 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最后和开放价格。还,GetDatareturns the name of the security insec

关闭彭博连接。

close(c)

首先,创建具有超时值的彭博桌面连接。然后,请求最后和开放价格以确保安全。您在运行此代码时看到的当前数据可能与此处的输出数据不同。

使用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: ''

Thebloombergfunction creates abloombergobjectcwith 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最后和开放价格。还,GetDatareturns the name of the security insec

关闭彭博连接。

close(c)

Version History

在R2021a中引入