Products & Services Solutions Academia Support User Community Company

Learn more about Datafeed Toolbox   

datastream.fetch - Request data from Thomson Datastream data servers

Syntax

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

Arguments

ConnectThomson Datastream connection object created with the datastream function.
'Security'MATLAB string containing the name of a security, or cell array of strings containing names of multiple securities. This data is in a format recognizable by the Thomson Datastream data server.
'Fields'(Optional) MATLAB string or cell array of strings indicating the data fields for which to retrieve data.
'Date'(Optional) MATLAB string indicating a specific calendar date for which you request data.
'FromDate'(Optional) Start date for historical data.
'ToDate'(Optional) End date for historical data. If you specify a value for 'ToDate', 'FromDate' cannot be an empty value.

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

'Period'(Optional) Period within a date range. Period values are:
  • 'd': daily values

  • 'w': weekly values

  • 'm': monthly values

'Currency'(Optional) Currency in which fetch returns the data.

Description

data = fetch(Connect, 'Security') returns the default time series for the indicated security.

data = fetch(Connect, 'Security', 'Fields') returns data for the specified security and fields.

data = fetch(Connect, 'Security', 'Fields', 'Date') returns data for the specified security and fields on a particular date.

data = fetch(Connect, 'Security', 'Fields', 'FromDate', 'ToDate') returns data for the specified security and fields for the indicated date range.

data = fetch(Connect, 'Security', 'Fields', 'FromDate', 'ToDate', 'Period') returns instrument data for the given range with the indicated period.

data = fetch(Connect, 'Security', 'Fields', 'FromDate', 'ToDate', 'Period', 'Currency') also specifies the currency in which to report the data.

Examples

Retrieving Time Series Data

Return the trailing one-year price time series for the instrument 'P', which is the default value for the 'Fields' argument using the command:

data = fetch(Connect, 'ICI')

Or the command:

data = fetch(Connect, 'ICI', 'P')

Retrieving Opening and Closing Prices

Return the closing and opening prices for the instruments P and PO on the date September 1, 2007.

data = fetch(Connect, 'ICI', {'P', 'PO'}, '09/01/2007')

Retrieving Monthly Opening and Closing Prices for a Specified Date Range

Return the monthly closing and opening prices for the securities ICI and IBM from 09/01/2005 to 09/01/2007:

data = fetch(Connect, {'ICI', 'IBM'}, {'P', 'PO'}, ...
'09/01/2005', '09/01/2007', 'M')

See Also

datastream.close, datastream, datastream.get, datastream.isconnection

  


Free Interactive Computational Finance CD

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-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS