Main Content

fds

FactSetWorkstation connection

Description

Thefdsfunction creates anfdsobject. Thefds对象表示一个FactSet®Workstation connection.

After you create anfdsobject, you can use the object functions to retrieve real-time data for securities. For credentials, contactFactSetResearch Systems.

Creation

Description

example

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

example

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

Input Arguments

expand all

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

Example:'ABCD_EFGH_IJKL'

Data Types:char|string

FactSet不是sword, specified as a character vector or string scalar. To find your password, contactFactSetResearch Systems.

Example:'XXXXXXXX'

Data Types:char|string

Field information file, specified as a character vector or string scalar. To obtain the field information file, contactFactSetResearch 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

realtime 获取实时数据FactSetWorkstation
stop Cancel real-time request
close Disconnect fromFactSetWorkstation

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, thefdsfunction uses the field information filert_fields.xml, which is found on the MATLAB path.cis anfdsobject.

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 theFDS1service andABCD-USAsecurity by using the FactSet Workstation connection. Use the default event handler functionmyMessageEventHandlerto process real-time data events from the FactSet Workstation. To access the code for the default event handler function, enteredit myMessageEventHandlerat the command line. You can write a custom function to process real-time data events differently. For details, seeWriting 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 ...

Therealtimefunction returns a data tagtfor 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.cis anfdsobject.

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 theFDS1service andABCD-USAsecurity by using the FactSet Workstation connection. Use the default event handler functionmyMessageEventHandlerto process real-time data events from the FactSet Workstation. To access the code for the default event handler function, enteredit myMessageEventHandlerat the command line. You can write a custom function to process real-time data events differently. For details, seeWriting 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 ...

Therealtimefunction returns a data tagtfor 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