dis a structure that contains portfolio data. Each structure field corresponds to data for each portfolio field.
Close the connection.
close(c)
Request Portfolio Data Using Specific Date
Create the Bloomberg connection.
c = blp;
Alternatively, you can connect to the Bloomberg Server usingblpsrvor Bloomberg B-PIPE usingbpipe.
Request portfolio data for a custom portfolio with portfolio identifierU335877-1 Client. Request data using all fieldsf. Filter the portfolio data by specifying the date of November 3, 2014, using the override valueREFERENCE_DATEequal to20141103.
p ='U335877-1 Client'; f = {'PORTFOLIO_MEMBERS','PORTFOLIO_MPOSITION',...'PORTFOLIO_MWEIGHT','PORTFOLIO_DATA'}; o = {'REFERENCE_DATE'}; ov = {'20141103'}; [d,plist] = portfolio(c,p,f,o,ov)
Bloomberg connection, specified as a connection object created usingblp,blpsrv, orbpipe.
p—Portfolio character vector|string scalar
Portfolio, specified as a character vector or string scalar. Specify the portfolio by the ID that you can find in the upper-right corner of the portfolio display page. Append the text' Client'(without quotes) to the ID. For example, if the ID isU335877-1, then specify'U335877-1 Client'.
Access the portfolio display page by using thePRTUoption from the Bloomberg terminal. For details, see theBloomberg API Developer’s Guideusing theWAPI option from the Bloomberg terminal.
Portfolio fields, specified as one of the preceding values for one field. To specify multiple fields, use a cell array of these values.
Bloomberg Field Name
Bloomberg Field Description
'PORTFOLIO_DATA'
Returns a list of the identifiers, positions, market values, cost, cost date, and cost foreign exchange rate of each security in a custom portfolio.
'PORTFOLIO_MEMBERS'
Returns a list of identifiers for the members of a custom portfolio.
'PORTFOLIO_MPOSITION'
Returns a list of identifiers and the position for each security in a custom portfolio.
'PORTFOLIO_MWEIGHT'
Returns a list of identifiers and the percentage weight for each security in a custom portfolio.
Data Types:char|cell
o—Bloomberg override field character vector|string scalar|cell array of character vectors|string array
Bloomberg override field, specified as a character vector, string scalar, cell array of character vectors, or string array. The Bloomberg value'REFERENCE_DATE'denotes returning Bloomberg data for a specific date.
Data Types:char|cell|string
ov—Bloomberg override field value [](default) |character vector|string scalar|cell array of character vectors|string array
Bloomberg override field value, 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 value. A cell array of character vectors or string array denotes multiple Bloomberg override field values. Use this field value to filter the Bloomberg data result set.
Portfolio data, returned as a structure or table. The data type of the portfolio data depends on theDataReturnFormatproperty of the connection object.
plist— Portfolio list cell array of character vectors
Portfolio list, returned as a cell array of character vectors for the corresponding portfolio identifiers inp. The contents ofplistare identical in value and order top.
You can also select a web site from the following list:
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.