fetch

Request data from FactSet

Syntax

data = fetch(Connect)
data = fetch(Connect, 'Library')
data = fetch(Connect, 'Security', 'Fields')
data = fetch(Connect, 'Security', 'Fields', 'FromDate',
'ToDate')
data = fetch(Connect, 'Security', 'FromDate',
'ToDate', 'Period')

Arguments

Connect

FactSet® connection object created with the factset function.

Library

FactSet formula library.

Security

A MATLAB® character vector, string, cell array of character vectors, or string array containing the names of securities in a format recognizable by the FactSet server.

Fields

A MATLAB character vector, string, cell array of character vectors, or string array indicating the data fields for which to retrieve data.

Date

Date character vector, 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 date range.

Note

You can specify dates in any of the formats supported by datestr and datenum that display a year, month, and day.

ToDate

End date for date range.

Period

Period within 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.

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')
Introduced before R2006a