Documentation Center

  • Trial Software
  • Product Updates

builduniverse

Portfolio matrix with total return price data from Yahoo!

Syntax

X = builduniverse(y,s,d1,d2,p)

Description

X = builduniverse(y,s,d1,d2,p) builds a portfolio matrix using Yahoo!® data to compute a total return price series. X is an m-by-(n + 1) matrix, where m refers to the number of records of data and n refers to the number of securities. Column 1 of the matrix contains MATLAB® date numbers and the remaining columns are the total return prices for each security. y is the Yahoo! connection handle, s is a cell array of security identifiers, d1 and d2 are the start and end dates for the data request, and p is the periodicity flag. p can be entered as:

  • 'd' for daily values

  • 'w' for weekly values

  • 'm' for monthly values

Examples

Compute a total return price series and convert to daily total returns:

y = yahoo;
%
% Load security list.  
s = {'A', 'B', 'C'};

% Get a daily total return price series for securities.
% (Calculated from prices, splits and dividends.)
Universe = builduniverse(y,s,'1/15/2007',floor(now));

% Convert to daily total returns.
Universe = periodicreturns(Universe,'d');

More About

expand all

Tips

  • Data providers report price, action, and dividend data differently. Verify that the data returned by the builduniverse function contains the expected results.

See Also

|

Was this topic helpful?