Detailed instructions for use are in the User's Guide.
[. . . ] Datafeed ToolboxTM 3 User's Guide
How to Contact The MathWorks
Web Newsgroup www. mathworks. com/contact_TS. html Technical Support
www. mathworks. com comp. soft-sys. matlab suggest@mathworks. com bugs@mathworks. com doc@mathworks. com service@mathworks. com info@mathworks. com
Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information
508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site. Datafeed ToolboxTM User's Guide © COPYRIGHT 19992010 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. [. . . ] value = get(Connect) returns a MATLAB structure where each field name is the name of a property of Connect. Each field contains the
value of the property.
See Also
datastream. close, datastream, datastream. fetch, datastream. isconnection
6-48
datastream. isconnection
Purpose Syntax Arguments
Verify whether connections to Thomson Datastream data servers are valid
x = isconnection(Connect)
Connect
Thomson Datastream connection object created with the datastream function.
Description Examples
x = isconnection(Connect) returns x = 1 if the connection is a valid Thomson Datastream connection, and x = 0 otherwise.
Establish a connection to the Thomson Datastream API:
c = datastream
Verify that c is a valid connection:
x = isconnection(c) x=1
See Also
datastream. close, datastream, datastream. fetch, datastream. get
6-49
factset
Purpose Syntax Arguments
Establish connections to FactSet data servers
Connect = factset('UserName', 'SerialNumber', 'Password', 'ID')
UserName SerialNumber Password ID
User login name. FactSet customer identification number.
Note FactSet assigns values to all input arguments.
Description Examples
Connect = factset('UserName', 'SerialNumber', 'Password', 'ID') connects to the FactSet FAST interface.
Establish a connection to a FactSet server:
Connect = factset('username', '1234', 'password', 'fsid') Connect = user: 'username' serial: '1234' password: 'password' cid: 'fsid'
See Also
factset. close, factset. fetch, factset. get, factset. isconnection
6-50
factset. close
Purpose Syntax Arguments
Close connections to FactSet data servers
close(Connect)
Connect
FactSet connection object created with the factset function.
Description See Also
close(Connect) closes the connection to the FactSet data server. factset
6-51
factset. fetch
Purpose Syntax
Request data from FactSet data servers
data = fetch(Connect) data = fetch(Connect, data = fetch(Connect, data = fetch(Connect, 'ToDate') data = fetch(Connect, 'Period')
'Library') 'Security', 'Fields') 'Security', 'Fields', 'FromDate', 'Security', 'FromDate', 'ToDate',
Arguments
Connect Library Security
FactSet connection object created with the factset function. A MATLAB string or cell array of strings containing the names of securities in a format recognizable by the FactSet server. A MATLAB string or cell array of strings indicating the data fields for which to retrieve data. Date string or serial date number indicating date for the requested data. If you enter today's date, fetch returns yesterday's data. Note You can specify dates in any of the formats supported by datestr and datenum that display a year, month, and day.
Fields
Date
FromDate
6-52
factset. fetch
ToDate Period
End date for date range. Period values are: · 'd': daily values · 'b': business day daily values · 'm': monthly values · 'mb': beginning monthly values · 'me': ending monthly values · 'q': quarterly values · 'qb': beginning quarterly values · 'qe': ending quarterly values · 'y': annual values · 'yb': beginning annual values · 'ye': ending annual values
Description
data = fetch(Connect) returns the names of all available formula
libraries.
data = fetch(Connect, 'Library') returns the valid field names
for a given formula library.
data = fetch(Connect, 'Security', 'Fields') returns data for
the specified security and fields.
data = fetch(Connect, 'Security', 'Fields', 'Date') returns
security data for the specified fields on the requested date.
data = fetch(Connect, 'Security', 'Fields', 'FromDate', 'ToDate') returns security data for the specified fields for the date range FromDate to ToDate.
6-53
factset. fetch
data = fetch(Connect, 'Security', 'FromDate', 'ToDate', 'Period') returns security data for the date range FromDate to ToDate
with the specified period.
Examples
Retrieving Names of Available Formula Libraries
Obtain the names of available formula libraries:
D = fetch(Connect)
Retrieving Valid Field Names of a Specified Library
Obtain valid field names of the FactSetSecurityCalcs library:
D = fetch(Connect, 'fs')
Retrieving the Closing Price of a Specified Security
Obtain the closing price of the security IBM:
D = fetch(Connect, 'IBM', 'price')
Retrieving the Closing Price of a Specified Security Using Default Date Period
Obtain the closing price for IBM using the default period of the data:
D = fetch(C, 'IBM', 'price', '09/01/07', '09/10/07')
Retrieving the Monthly Closing Prices of a Specified Security for a Given Date Range
Obtain the monthly closing prices for IBM from 09/01/05 to 09/10/07:
D = fetch(C, 'IBM', 'price', '09/01/05', '09/10/07', 'm')
See Also
factset. close, factset, factset. isconnection
6-54
factset. get
Purpose Syntax
Retrieve properties of FactSet connection objects
value = get(Connect, 'PropertyName') value = get(Connect)
Arguments
Connect PropertyName
FactSet connection object created with the factset function. (Optional) A MATLAB string or cell array of strings containing property names. Property names are: · user · serial · password · cid
Description
value = get(Connect, 'PropertyName') returns the value of the specified properties for the FactSet connection object. value = get(Connect) returns a MATLAB structure where each field name is the name of a property of Connect, and each field contains
the value of that property.
Examples
Establish a connection to a FactSet data server:
Connect = factset('Fast_User', '1234', 'Fast_Pass', 'userid')
Retrieve the connection property value:
h = get(Connect) h= user: 'Fast_User' serial: '1234' password: 'Fast_Pass'
6-55
factset. get
cid: 'userid'
Retrieve the value of the connection's user property:
get(Connect, 'user') ans = Fast_User
See Also
factset. close, factset. fetch, factset, factset. isconnection
6-56
factset. isconnection
Purpose Syntax Arguments
Verify whether connections to FactSet data servers are valid
x = isconnection(Connect)
Connect
FactSet connection object created with the factset function.
Description Examples
x = isconnection(Connect) returns x = 1 if the connection to the FactSet data server is valid, and x = 0 otherwise.
Establish a connection, c, to a FactSet data server:
c = factset
Verify that c is a valid connection:
x = isconnection(c); x=1
See Also
factset. close, factset. fetch, factset, factset. get
6-57
fred
Purpose Syntax
Connect to FRED data servers
Connect = fred(URL) Connect = fred
Arguments Description
URL
Create a connection using a specified URL.
Connect = fred(URL) establishes a connection to a FRED data server. Connect = fred verifies that the URL http://research. stlouisfed. org/fred2/ is accessible and creates a
connection.
Examples
Connect to the FRED data server at the URL
http://research. stlouisfed. org/fred2/: c = fred('http://research. stlouisfed. org/fred2/')
See Also
fred. close, fred. fetch, fred. get, fred. isconnection
6-58
fred. close
Purpose Syntax Arguments
Close connections to FRED data servers
close(Connect)
Connect
FRED connection object created with the fred function.
Description Examples
close(Connect) closes the connection to the FRED data server.
Make a connection c to a FRED data server:
c = fred('http://research. stlouisfed. org/fred2/')
Close this connection:
close(c)
See Also
fred
6-59
fred. fetch
Purpose Syntax
Request data from FRED data servers
data = fetch(Connect, 'Security') data = fetch(Connect, 'Security', 'D1') data = fetch(Connect, 'Security', 'D1', 'D2')
Arguments
Connect 'Security' 'D1' 'D2'
FRED connection object created with the fred function. MATLAB string containing the name of a security in a format recognizable by the FRED server. MATLAB string or date number indicating the date from which to retrieve data. MATLAB string or date number indicating the date range from which to retrieve data.
Description
For a given security, fetch returns historical data using the connection to the FRED data server.
data = fetch(Connect, 'Security') returns data for the security Security, using the connection object Connect. data = fetch(Connect, 'Security', 'D1') returns data for the security Security, using the connection object Connect, for the date D1. If you specify today's date for D1, fetch returns data from yesterday. data = fetch(Connect, 'Security', 'D1', 'D2') returns all data for the security Security, using the connection object Connect, for the date range 'D1' to 'D2'.
Note You can specify dates in any of the formats supported by datestr and datenum that show a year, month, and day.
6-60
fred. fetch
Examples
Fetch all available daily U. S. dollar to euro foreign exchange rates:
d = fetch(f, 'DEXUSEU') d= Title: 'U. S. / Euro Foreign Exchange Rate' SeriesID: 'DEXUSEU' Source: 'Board of Governors of the Federal Reserve System' Release: 'H. 10 Foreign Exchange Rates' SeasonalAdjustment: 'Not Applicable' Frequency: 'Daily' Units: 'U. S. [. . . ] 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.
Examples
Retrieving Last Prices for a Set of Equities
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
Retrieving a Closing Price on a Specified Date
Obtain the closing price for Coca-Cola on April 6, 2000:
c = yahoo; ClosePrice = fetch(c, 'ko', 'Close', 'Apr 6 00') ClosePrice = 1. 0e+005 * 7. 3058 0. 0005
See Also
yahoo. close, yahoo. get, yahoo. isconnection, yahoo
6-151
yahoo. get
Purpose Syntax
Retrieve properties of Yahoo!connection objects
value = get(Connect, 'PropertyName') value = get(Connect)
Arguments
Connect PropertyName
Yahoo! [. . . ]