Sie sind auf Seite 1von 44

Bloomberg API

Excel Download
Manual
About the Bloomberg Professional Service

Bloomberg was founded in 1981 with one core mission : to


bring transparency to capital markets through access to
information. Today’s Bloomberg - totaling more than 13,000
employees with 202 locations in 72 countries around the
globe – builds on that foundation.
Everything that we do connects decision markers in business,
finance and government to a broad and dynamic network of
global and local information, news, people and ideas that
enables faster, more effective decisions.

The Bloomberg professional service draws on our core


capabilities and sits at the center of our offerings, giving
information on every asset class - from fixed income to
equities, foreign exchange to commodities, derivatives to
mortgages - integrated in one place and delivered in real time
to your desktop or mobile device. Along with this robust
information set, you have access to all the news, analytics,
communications, charts, execution platforms, and customer
support you need to put knowledge into action.

2
Contents

04 Excel Toolbar
05 How to Install Excel Add-Ins
06 The Data Wizard
07 Data Wizard -What is it?-
08 Data Wizard -How to Access-
09 Data Wizard -Current Data-
12 Populate Table
13 Data Wizard -Bulk Data-
14 Data Wizard -Historical Data-
20 Data Wizard -Historical Intraday Data-
21 Data Wizard -Historical Tick Data-
22 The Bloomberg Excel Formula
23 The BDP Formula -Basics-
24 How to Search the Data Fields
26 The BDP Formula -Practice-
27 The BDH Formula -Basics-
28 The BDH Formula -Advanced-
32 The BDH Formula -Practice-
33 The BDS Formula -Basics-
34 Function Builder
35 Other Formulas
39 Error Codes
41 API Help Pages
42 Need Any Help?
43 Bloomberg

3
Excel Toolbar
The layout for Bloomberg Excel Add-In Toolbar (the API ribbon) has been newly upgraded to provide a better
and faster access to various functions.
This ribbon is grouped by different component functions.

Explore
You can use Data Navigation function to browse the Bloomberg data by category
and view our template libraries.

Import
You can use the Import function, the Data Wizard to import data to Excel.

Community
You can use the file manager to save the excel with data on the FILE<GO>
function.

Create
Functions in the Create group can be used to run a simulation using our
technical analysis functions, to build a Bloomberg formula, and to create
custom index.
Tools
Tools functions can be used to populate tables and edit the data in your
spreadsheet.

Format
You can adjust the spreadsheet format easily from the Format functions.

Export
By using the Export functions, you can export your Excel data to PowerPoint
and link the data to refresh. This function is only available for Bloomberg
Anywhere users.
Utilities
Using the Utilities functions, you can view our help page as well as access the 24
hour Bloomberg Live Help Desk. Moreover, from the Options tab, you can
access the option menus to customize your Bloomberg Add-Ins functions. 4
How to Install Excel Add-Ins
If you do not see the Bloomberg API ribbon in your Excel toolbar when opened from a terminal installed
PC, please try the following procedure.

1. Please completely close your Excel.

2. Windows Start menu >> All Programs >> Bloomberg >>


Please select “Install Excel Add-In”.
(Depending on the version, it may say “Install Office Add-In”
as well.)

3. After you see “Installing Bloomberg Add-Ins”, please select “Install”.

4. You will see a pop-up to indicate the completion of the installation. Please proceed by
choosing “OK”.

(If you continue to see the previous pop-up for


“Installing Bloomberg Add-Ins”, please select
Close.)

5. Please restart Excel and confirm the Bloomberg ribbon in your toolbar.

If and when the Bloomberg ribbon does not appear in your Excel toolbar, please do not
hesitate to reach out to the Bloomberg Help Desk by running <HELP><HELP>.
(Please also refer to P.43 for the Bloomberg help desk info)

5
The Data Wizard

6
Data Wizard -What is it?-
By using the Data Wizard, you can download the Bloomberg data easily with step by step
instructions.
There are mainly 4 types of Wizards.
Please see what data you can download by using each of the Wizards.

Main Types of Wizards


Download Examples

Real-Time Data & Bulk Last


Price
Data
Real-Time / Current
You can download data such as the
real-time/current data, the current
static data, and the security master Bulk Data :
All Dividend Data
data.

Historical Data Daily historical data


Historical End of Day

You can download the historical data for a


chosen period and frequency (daily, weekly,
monthly, quarterly and yearly).

Historical Intraday Data Intraday data on a specific interval


Historical Intraday Bars

You can download the historical intraday data.


The smallest interval size you can set is 1 minute.
You can download the Open, High, Close, and
Volume data of Bid/Ask/Trade for a chosen
interval size.

Historical Intraday Tick Data Tick Data


Historical Intraday Ticks

You can download the tick data for a chosen


period.

7
Data Wizard -How to Access-
Launching the Data Wizard
For versions later than Excel 2007, please click on “Import Data” on your Bloomberg toolbar. You
can choose from 4 Wizards to download current/historical data.
This function is part of the Import group.

Launching the Data Wizard


Please click on “Import Data” on your Bloomberg toolbar. You will see a pop-up with 4 options of
Wizard to choose from.

Activate the Wizard


Click on the “Data Wizard” in the Bloomberg tab
on your Excel.
The Wizard will launch as a new window.
Click on one of the 4 types of Wizards.

8
Data Wizard -Current Data-
Launch 「Data Wizard」→
「Real Time / Current」

The Data Wizard 1/3 Create a List of Securities


On this page, you will select a security you would like to download the data for.
For an individual security selection, please use the “Enter Security” option. For a bulk selection
from a security list, please use the “Select Securities” option.

To Enter an Individual Security…


1. Enter a ticker code in the “Security Identifier”
field.
2. Select a sector from the “Market Sector”
drop down. You can also select a sector by
using the yellow sector key on your Bloomberg You can re-order the
keyboard. selected securities by
drag & dropping them.
3. Click on “Add”. Confirm the security is
added to the “Selected Securities”.

To Enter Securities in Bulk from an Equity


Index, Portfolio, and Launchpad…
1. “From” drop down, select the location of your
saved securities.
2. “Saved Lists” drop down, specify which
security list you would like to use.
3. Confirm the securities are listed in “Available
Securities”. Select a security and click on “Add”,
or simple click on “Add all”.

If you use the “Drag and Drop” icon on the


If you have a security list ready in your Excel upper right side of the Bloomberg screen,
sheet, you can drag and drop the list directly you can bulk save the shown securities
into the “Selected Securities” box. into the “Selected Securities” box.

9
Data Wizard -Current Data-
The Data Wizard 2/3 Create a List of Fields
On this page, you will search and select the data field you would like to download.

1. Choosing from Categories


Search for a data field to download the
current market price.
You can narrow down the search from a
larger category to a smaller one. Select a
specific field, such as LAST_PRICE, you will
see its definition below.

2. Searching by Keywords

You can run the search in


English and other various
foreign languages.

If you see under the “Type” field, it indicates that the field can be
used to download real-time data.
When you use a real-time field, the data in Excel will update
automatically.

You can use the “Filter” drop-down to narrow down the asset-class
and the field type of a data field.
For example, if you only choose “Real Time” as the field type, you will
only see the real-time data fields. It will give you an easy access to
the necessary data fields.

10
Data Wizard -Current Data-
The Data Wizard 3/3 Set Layout Options
On this page, you can set where and how you would like to layout your data.

You can check the image of the


download format beforehand from
the preview screen.

Settings
Data Placement Existing worksheet: You can download to the data to a cell of your
option.
New Worksheet: You can download to a new spreadsheet.
Show Labels You can set to show or hide security, field, date and etc.

Field Orientation You can set to show the historical dates horizontally or vertically.

Multiple Sheets You can set to add a new sheet per 1 security when you download
multiple securities.
Time Ordering You can set the dates to show chronologically or reverse
chronologically.
Data Set Aggregation You can set to aggregate the downloaded data in a single cell.

Error Substitution You can set to substitute errors with an alternative word/sign.
After you complete the above procedures, please click on “Finish” and you can download the
data.
Example

11
Populate Table
Populate Table is a function for you to download the current data without using the Data
Wizard.
You can layout the security code and the data field on a spread sheet and complete the
data download in one click.

Steps
Align the data fields from Left to Right
1. Layout a ticker code and a data field.
If you wish to layout multiple security Data Fields
codes, please do so vertically.
Also, please manually enter the sector

Security Tickers
code as well.

Market Sector Code


Soverign Govt Equities Equity
Credit Corp Commodities Comdty
Mortgages Mtge Indices Index
Municipals Muni Currency Curncy
Preferreds Pfd

2. Click on a cell above the ticker code.

3. Click on …

When you click on populate


table, the Bloomberg formulas
will automatically populate in
the selected cells and download
the necessary data.

When you use this function, please enter the security codes in the same columns and the data
fields in the same row.

12
Data Wizard -Bulk Data-
The import data wizards allow you to import data for a specified group of securities such as:
・Index Members (Bloomberg Terminal Function MEMB<GO>)
・Future Cash Flow Analysis for Bonds (CSHF<GO>)
・Dividend/Split Summary for Stocks(DVD<GO>)
・Security Description (DES<GO>) etc.

Launch
From the Data Wizard click in the Market, Reference, Analytical, Data Sets Icon
From the Bloomberg ribbon, click the Import Data button, then select Real-Time/Historical >
Real-Time/Current.
Steps
1. Choose your securities 2. Choose the fields that supply
the data you want to import
Enter the ticker for
S&P500 Index :
SPX Index

3. Set Layout options To search for and add fields, in the


Search Text field, enter a keyword
Update the layout or partial word.
options, then click Enter “Member” and add the field
the “Finish” button. “INDX MEMBERS” from the List.

Example

You can create a ticker code by adding a sector


code to the ticker codes we bulk downloaded from
Data Wizard.
Refer to cell B3 for further details.

13
Data Wizard -Historical Data-
Launch 「Data Wizard」→
「Historical End of Day」

Historical Data 1/6 Create a list of Securities

Adding Single Securities:


1. In the [Enter Security] section, add the security
ticker code
2. In [Market Sector] select the asset class of the
security, corresponding to the appropriate yellow key
You can edit the order
on your Bloomberg keyboard or select the sector of the selected
from your keyboard. securities by dragging
3. Click “Add” to load the security under “Selected & dropping.
Securities:”

Adding Security Lists


(For Indices, Portfolio, Security Monitors):
1. In the Select Securities section, select a security
source from the From drop-down menu.
2. Specify the list: If a second menu appears, select
a specific list or index.
3. If the Available Securities section appears, select
securities within the list and click the “Add” button.

Dragging Securities:
1. Select the cells within the spreadsheet that
contain the identifiers of the securities you From the Bloomberg Main Panel, you can
want to add. use the “Drag & Drop” icon to load the
2. Drag the selected cells into the Selected securities loaded in the main panel to excel.
Securities section.

14
Data Wizard -Historical Data-
Historical Data 2/6 Browsing Fields
The import data wizards allow you to import data for a specified group of securities. You can select
one or more values on each screen of the wizard.
There are two ways

1. Browsing Fields
How to browse for a Data Field that pulls the Last Price:

Select the Categories tab.


The tab lists all available data field categories
for the securit(ies) you entered on the previous
step of the import data wizard.
Click into a Data Field (e.g. PX_LAST) to
display the definition.

2. Searching for Fields

In the Search Text field, enter a full or partial


keyword.

You can search for fields by field name (for


example, "ask price") or mnemonic (for
example, "ASW"). You can also search for
multiple fields by using a partial word (for
example, "price" or "PX").

You can use the “Filter” drop-down to narrow down the asset-class
and the field type of a data field.

Note: The Asset Classes that appear in the drop-down menu


reflect the securities you entered on the previous screen of the
import data wizard. For example, if you selected a <Corp> and an
<Equity>, the Corp and Equity filter options appear on the menu.
15
Data Wizard -Historical Data-
Historical Data 3/6 Select Periodicity and Time Frame
Frame screen of the wizard, you can select to import data in intervals between a specific start and
end time.
On this page, you will set the periodicity, calendar type, date format and time frame for the data
series you would like to download.

Settings

Periodicity 1 .Calendar Type:


Fiscal
Calendar
Actual
2. Periodicity
Yearly, Semi-Annual, Quarterly,
Monthly, Weekly, Daily
3. Date Format:
Date
Periodic
Both
4. Calendar Code:
You can select from a various calendar selection including national calendars.

Time Frame 1. Fixed Time Series


Date : Select a start/end date
Period : Select a year and a start/end Fundamental Period

2. Relative Time Series


Select a fixed date and set the “Number Of Periods” field wit the number of periods
back from the “End Date”.

If you select Current as the end date, the current


date and time is selected as the ending date. The
formula updates the end date and time to the new
current date and time each time you open the
spreadsheet.
16
Data Wizard -Historical Data-
Historical Data 4/6 Set History Parameters

Settings

Currency Set the currency.

Non-trading Exclude :Exclude all non-trading days.


Days Include all non trading weekdays :Include all weekdays in your imported data.
Include all calendar days:Include all calendar days in your imported data, including
non-trading weekdays and weekends.
*If applicable, in the Non-Trading Days section, select a Filler Value for Non-Trading.
Intervals to specify a value that appears in the imported data for intervals in which no
trading occurred.

If you want to scale the imported data by a specific factor, in the Scaling Factor
Scaling Factor
section, enter a value by which to scale all of the imported data.

Quote Select a Quote type to select the format for price quotes for fixed income securities
(yield quoted Yield: When importing historical prices, historical yields are imported.
securities only) Price: When importing historical prices, historical prices are imported.

Closing Price :The values at the close of each period appear


Calculation
Quote GPA: The average daily values for each period appear

Specify Max Specify the maximum number of data points to download within your selected time
# of Point period.
17
Data Wizard -Historical Data-
Historical Data 5/6 Set Pricing Defaults

Settings

A Follow DPDF Settings By clicking “Yes” the formula uses the same pricing
defaults for distributions as those set on your Dividend &
Corporate Action Settings (DPDF) function.

B Applicable when A is set Further customize what sort of corporate actions to


to NO apply to your formula (Including Cash Adjustment
Normal, Cash Adjustments Abnormal, Capital
Changes)

18
Data Wizard -Historical Data-
Historical Data 6/6 Set Layout Options

The Set Layout Options screen that


appears at the end of the import data
wizards allows you to arrange the data
that you import. The options that are
available depend on the specific
wizard you are using and the choices
you have made on the wizard.

Set Layout Options

Data Placement Existing Worksheet: Adds the formula created by the wizard to an
existing spreadsheet and imports the data.
New Worksheet: Creates a new worksheet, adds the formula to the
new worksheet, and imports the data.
Show Labels Allows you to select a formula component to show headings
corresponding to that component on the spreadsheet.

Field Orientation Select the arrangement of securities and data fields on the
spreadsheet, which affects the layout of data when multiple securities
and/or data fields have been added to the wizard.

Multi-Sheet Available when you have added multiple securities to the wizard.

Time Ordering Available when you are importing historical data. Allows you to select
the order in which the data is imported.

Then click into “Finish”.

19
Data Wizard -Historical Intraday Data-
The Historical Intraday Bars wizard lets you retrieve intraday data in specific increments of minutes over
a selected period of time. Data such as open, high, low, close, and volume for each security can be
retrieved for bid, ask, or trade events.

Launch
「Data Wizard」→
「Historical Intraday Bars」

Steps
「1/4 Create a list of Securities」 Add
securities in the same steps as for current
and historical data. (Enter them manually,
from a list, or drag & drop.)

「2/4 Set Intraday Parameters」 Set the


market events, interval fields, time frame.

「3/4 Set Pricing Defaults」Choose to follow or


not follow DPDF settings.

「4/4 Set Layout Options」 Update the layout


options.

Then click the “Finish” button.

Download Example

20
Data Wizard -Historical Tick Data-
The Historical Intraday Ticks wizard allows you to import raw intraday data from the exchange for one or
more securities over a specific period of time. The tick data you import is based on bid, ask, or trade
events.

Launch
「Data Wizard」→
「Historical Intraday Ticks 」

Steps
「1/4 Create a list of Securities」 Add
securities in the same steps as for current
and historical data. (Enter them manually,
from a list, or drag & drop.)

「2/4 Set Intraday Parameters」 Set the


intraday action, time frame, and intraday raw
options.

「3/4 Set Pricing Defaults」Choose to follow or


not follow DPDF settings.

「4/4 Set Layout Options」 Update the layout


options.

Then click the “Finish” button.

Download Example

21
The Bloomberg Excel Formula

22
The BDP Formula

The BDP
The BDP is a formula to import current data.
This allows you to import a single data point of current or continuously updating, real-
time data to a single cell in your Excel spreadsheet.

=BDP(Security Ticker, Data Field, *[option parameter(s)])


Example =BDP(“INDU Index”, “PX LAST”)
The BDP Formula: Details
Ticker Security code. Please use a valid Bloomberg security identifier.
Also, make sure to add the market sector codes(Govt, Equity, Curncy etc).

Data Field The type of data you would like to import.


You can search for the data fields in FLDS<GO> on the terminal.
Please see page 25-26 for details on how to search the data fields.
Optional Parameter Adjusts the imported data.
Please refer to the bottom of the page for details on the optional parameters.
*You may omit the optional parameters.

When manually entering the arguments such as tickers and data fields, please make sure to
add the quotation marks “”.
Eg: =BDP(“INDU Index”, “Last Price”)

You can also cell reference each arguments.


Please see cell A4 in the example on the right.
In this case, the quotation marks are unnecessary.

Details of the Optional Parameters


You may use the following options for the BDP formula.

Optional Parameter Description


Fill If the BDP returns #N/A N/A error, you can replace it with a specified filler.
B : Imports a blank cell
Any other value is used literally as a filler.

UpdFreq, or Applies to real-time data fields.


UpdateFrequency You can set the update frequency to milliseconds.
The minimum update frequency is 300 milliseconds by default
You can expand the frequency in increments of 100.

●Optional Parameters are entered as follows


Ticker code Data field Optional Parameter
=BDP(“IBM US Equity","BEST_OPP","Fill=B")
23
How to Search the Data Fields
FLDS<GO> 【Data Field Search】

FLDS provides information on the data fields for each security available.
You can search for the data fields while confirming the values on the value column.
Run Ticker code + FLDS<GO> to search for the available data fields for a specific security.

You can also add keywords after the FLDS as follows.


Eg) IBM US <Equity> FLDS VWAP<GO>
Displays the data
Search data fields by fields in
frequently-used Filter by asset class Select the data type
entering keywords
order

Displays the data field that Shows a brief Displays the value
you can use in Excel definition of which you can
the data field download in Excel

If you click on the data field, it will show you the


detailed definition.
Tick the Ovrd box and enter the codes to override the
value you would like to download.

The drag & drop feature


Select the “value” with your cursor and drag & drop the
value to pull the data as well as the formula.

24
How to Search the Data Fields
“Bloomberg Field Search”

Select a cell and click on the magnifying glass icon.

The “Bloomberg Field Search” wizard will launch.

In the “Search text” column, enter


keywords to search for data fields.
Once you find the data field, click
on the “Add” button.
The selected field will show on the
right hand side.
Click on the “Apply” button to enter
the field into the cell.

You can add frequently-used data fields into the Selected fields section>> “Add To
Favorites” to save in a file.
Onwards, you can just select the field from the “Favorites” tab.

S This icon under “Type” indicates that the field is real-time.

25
The BDP Formula
Try creating the screen on WEI<GO> using the BDP formula.

Step1. Enter the ticker onto Excel. You can easily extract the tickers by drag &
dropping the push pin at the upper right of the screen to Excel.

The push pin can be seen on many


BBG screens and it allows you to drag
& drop the tickers to Excel.
There are two types of push pins.

Extracts all the tickers on the


screen. It is located at the upper
right.

Step 2. Enter the data field.


Let’s look up the fields for the company name and the live streaming last prices
Search these fields from the “Find Fields” option or on the Bloomberg panel,
enter Ticker code + FLDS<GO>

Step 3. Enter the BDP formula

Cell reference the ticker codes


and the data field using the
=BDP formula

The absolute cell reference is


useful in copying the formulas.

26
The BDH Formula

The BDH
The BDH formula allows you to pull historical data.

=BDH(Security Ticker, Data Field, Start Date, End Date, *[Options])


Example =BDH(“INDU Index”, “PX LAST”, “2013/1/1”, “2013/5/31”)
Pulls the last price of Dow Jones from 2013/01/01 to 2013/05/31.

The BDH formula: Details


Ticker Security Code. Use the security code available on the Bloomberg terminal.
Data Field The mnemonic of the data type you would like to download
The start date of the series of data. Use the date format on Excel or enter in
Start Date
YYYYMMDD format
You can specify a Fiscal/Relative Date.
See page 28 for more details.

End Date The end date of the series of data.


Enter a date after the start date. Note that you cannot enter a future date.
You can specify a Fiscal/Relative Date.
Leave the end date blank to pull up to the latest data.
=BDH(“INDU Index”, “PX LAST”, “2013/5/1”, “”) Use the “” to set up a blank date.
Optional Option to adjust the data. You can omit this parameter if not necessary.
Parameter

●As with the BDP, you can cell reference each arguments of the formula.
●Adding optional parameters allows you to download in various format. For more details, please see
the next page onwards.

To specify a particular date, construct the formula as follows.

=BDH(Ticker, Data Field, Date)

Example =BDH(“INDU Index”, “PX LAST”, “2013/5/15”)


Downloads the last price of Dow Jones on 2013/05/15.

27
The BDH Formula
Besides using a start date and an end date, you can use “Fiscal /Relative Dates”.

Specifying the start / end date with a “Fiscal Period”

Combining the fiscal year and


quarters together allows you to specify
a fiscal period.

For example, FQ4 2011 specifies year 2011 fiscal quarter 4.

=BDH(“IBM US Equity”, “SALES REV TURN”, “FQ4 2011”, “”)


This downloads the sales value from year 2011 fiscal quarter 4 till today.

Specifying the start / end date with a “Relative Period”


Start Date Relative to today Goes back for a calendar period, fiscal period or actual period relative to today.

-FQ indicates that the start date is the most recent fiscal quarter prior to today.
-15AM indicates that the start date is 15 actual months prior to today.
-5AD indicates that the start date is 5 actual days prior to today.
Eg:=BDH(“IBM US EQUITY","PX_LAST","-5AD","")
Relative to an end date ED-1AY indicates a start date that is one actual year before the end date.
(ED) ED-5CD indicates a start date that is 5 calendar days before the end date.

Eg:=BDH("EUR CURNCY","PX LAST","ED-1AY"," 1/6/2007")


Relative to a specific CQ4 2000+6CQ indicates a start date that is six calendar quarters after calendar
calendar, fiscal, or actual quarter 4 of 2000.
period
Eg:=BDH("EUR CURNCY","PX LAST","CQ4 2000+6CQ","")
Relative to a specific date 19990122-6CQ indicates a start date six calendar quarters before January 22,
1999.
Date must be in “YYYYMMDD” format.
Eg:=BDH("EUR CURNCY","PX LAST","19990122-6CQ ","")
End Date Relative to today The number of periods going back relative to today.
-4FQ indicates that the end date is four fiscal quarters ago.

Eg:=BDH(“IBM US EQUITY","SALES_REV_TURN","12/31/02","-4FQ")
Relative to a start date SD+6CQ indicates that the end date is six calendar quarters after the start date.
(SD)
Eg:=BDH(“IBM USEQUITY","SALES_REV_TURN","12/31/02","SD+6CQ")
Relative to a specific CQ4 2003-6CQ indicates that the end date is six calendar quarters before the
calendar, fiscal, or actual fourth calendar quarter of 2003.
period
Eg:=BDH("EUR CURNCY","PX_LAST","12/31/02",“CQ4 2003-6CQ")
Relative to a specific date 19990101+6CQ indicates that the end date is six calendar quarters after January
1, 1999. Date must be in “YYYYMMDD” format.

Eg:=BDH("IBM US EQUITY","PX_LAST","12/31/97","19990101+6CQ")

28
The BDH Formula
Details of Optional Parameters
The below are the available options for the BDH formula.
Optional Parameters Description
CDR Indicates that the end fate is size calendar quarters after the start date. Valid entries are
Bloomberg two-letter calendar codes. For a full list of calendar codes, see CDR <GO>. You can
specify multiple calendar codes. The CDR parameter is only valid for daily periodicity.

Eg:=BDH(“IBM US Equity”,“PX LAST”, “2013/4/1”,“2013/4/30”,“CDR=US”)


Returns the trading days excluding the weekends and holidays in the United States.

To specify multiple countries, for example, CDR=JN&US excludes holidays for both of the
countries and CDR=JN|US will exclude the holidays that overlap between the two countries.
When there is no data on a trading day, you can use the Fill option to specify the filler value.
It will return the most recent data if the Fill option is not used.

Curr Downloads the value in the specified currency.


Please use the ISO codes(the three letter codes to display currency)
FX Example : "Curr=USD"
This cannot be used for intraday data.

Days Allows you to exclude or include non-trading days in the imported data (i.e., days when no data is
available).
Valid values include:
T : Omits all non-trading days
N , W : All weekdays
C , A : All calendar days
The default is set to T (only displays the days with data)
Related Options : If you use the “Fill” option at the same time, you can specify what to fill in the
non- trading dates.

Dts Allows you to show or hide the dates for the historical time series
H , Hide or False : Hides the dates
S , Show or True : Shows the dates
The default value is “Show” (show the dates)

Fill The filler value for non-trading days.


If the Days parameter is set to display weekdays or all calendar days, then the Fill parameter
allows you to specify the data or text that appears for any non-trading days.

C , P or Previous : Imports the last available data


N , E or Error : Returns an error message
B or Blank : Imports a blank cell
Custom Option : Specify the value that shows for a non-trading day.
Eg:"Fill=No Data" imports “No Data” in the cell for a non-trading day.
Dir Allows you to choose the direction for the historical time series.
H : Horizontal V : Vertical
The default value is "Vertical".

Per Allows you to set the interval within a fixed period of time for the imported data.
The base periods are: D: Daily, W: Weekly, M: Monthly, Q: Quarterly, Y: Yearly

The Calendar (C), Fiscal (F), or Actual (A) modifiers allow you to choose a calendar type for the
periods. The modifier should precede the base period. F can only be used with Q, S, and Y.
Calendar Type: C (Calender), F (Fiscal), A (Actual)
Period Type:D(Day), W(Week), M(Month), Q(Quarter),Y(Year), S(Semi-Annual)
Actual Period (AD、 AW、 AM、 AQ、 AS、 AY)
Calendar Period (CD 、 CW 、 CM 、 CQ 、 CS 、 CY)
Fiscal Period (FQ 、 FS 、 FY)

Eg:=BDH(“IBM US Equity","SALES_REV_TURN","FY2010","","PER=FY")
Returns the revenue of Sony from fiscal year 2010 to today on a fiscal year basis. 29
The BDH Formula
Details of Optional Parameters (2)

Optional Parameter Description


Points The number of data points to download from the end date.

Eg:=BDH(“INDU Index", "PX LAST", "2013/1/1","", "Per=M","Points=1")


As the period is specified as monthly, it returns the most recent monthly end value.

QtTyp For fixed income securities quoted in yield, allows you to select the format for price quotes when
using data fields like "PX LAST”
P or Price : Price
Y or Yield : Yield
Quote Allows you to select the values that appear for historical imported data when the selected Period
parameter is set to weekly or greater.

PX_LAST、PX_OPEN、PX_HIGH、PX_LOW、PX_BID、PX_ASK

A , G or Average : The daily average values for each period are imported.
C or Close : The values at the close of each period are imported.

The default value is "Close".

Eg:=BDH(“INDU Index","PX LAST", "2012/1/1", "2012/12/31", "Per=M", "Quote=A")


Returns the monthly average value of the closing prices of Nikkei for year 2012.

UseDPDF Indicates whether the formula uses the same pricing defaults for distributions as those set on
your Dividend & Corporate Action Settings (DPDF) function.

Y or Yes : Applies the DPDF setting


N or No : Does not apply the DPDF setting

If set to “No”, you can use the following options.


CapChg, CshAdjAbnormal, CshAdjNormal

CapChg Reflects the impact of the following actions for historical prices,
Spin-Offs, Stock splits/Consolidations, Stock Dividend/Bonus, Rights Offerings/Entitlement.

Y or Yes : Adjusted
N or No : Not adjusted

CshAdjAbnormal Indicates that historical pricing and/or volume is adjusted to reflect Special Cash, Liquidation,
Capital Gains, Long-Term Capital Gains, Short-Term Capital Gains, Memorial, Return of Capital,
Rights Redemption, Miscellaneous, Return Premium, Preferred Rights Redemption,
Proceeds/Rights, Proceeds/Shares, Proceeds/Warrants

Y or Yes : Adjusted
N or No : Not adjusted

CshAdjNormal Indicates that historical pricing and/or volume is adjusted to reflect Regular Cash, Interim, 1st
Interim, 2nd Interim, 3rd Interim, 4th Interim, 5th Interim, Income, Estimated, Partnership
Distribution, Final, Interest on Capital, Distribution, Prorated.

Y or Yes : Adjust
N or No : Not adjusted

30
The BDH formula
Details of Optional Parameters (3)

Options for Intraday data


BarSz Allows you to set the interval size of the intraday data to import.
Valid values include whole numbers between 1 and 1440, which represent minutes.
The default value is "1" (one minute), which is the lowest level of granularity possible.

BarTp Allows you to specify the market event for which you want to import intraday data.

B or Bid : Bid
A or Ask : Ask
T or Trade : Trades

Sort Allows you to sort the data by time or dates.


Valid values include:

C or A, Chronological: Sorts the data from earliest to most recent data.


R or D, Reverse: Sorts the data from most recent to earliest data.

TimeZone Allows you to define the timezone for the data.


TZ
Valid values include:
City : The city that represents the desired timezone. For example, "New York". This entry form
adjusts for Daylight Savings Time.
Offset from GMT : For the selected timezone, offsets the time from Greenwich Mean Time (GMT) in
the range of +/- 12 hours. The format is u +/- N. For example, "u-5" offsets the time from GMT to
correspond with New York. This entry form does not adjust for Daylight Savings Time.

Options for Intraday Tick Data


IntrRw Allows you to turn on intraday ticks.
Valid values include "True" or “False".

For example, "IntrRw=True".


The default value is "False".
CondCodes Displays the following for each tick:
Condition codes
ExchCode
Exchange codes
BrkrCodes Broker codes

S: Shows the data, H: Hides the data.

After downloading data, another option such as “cols=7;rows=5” will automatically be added to the end of
the formula. This cannot be adjusted.

31
The BDH formula Examples
=BDH(“INDU Index”, “PX LAST”, “2016/11/21”, “2016/11/25”)

Imports the closing price of Dow Jones from May 1st, 2013 to May 10th, 2013 using only 4
parameters - the minimum required options.
PX LAST is the field to download the closing price, however during market hours, it will
download the latest price.

=BDH(“INDU Index”, “PX LAST”, “2016/11/21”, “2016/11/25”, “Days=W”)

“Days=W” will download all weekdays from Monday to Tuesday regardless of holidays.
Days that do not have data will fill in the previous close by default. The “Fill” option allows you
to specify what to fill in those cells without data such as filling them blank or entering letters.

=BDH(“INDU Index”, “PX LAST”, “2016/11/21”, “2016/11/25”, “Days=W”, “Dts=H”)


Added another option “Dts=H” (hides the dates). The dates on the left column will disappear, and
will only display the data. This is useful when importing multiple data.

:Formula to download INDU Index


along with the dates.
:Formulas to download SPX Index
and NKY Index without the dates.

=BDH(“INDU Index”, “PX LAST”, “2016/11/21”, “2016/11/25”, “Days=W”, “Dts=H”, “Fill=B”)


Added another option “Fill=B” to fill in blank for the non-trading days(holidays).
As described above, Dts=H is used for SPX and NKY so as not to show the dates.

=BDH(“IBM US Equity”,”SALES REV TURN”, “FQ1 2012”, “”, “PER=FQ”, “Dir=H”)


Downloads the revenue of IBM from the first quarter of year 2012 till today, quarterly, in a horizontal
direction.

The formula inside the yellow cell A7 is


=BDH(A1,A2,A3,“”,A4,A5)

32
The BDS Formula
The BDS formula allows you to pull bulk data - multi-cell, descriptive data for a
The BDS selected security.

=BDS (Security Ticker, Data Field, *[Options])

Example =BDS(“NKY Index”, “INDX MEMBERS”)

The BDS formula: Details


Ticker Security Code. Use the security code available on the Bloomberg terminal.
Data Field The mnemonic of the data type you would like to download.
Optional Option to adjust the data.
Parameter You can omit this parameter if not necessary.

The BDS formula: Details of Optional Parameters


Optional Parameter Description
Dir or Direction Allows you to choose the manner in which data from the formula is
arranged on your spreadsheet.
H/Horizontal
V/Vertical
The default value is "Vertical".
Aggregate Allows you to aggregate the imported data into a single cell on your
spreadsheet.
Y (“Yes”)
N(“No”)
The default value is "No”.
Headers Allows you to display column headers for the imported data.
Y (“Yes”)
N(“No”)
The default value is "No".
This is used to show headers of the items when downloading bulk data
such as DVD_HIST(dividend history).

The BDS Formula Examples


Ticker Code Data Field
=BDS(“IBM US Equity”,“CIE_DES_BULK“)

Returns the data in


one cell
Ticker Code Data Field Optional Parameter
=BDS(“IBM US Equity”,“CIE_DES_BULK", "Aggregate=Y”)

33
Function Builder
The Function Builder helps you create Bloomberg API formulas (aka "functions"), so you can download
data from the BLOOMBERG PROFESSIONAL® service to Microsoft® Excel without prior knowledge of
Bloomberg API syntax.
Method 1

Click into

You can use keywords to search for the


type of formula you want to create.
Autocomplete functionality for securities,
data fields, and optional parameters
provides suggested options based on the
characters you enter.

Method 2

On your spreadsheet, select the cell


where you want to place the formula
and input a formula such as =BDH().
At the top of Excel, click the fx button.
The Function Arguments window will
appear.

Function Arguments

The Function Arguments assists you


in building formulas on excel.

If the Option field names appear as


blue links on the Function Arguments
window, you can click a link to select
optional parameters from a menu
instead of manually entering the
optional parameter.

34
Other Formulas

BAddPeriods
The BAddPeriods formula is used to import unknown dates based on a known date, a specified
number of periods, and additional parameters, such as day count convention. You can import a single
date or a time series of dates.
Note: This formula is based on a default Monday-Friday trading week; however, alternative non-
working days can be provided.
=BAddPeriods (Start Date, Per, NumberOfPeriods, BusDayAdj, Calendar, EOM, WED3,
NonWorkingDays)
Optional Paramter Description ・ Valid Entries
Per The interval of time for each period.
y(Year), s(Semiannaul), q(Quarter) ,m(Month) ,w(Week) ,wd(Workday) ,d(Day)

NumberOfPeriods The number of intervals you want to look forward or backward. A positive number indicates you
want to import a date in the future. A negative indicates you want to import a date in the past.
The default value is 0.

BusDayAdj The Business Day Adjustment type, which indicates if the imported date is moved if it falls on a
non-business day.
0 (No Adjustment), -1 (Ahead), -2 (Modified Following), 1 (Back), 2 (Modified Preceding)

CDR, Calendar The calendar(s) used to determine non-working days when calculating the date to import. Valid
entries are Bloomberg two-letter calendar codes. For a full list of calendar codes, see CDR <GO>.
(Select up to 10 calendars)

EOM Determines whether the date result should be the last (working) day of the month or not.
0 (No Adjustmnet) , -1 (Forces the impoted date to be ateh) ,
1 (Forces the imported date to be the last (working) day of the month only if the StartDate itself is
the last (working) day of the month and the Periodicity is m, q, or y)

Wed3 Determines whether the date result should be the third Wednesday of the month or not.
TRUE or FALSE.
If the Wed3 result falls onto a non-business day, the imported date is determined by the
BusDayAdj setting. Default value is FALSE.

NonWorkingDays A list of non-working days used when calculating the date to import.
Mon, Tue, Wed, Thu, Fri, Sat, and Sun. Each entry is separated by a space.

BAddPeriods Examples
e.g.)
Imports the date 09/05/2012, i.e., 10 buinessdays backwards from 9/20/2012 according to the US and
JN calendar.
=BAddPeriods("2012/9/20","NumberOfPeriods=-10","Per=wd","CDR=US JN")

e.g.)
Imports the dates of all business days according to the US calendar between 5/1/2016 and 5/12/2016.
The dates are arranged horizontally.
=BAddPeriods("5/1/2016", "Per=wd", "CDR=US", "enddate=5/12/2016", "Dir=h")
35
Other Formulas

BCountPeriods
The BCountPeriods formula imports the number of periods between a start date and an end date for a
specific calendar. You can specify a variety of parameters to control the count, such as the day count basis
and days to include.

=BCountPeriods (Start Date, End Date, Per, DCB, Calendar, NonWorkingDays)


Optional Paramter Description ・ Valid Entries
Per The interval to count.
y(Year), wd (Workday) ,d (Day)

DCB The day count basis to use. DCB applies only to Per entries of "d" or "y".
ICMA_AA (ICMA-ACT/ACT)
A365 (ACT/365)
A360 (ACT/360)
30360 (30/360
For example, "DCB=A365".

If DCB is not specified, no day count convention is used, and the function returns the actual
number of periods between two dates.

CDR, Calendar The calendar used to determine non-working days when calculating the date to import.
Valid entries are a single Bloomberg two-letter calendar code.
For example, "CDR=US" specifies the United States calendar.
For a full list of calendar codes, see CDR <GO>.
The default value is " ", which indicates no holidays are accounted for.

NonWorkingDays A list of non-working days used when calculating the date to import.
Mon, Tue, Wed, Thur, Fri, Sat, and Sun.
Each entry is separated by a space.

BCountPeriods *for downloading

e.g.)
Imports the number 30, which is the number of days between 04/01/2009 and 05/01/2009 according to
the A360 day count basis.
=BCountPeriods("04/01/2009","05/01/2009","Per=d", "DCB=A360")

36
Other Formulas

Binterpol
BInterpol allows you to interpolate a point based on a set of data that you specify.

= BInterpol(XValues, YValues, InterpolationPoint, Type, [Extrapolate], [optional


paramter(s)]
Syntax Description・ Valid Entries
XValues The set of custom X values. These values must be in ascending order and unique.
The maximum number of XValues is 300 for cubic interpolation. There is no limit for linear
interpolation.
YValues The set of custom Y values corresponding to each X value.
There must be the same number of YValues as there are Xvalues.
The maximum number of YValues is 300 for cubic interpolation. There is no limit for linear
interpolation.

InterpolationPoint The X value for which to interpolate a corresponding Y value, using the type of interpolation
specified with the Type parameter.

Type The method used to interpolate the value.


Currently there are two types of interpolation available:

Linear :Returns an interpolated result from a straight line joining the two points in the set of user-
input data that bracket the interpolation point.
Cubic :Returns an interpolated result from a curve fitted to the set of user-input data using a
piecewise cubic spline.

Optional Paramter Description ・ Valid Entries


MultiX Allows you to aggregate repeated XValues and create a new corresponding YValue.
Error: Returns an "#N/A Repeat" error when there are repeated XValues in the array.
Average: Generates an average of the YValues for the repeated XValue, then interpolates over
the new array.
Median: Generates a median for the YValues for the repeated XValue, then interpolates over the
new array.
Min: Takes the minimum YValue for the repeated XValue, then interpolates over the new array.
Max: Takes the maximum YValue for the repeated XValue, then interpolates over the new array.

Skip Allows you to specify how to handle missing or non-numerical YValues and/or XValues.
If you set the Skip value, then empty cells are ignored.
True: Skips the missing/non-numerical values, generates a new array using the valid pairs of
XValues and YValues, and interpolates over this array.
False: Returns an "#N/A Invalid Parameter" error if any data points are invalid.

Sort Allows you to sort the data set based on the XValues. The sort transformation is performed
before the interpolation occurs.
True: Sorts the values automatically.
False: Returns an "#N/A Sort" error when the values are not sorted properly.

Transform Allows you to transform the data using pre-defined transformations when you want your data to
be interpolated in a non-linear basis.
Linear: Interpolates using the raw data provided.
Log10: Transforms all the data to a LOG10 basis, interpolates over the new data, and transforms
the data back to linear.
Log: Transforms all the data to a LOG(exp) basis, interpolates over the new data, and transforms
the data back to linear. 37
Other Formulas

BPGE
The Bloomberg Page Based Data (BPGE) formula imports data for monitors contributed to Bloomberg. The
monitors are imported to your spreadsheet in real-time.
Valid for such page : BBAM1<GO>

=BPGE(TopicID, Optional Paramter)


Syntax Description・ Valid Entries
TopicID The identifier for the data you want to import. The TopicID consists of three parts that MUST be
included in order and separated by a space or a slash (/):
Broker ID: Valid Identifier for the contributor. For example, 1102.
Category: Category within which the page resides. For example, 1.
Page Number: The page to import. For example, 274.

Optional Paramter Description


Row Number The row within the page to import.

e.g.)
Imports the data within row 7 on page 274 for category 1 of broker ID 1102.
=BPGE("1102 1 274", "7")

BRB
Bloomberg Realtime Bar (BRB) formulas import intervals of historical intraday data for a specified security.
The formulas update in real-time, so that when new intervals pass, the formula refreshes and imports the
data for the additional intervals.

=BRB( Security, Field(s), Start Date and Time, End Date and Time, BarType, [optional
parameter(s)] )

Optional Paramter Description


Optional Parameter for BRB formulas will be the same as BDH formulas. Please refer to BDH optional parameters for
more information.
BarSize, BarSz
BarType, BarTp
CapChg
CshAdjAbnormal
CshAdjNormal
Fill
Sort
Points
UseDPDF

e.g.)
Imports the last trade price for Apple Inc.'s equity for each thirty minute interval between 10:00 AM on
January 17, 2017, and the current date and time. As each new thirty minute interval passes, the
formula updates and the value for the new interval appears.
=BRB("AAPL US EQUITY", "LAST PRICE", "01/17/2017 10:00","","BarTp=T","BarSz=30")

38
Error Codes
=Error Code Possible Cause

#N/A Authorization You are attempting to use a data field that is not in the API.
You are attempting to import real-time technical analysis data, but you are not enabled for real-time data for
the security.
You have a limited functionality terminal or login that is not allowed to receive API data.
#N/A Calculating A BInterpol is calculating.

#N/A Connection The Excel connection to the bbcom server has been interrupted.

#N/A End Date No end date was indicated within the end date parameter.
The format of the date (or time, if included) is invalid..

#N/A Field Not Applicable The data field is not compatible with the security's market sector.

#N/A Invalid Field The data field in the formula is misspelled.

For BDH formulas: historical data was requested for a non-historical data field.
The field parameter in the formula is not being referenced correctly.
The data field in the formula is not in the Bloomberg API.

#N/A Invalid Parameter An unrecognized parameter appears in the formula (for example, "BS" instead of "BarSz").
An invalid value is supplied with an optional parameter (for example, "FX=HORIZONTAL" instead of a
currency code like USD).
For BDH formulas: if using the FX parameter, the currency code is invalid and cannot be parsed.
For BDH intraday formulas: a non-supported data field is used in the formula.
For BDH intraday bar formulas: the Intraday bar size is zero or less than zero (for example, "BarSz=0".

#N/A Invalid Screen Name The screen name is not valid.

#N/A Invalid Security The security is misspelled or the market sector is missing.
The identifier type is not specified in the formula.
The security identifier in the formula does not load a unique security on Bloomberg.

#N/A Limit : Real Time You have exceeded the limit of 3,500 concurrent real-time security subscriptions/hits.

#N/A Limit : Daily You have exceeded the daily download limit for static fields.
The daily limit automatically resets each day.

#N/A Limit : Monthly You have exceeded the monthly download limit for static fields.
The monthly limit automatically resets at the start of each month.

39
Error Codes

Error Code Possible Cause

#N/A Missing Value For BInterpol formulas, indicates that there are missing X or Y values in the formula.

#N/A N/A The data being requested is not currently available on Bloomberg.
A pricing source was specified for a fixed income security for which you are not authorized to download
data.
For BDH formulas: no historical or intraday data is available for the date(s) specified.
For BDP formulas: you are not enabled for real-time data for the security.

#N/A Out of Bounds For BInterpol formulas, indicates the interpolation point is outside the boundaries of the set of X values
and the Extrapolate parameter is not included in the formula.

#N/A Real Time The security has not been traded in the last thirty days.
The security is not priced in real time.

#N/A Refresh Failed The data field is a static field that is supposed to automatically refresh and the refresh did not occur.

#N/A Refresh Pending... The data field is a static field that is supposed to automatically refresh. If the Bloomberg server does not
have data, this error message appears and the field will attempt an automatic refresh a few seconds
later.

#N/A Repeat For BInterpol formulas, indicates there are repeated X values within the formula.

#N/A Requesting Data... Excel is not calculating or refreshing the formula.

#N/A Start Date No start date was indicated within the start date parameter.
The format of the date (or time, if included) is invalid.

#N/A Sort For BInterpol formulas, indicates the X values in the formula are not sorted.

#N/A Terminated The subscription has been terminated by the BDP, BPGE, BTP, or BRB formula.

#N/A Time Out The Excel connection to the bbcom server has been interrupted.
Your request has timed out during processing. This typically occurs due to the intensive nature of the
necessary calculations or too many data fields within one request.

#N/A Unclassified An error with no known Excel classification has occurred.

#N/A Unknown For BDH or BDS formulas: Excel has rejected the BDH/BDS updates because it is in a busy state.

40
API Help Pages
DAPI <GO> 【Desktop API】
Our main Desktop API portal for access to any general information as well as additional information.

HELP DAPI <GO> 【Desktop API Help Site】


Our Desktop API help page.

WAPI <GO> 【API Developer’s Help Site】


Our main API Developer portal, to obtain data using VBA and other programming languages.

41
Need any HELP? HELP HELP

Sending inquiry to the Help Desk

Pressing the HELP key twice pops up the


window where you can write your inquiry to the
Help Desk.

Bloomberg Analytics representative will assist


you through the IB Chat. You may request for a
phone call if you wish.

HDSK<GO> allows you to see your past


inquiries within the last one year.

Free Trainings and Seminars


BU<GO>
At Bloomberg we offer free trainings and seminars for our clients.
Please use BU<GO> to search for seminar details and enroll!

We also conduct private seminars and trainings.


For those who are not able to visit the office, we offer online training.
Please reach out to Bloomberg Helpdesk if you are ever interested.

42
Bloomberg

Bloomberg Website
http://www.bloomberg.com

Bloomberg Facebook Page


http://www.facebook.com/bloombergbusiness/

Bloomberg Business Twitter


https://twitter.com/business
The latest Tweets from Bloomberg (@business). The first word in business news. New York and the
World.

43
Bloomberg API
Excel Download Manual

44

Das könnte Ihnen auch gefallen