Skip to Main Content Skip to Search
Product Documentation

blp.history - Bloomberg V3 historical data

Syntax

[d, sec] = history(c, s, f, FromDate, ToDate)
[d, sec] = history(c, s, f, FromDate, ToDate, per)
[d, sec] = history(c, s, f, FromDate, ToDate, per, cur)
[d, sec] = history(c, s, f, FromDate, ToDate, per, cur, Name, Value, ...)

Description

[d, sec] = history(c, s, f, FromDate, ToDate) returns the historical data for the security list s and the connection object c for the fields f for the dates FromDate to ToDate. Date strings can be input in any format recognized by MATLAB. sec is the security list that maps the order of the return data. The return data, d and sec, is sorted to match the input order of s.

[d, sec] = history(c, s, f, FromDate, ToDate, per) returns the historical data for the field, f, for the dates FromDate to ToDate. per specifies the period of the data. For example, per = {'daily','calendar'} returns daily data for all calendar days reporting missing data as NaNs. per = {'actual'} returns the data using the default periodicity and default calendar reporting missing data as NaNs. The default periodicity depends on the security. If a security is reported on a monthly basis, the default periodicity is monthly. The default calendar is actual trading days. The possible values of per are as follows:

ValueTime Period
dailyDaily
weeklyWeekly
monthlyMonthly
quarterlyQuarterly
semi_annuallySemi annually
yearlyYearly
actualAnchor date specification
calendarAnchor date specification
fiscalAnchor date specification
non_trading_weekdaysNon trading weekdays
all_calendar_daysReturn all calendar days
active_days_onlyActive trading days only
previous_valueFill missing values with previous values
nil_valueFill missing values with NaN

[d, sec] = history(c, s, f, FromDate, ToDate, per, cur) returns the historical data for the security list s for the fields f for the dates FromDate to ToDate based on the given currency, cur.

[d, sec] = history(c, s, f, FromDate, ToDate, per, cur, Name, Value, ...) returns the historical data for the security list s for the fields f for the dates FromDate to ToDate based on the given currency, cur. Name,Value pair arguments are used for additional Bloomberg request settings.

Tips

Definitions

Anchor Date

The anchor date is the date to which all other reported dates are related. For blp.history, for periodicities other than daily, ToDate is the anchor date. For example, if you set the period to weekly and the ToDate is a Thursday, every reported data point would also be a Thursday, or the nearest prior business day to Thursday. Similarly, if you set the period to monthly and the ToDate is the 20th of a month, each reported data point would be for the 20th of each month in the date range.

Examples

Return the closing price for the given dates for the given security using the default period of the data:

[d, sec] = history(c, 'ABC US Equity', ...
   'LAST_PRICE', '8/01/2010', '8/10/2010')
 

Return the monthly closing price for the given dates for the given security:

[d, sec] = history(c, 'ABC US Equity', ...
'LAST_PRICE', '8/01/2010', '12/10/2010', 'monthly')
 

Return the monthly closing price converted to US dollars for the given dates for the given security:

[d, sec] = history(c, 'ABC US Equity', ...
'LAST_PRICE', '8/01/2010', '12/10/2010', 'monthly', 'USD')
 

Return the daily closing price converted to US dollars for the given dates for the given security:

[d, sec] = history(c, 'ABC US Equity', ...
   'LAST_PRICE', '8/01/2010', '8/10/2010', {'daily',...
   'actual', 'all_calendar_days', 'nil_value'}, 'USD')
 

Return the weekly closing price converted to US dollars for the given dates for the given security. Note that the anchor date is dependent on the date 12/23/1999 in this case. Because this date is a Thursday, each previous value will be reported for the Thursday of the week in question.

[d, sec] = history(c,'ABC US Equity', ...
   'LAST_PRICE','11/01/2010','12/23/2010', ...
   {'weekly'},'USD')
 

Return the closing price converted to US dollars for the given dates for the given security using the default period of the data. The default period of a security is dependent on the security itself and not set in this function.

[d, sec] = history(c,'ABC US Equity',...
   'LAST_PRICE','8/01/2010','9/10/2010',[],'USD')
 

Return the closing price converted to US dollars for the given dates for the given security using the default period of the data. The prices are adjusted for normal cash and splits.

[d, sec] = history(c,'ABC US Equity','LAST_PRICE',...
   '8/01/2010','8/10/2010','daily','USD',...
   'adjustmentNormal',true,'adjustmentSplit',true)

 

When specifying Bloomberg override fields, use the 'overrideOption'. The overrideOption argument must be an n-by-2 cell array, where the first column is the override field and the second column is the override value.

reqData3 = history(conn,'AKZA NA Equity', ...
   'BEST_EPS_MEDIAN', datenum('01.10.2010', ...
   'dd.mm.yyyy'), datenum('30.10.2010','dd.mm.yyyy'), ...
   {'daily','calendar'}, [],'overrideOption', ...
   {'BEST_FPERIOD_OVERRIDE', 'BF'}, 'CapChg', true); 

See Also

blp | blp.getdata | blp.realtime | blp.timeseries

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS