| Contents | Index |
X = builduniverse(y,s,d1,d2,p)
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
Data providers report price, action, and dividend data differently. Verify that the data returned by this method contains the expected results.
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');
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 |