| Datafeed Toolbox™ | ![]() |
data = fetch(Connect, 'Security')
data = fetch(Connect, 'Security',
'Fields')
data = fetch(Connect, 'Security',
'Date')
data = fetch(Connect, 'Security',
'Fields', 'Date')
data = fetch(Connect, 'Security',
'FromDate', 'ToDate')
data = fetch(Connect, 'Security',
'Fields', 'FromDate', 'ToDate')
data = fetch(Connect, 'Security',
'FromDate', 'ToDate', 'Period')
| Connect | Yahoo! connection object created with the yahoo function. |
| Security | A MATLAB® string or cell array of strings containing the name of a security in a format recognizable by the Yahoo! server. |
| Fields | A MATLAB string or cell array of strings indicating the data fields for which to retrieve data. A partial list of supported values for current market data are:
A partial list of supported values for historical data are:
For a complete list of supported values for market and historical data, see yhfields.mat. |
Date | Date string or serial date number indicating date for the requested data. If you enter today's date, fetch returns yesterday's data. |
FromDate | Beginning date for historical data. |
ToDate | End date for historical data. |
Period | Period within date range. Period values are:
|
data = fetch(Connect, 'Security') returns data for all fields from Yahoo!'s Web site for the indicated security.
Note This function does not support retrieving multiple securities at once. You must fetch a single security at a time. |
data = fetch(Connect, 'Security', 'Fields') returns data for the specified fields.
data = fetch(Connect, 'Security', 'Date') returns all security data for the requested date.
data = fetch(Connect, 'Security', 'Fields', 'Date') returns security data for the specified fields on the requested date.
data = fetch(Connect, 'Security', 'FromDate', 'ToDate') returns security data for the date range FromDate to ToDate.
data = fetch(Connect, 'Security', 'Fields', 'FromDate', 'ToDate') returns security data for the specified fields for the date range FromDate to ToDate.
data = fetch(Connect, 'Security', 'FromDate', 'ToDate', 'Period') returns security data for the date range FromDate to ToDate with the indicated period.
Connect to the Yahoo! data server to obtain the last prices for a set of equities:
y = yahoo;
FastFood = fetch(y, {'ko', 'pep', 'mcd'},'Last')
FastFood =
Last: [3x1 double]
FastFood.Last
ans =
42.96
45.71
23.70
Obtain the closing price for Coca-Cola on April 6, 2000:
c = yahoo;
ClosePrice = fetch(c,'ko','Close','Apr 6 00')
ClosePrice =
730582.00 45.75
yahoo.close, yahoo.get, yahoo.isconnection, yahoo
![]() | yahoo.close | yahoo.get | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |