Main Content

fds

FactSet Workstation connection

Description

The fds function creates an fds object. The fds object represents a FactSet® Workstation connection.

After you create an fds object, you can use the object functions to retrieve real-time data for securities. For credentials, contact FactSet Research Systems.

Creation

Description

c = fds(username,password) creates a FactSet Workstation connection using a user name and password. By default, this syntax uses the field information file rt_fields.xml, which is found on the MATLAB® path.

example

c = fds(username,password,finfo) creates a connection using the specified field information file.

example

Input Arguments

expand all

FactSet user name, specified as a character vector or string scalar. To find your user name, contact FactSet Research Systems.

Example: 'ABCD_EFGH_IJKL'

Data Types: char | string

FactSet password, specified as a character vector or string scalar. To find your password, contact FactSet Research Systems.

Example: 'XXXXXXXX'

Data Types: char | string

Field information file, specified as a character vector or string scalar. To obtain the field information file, contact FactSet Research Systems. Specify the full file path to the field information file.

Example: 'C:\Program Files (x86)\FactSet\FactSetDataFeed\fdsrt-2\etc\rt_fields.xml'

Data Types: char | string

Properties

expand all

FactSet handle, specified as a handle object.

Example: [1×1 COM.FDSRTCom_FDF]

Object Functions

realtimeObtain real-time data from FactSet Workstation
stopCancel real-time request
closeDisconnect from FactSet Workstation

Examples

collapse all

Create a FactSet Workstation connection. Then, retrieve real-time data for a security.

Connect to the FactSet Workstation using a user name and password. By default, the fds function uses the field information file rt_fields.xml, which is found on the MATLAB path. c is an fds object.

username = 'ABCD_EFGH_IJKL';
password = 'XXXXXXXX';

c = fds(username,password)
c = 
 
  fds with properties:

    Handle: [1×1 COM.FDSRTCom_FDF]

Retrieve real-time data for the FDS1 service and ABCD-USA security by using the FactSet Workstation connection. Use the default event handler function myMessageEventHandler to process real-time data events from the FactSet Workstation. To access the code for the default event handler function, enter edit myMessageEventHandler at the command line. You can write a custom function to process real-time data events differently. For details, see Writing and Running Custom Event Handler Functions.

Srv = 'FDS1';
Sec = 'ABCD-USA';
Cb = @(varargin)myMessageEventHandler(varargin);
t = realtime(c,Srv,Sec,Cb)
t =

     1

ABCD-USA:D 11-Sep-2017 14:04:53 6.27
ABCD-USA:D 11-Sep-2017 14:07:00 6.29
...

The realtime function returns a data tag t for the real-time request. Then, the event handler function returns the following data to the Command Window:

  • Security name

  • Date

  • Time

  • Last price

Stop real-time data retrieval.

stop(c,t)

Close the FactSet Workstation connection.

close(c)

Create a FactSet Workstation connection and specify the field information file. Then, retrieve real-time data for a security.

Connect to the FactSet Workstation using a user name, password, and field information file. c is an fds object.

username = 'ABCD_EFGH_IJKL';
password = 'XXXXXXXX';
finfo = 'C:\Program Files (x86)\FactSet\FactSetDataFeed\fdsrt-2\etc\rt_fields.xml';

c = fds(username,password,finfo)
c = 
 
  fds with properties:

    Handle: [1×1 COM.FDSRTCom_FDF]

Retrieve real-time data for the FDS1 service and ABCD-USA security by using the FactSet Workstation connection. Use the default event handler function myMessageEventHandler to process real-time data events from the FactSet Workstation. To access the code for the default event handler function, enter edit myMessageEventHandler at the command line. You can write a custom function to process real-time data events differently. For details, see Writing and Running Custom Event Handler Functions.

Srv = 'FDS1';
Sec = 'ABCD-USA';
Cb = @(varargin)myMessageEventHandler(varargin);
t = realtime(c,Srv,Sec,Cb)
t =

     1

ABCD-USA:D 11-Sep-2017 14:04:53 6.27
ABCD-USA:D 11-Sep-2017 14:07:00 6.29
...

The realtime function returns a data tag t for the real-time request. Then, the event handler function returns the following data to the Command Window:

  • Security name

  • Date

  • Time

  • Last price

Stop real-time data retrieval.

stop(c,t)

Close the FactSet Workstation connection.

close(c)

Version History

Introduced in R2013a