主要内容

GetData

当前数据BloombergConnection V3

Description

例子

d= getData(C,,,,s,,,,F返回字段的数据FFor the security listsGetDataaccesses the Bloomberg®参考数据服务。

例子

d= getData(C,,,,s,,,,F,,,,o,,,,ov使用覆盖字段返回数据owith corresponding override valuesov

例子

d= getData(C,,,,s,,,,F,,,,o,,,,ov,,,,名称,价值使用名称值对参数返回数据,以进行其他彭博请求设置。

例子

[[d,,,,] = getData(___additionally returns the security list使用上一个语法中的任何输入参数组合。

Examples

全部收缩

首先,创建一个彭博桌面连接。这n, request last and open prices for a security. The current data you see when running this code can differ from the output data here.

创建彭博连接。

c = blp;

另外,您可以使用blpsrv或彭博b-pipe®usingbpipe

要求Microsoft的最后和开放价格®

[d,sec] = getData(c,“ MSFT US权益”,,,,{'LAST_PRICE';'打开'})
d= LAST_PRICE: 33.3401 OPEN: 33.6000 sec = 'MSFT US Equity'

GetData返回结构d最后和开放价格。还,GetData返回安全性

Close the connection.

关闭(c)

首先,创建一个彭博桌面连接。这n, request data for specific fields for a security using an override field and value. The current data you see when running this code can differ from the output data here.

创建彭博连接。

c = blp;

另外,您可以使用blpsrv或使用彭博b-pipebpipe

Request data for Bloomberg fields'YLD_YTM_ASK',,,,'问',,,,and'oas_spread_ask'when the Bloomberg field'oas_vol_ask''14.000000'

[d,sec] = getData(c,'030096AF8 CORP',,,,。。。{'YLD_YTM_ASK',,,,'问',,,,'oas_spread_ask',,,,'oas_vol_ask'},。。。{'oas_vol_ask'},{'14.000000'})
d= YLD_YTM_ASK: 5.6763 ASK: 120.7500 OAS_SPREAD_ASK: 307.9824 OAS_VOL_ASK: 14 sec = '030096AF8 Corp'

GetData返回结构dwith the resulting values for the requested fields.

Close the connection.

关闭(c)

首先,创建一个彭博桌面连接。然后,使用CUSIP编号以进行安全要求。您在运行此代码时看到的当前数据可能与此处的输出数据不同。

创建彭博连接。

c = blp;

另外,您可以使用blpsrv或使用彭博b-pipebpipe

Request the last price for IBM®带有Cusip编号。

d= getData(C,,,,'/cusip/459200101',,,,'LAST_PRICE'
d= LAST_PRICE: 182.5100

GetData返回结构d最后一个价格。

Close the connection.

关闭(c)

首先,创建一个彭博桌面连接。这n, request the last price for a security. Specify the security using the CUSIP number with a pricing source. The current data you see when running this code can differ from the output data here.

创建彭博连接。

c = blp;

另外,您可以使用blpsrv或使用彭博b-pipebpipe

Specify IBM with the CUSIP number and the pricing sourceBGN之后@象征。

d= getData(C,,,,'/cusip/459200101@bgn',,,,'LAST_PRICE'
d= LAST_PRICE: 186.81

GetData返回结构d最后一个价格。

Close the connection.

关闭(c)

首先,创建一个彭博桌面连接。这n, request the constituent weights of an index using a date override. The current data you see when running this code can differ from the output data here.

创建彭博连接。

c = blp;

另外,您可以使用blpsrv或使用彭博b-pipebpipe

截至2010年1月1日,返回道琼斯指数的组成重量,使用所需的日期格式覆盖日期YYYYMMDD

d= getData(C,,,,'DJX索引',,,,'INDX_MWEIGHT',,,,'end_dt',,,,'20100101'
d= INDX_MWEIGHT: {{30x2 cell}}

GetData返回结构dwith a cell array where the first column is the index and the second column is the constituent weight.

Display the constituent weights for each index.

d.indx_mweight {1,1}
ans = 'AA UN' [1.1683] 'AXP UN' [2.9366] 'BA UN' [3.9229] 'BAC UN' [1.0914] ...

Close the connection.

关闭(c)

创建一个Bloomberg®连接,然后为特定字段请求当前数据。这GetData功能将日期的数据返回datetime大批。

创建彭博连接。

c = blp;

另外,您可以使用blpsrv或使用彭博b-pipe®使用bpipe

通过设置将数据作为表返回DataReturnFormat连接对象的属性。如果您不设置此属性,则GetDataFunction returns data as a structure.

返回日期datetimearray by setting theDatetimeType连接对象的属性。In this case, the table contains dates in variables that aredatetimearrays.

C。DataReturnFormat ='桌子';c.datetimetype ='datetime';

请求这些字段的当前数据:

  • 最后更新日期

  • 最后价格

  • Number of trades

  • 以前的实时交易日期

s ='IBM我们的权益';F= {'LAST_UPDATE_DT',,,,'LAST_PRICE',,,,。。。'num_trades_rt',,,,'PREV_TRADING_DT_REALTIME'}; d = getdata(c,s,f)
d = 1×4 table LAST_UPDATE_DT LAST_PRICE NUM_TRADES_RT PREV_TRADING_DT_REALTIME ____________________ __________ _____________ ________________________ 21-Dec-2017 00:00:00 152.2 24846 20-Dec-2017 00:00:00

显示最后更新日期。这个日期是datetime大批。

d。LAST_UPDATE_DT
ANS = DateTime 21-Dec-2017 00:00:00

关闭彭博连接。

关闭(c)

输入参数

全部收缩

彭博连接,指定为使用的连接对象blp,,,,blpsrv,,,,orbpipe

安全列表,为一个安全性或字符矢量的单元格数组或字符串数​​组的单元数组指定为多个证券的字符阵列。您可以按名称或CUSIP以及有或没有定价源指定安全性。

Data Types:char|细胞|string

彭博数据字段,指定为字符向量,字符串标量,字符矢量的单元格数量或字符串数​​组。字符向量或字符串表示一个彭博数据字段名称。字符向量或字符串数​​组的单元格数组表示多个彭博数据字段名称。有关您可以指定的字段的详细信息,请参阅彭博API开发人员指南使用wapi 彭博终端的选项。

Example:{'last_price';'open'}

Data Types:char|细胞|string

彭博社覆盖场,,,,specified as a character vector, string scalar, cell array of character vectors, or string array. A character vector or string denotes one Bloomberg override field name. A cell array of character vectors or string array denotes multiple Bloomberg override field names. For details about the fields you can specify, see the彭博API开发人员指南使用wapi 彭博终端的选项。

Example:'end_dt'

Data Types:char|细胞|string

彭博社覆盖场值,指定为字符向量,字符串标量,字符矢量的单元格数或字符串数​​组。字符向量或字符串表示一个彭博覆盖场值。字符向量或字符串阵列的单元格数组表示多个彭博覆盖字段值。使用此字段值过滤彭博数据结果集。

Example:'20100101'

Data Types:char|细胞|string

名称值参数

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN,,,,whereName是参数名称和Value是the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

Example:“回归”,是真的

权利标识符,指定为逗号分隔对'returnEids'和布尔人。true将权利标识符(EID)日期的名称和值添加到返回数据。

Data Types:逻辑

返回格式,指定为逗号分隔对'returnFormattedValue'和布尔人。trueForces all data to be returned as the data type character vector.

Data Types:逻辑

日期时间格式,指定为逗号分隔对'useUTCTime'和布尔人。true返回日期和时间值作为协调的通用时间(UTC)和错误的默认为彭博社tzdf settings of the requestor.

Data Types:逻辑

最新参考数据,指定为逗号分隔对,由'forceddelay'和布尔人。truereturns the latest data up to the delay period specified by the exchange for the security.

Data Types:逻辑

Output Arguments

全部收缩

彭博数据作为结构,表格或时间表返回。彭博数据的数据类型取决于DataReturnFormatandDatetimeTypeproperties of the connection object. For details about the data, see the彭博API开发人员指南使用wapi 彭博终端的选项。

安全列表,作为相应证券的字符向量的单元格数组返回s。内容的内容在价值和秩序上相同s。您可以使用以下任何标识符返回证券:

  • Buid

  • CINS

  • Common

  • Cusip

  • isin

  • sedol1

  • sedol2

  • sicovam

  • svm

  • 股票(default)

  • WPK

提示

  • Bloomberg V3 data supports additional name-value pair arguments. To access further information on these additional name-value pairs, see the彭博API开发人员指南使用wapi 彭博终端的选项。

  • You can check data and field availability by using the Bloomberg Excel®Add-In.

  • For a Bloomberg B-PIPE connection,d返回一个名为的其他字段开斋节开斋节意味着应享的标识符。有关详细信息,请参阅彭博API开发人员指南

版本历史记录

在R2010a中引入