Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

builduniverse

Retrieve total return price data from Yahoo!

Syntax

  • data = builduniverse(c,s,fromdate,todate,period)
    example

Description

example

data = builduniverse(c,s,fromdate,todate,period) retrieves total return price series data for security s using the Yahoo!® connection c. Retrieve data starting from the date fromdate through todate using the periodicity period to denote the data frequency.

Examples

collapse all

Connect to Yahoo! Finance.

c = yahoo;

Create a security list for Google®.

s = {'GOOG'};

Retrieve a daily total return price series for Google starting January 15, 2012 through today. The total is calculated from prices, splits, and dividends.

fromdate = '1/15/2012';
todate = floor(now);

data = builduniverse(c,s,fromdate,todate);

Display the data.

data
data =

     734885.00          1.00
     734886.00          1.01
     734887.00          1.02
     ...

data contains the numeric representation of the date in the first column and the total return prices for Google in the second column.

Close the connection.

close(c)

Related Examples

Input Arguments

collapse all

Yahoo! connection, specified as a connection object created using yahoo.

Security list, specified as a character vector for one security or a cell array of character vectors for multiple securities. These character vectors must be in a format recognizable by the Yahoo! server.

Data Types: char | cell

Beginning date for the historical data, specified as a double scalar, double vector, double matrix, character vector, or cell array of character vectors. You can specify dates in any format supported by datestr and datenum that show a year, month, and day.

Data Types: double | char | cell

End date for the historical data, specified as a double scalar, double vector, double matrix, character vector, or cell array of character vectors. You can specify dates in any format supported by datestr and datenum that show a year, month, and day.

Data Types: double | char | cell

Period within a date range, specified as one of these values.

Value

Description

'd'

Daily

'w'

Weekly

'm'

Monthly

Output Arguments

collapse all

Total return price series, returned as an m-by-(n + 1) matrix, where m refers to the number of records of data and n refers to the number of securities. The first column of the matrix contains MATLAB® date numbers and the remaining columns are the total return prices for each security.

More About

collapse 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

|

Introduced in R2011b

Was this topic helpful?