fetch

Request data from Reuters data servers

Description

example

d = fetch(c,sec) returns the current data for the security sec, given the Reuters® session object c.

example

d = fetch(c,sec,[],fields) requests the given fields fields, for the security sec, given the Reuters session object c.

example

subs = fetch(c,sec,eventhandler) uses the Reuters session object c to subscribe to the security sec. MATLAB® runs the eventhandler function for each data event that occurs.

Examples

collapse all

Connect to Refinitiv™.

c = reuters('myNS::remotesession','dIDN_RDF');
Jan 13, 2014 2:23:09 PM com.reuters.rfa.internal.connection.md.MDConnectionImpl initializeEntitlements

INFO: com.reuters.rfa.connection.ssl.myNS.RemoteConnection
DACS disabled for connection myNS::RemoteConnection

The output message specifies a successful connection to the Enterprise Platform.

Retrieve the current data for the Google® security using the Reuters session object c.

sec = 'GOOG.O';

d = fetch(c,sec)
d = 

     PROD_PERM: 74.00
    RDNDISPLAY: 66.00
    DSPLY_NAME: 'DELAYED-15GOOGLE'
    ...

d contains a large number of Refinitiv market data fields. This output shows the product permissions information, PROD_PERM, the display information for the IDN terminal device, RDNDISPLAY, and the expanded name for the instrument, DSPLY_NAME.

Close the Refinitiv connection.

close(c)

Connect to Refinitiv.

c = reuters('myNS::remotesession','dIDN_RDF');
Jan 13, 2014 2:23:09 PM com.reuters.rfa.internal.connection.md.MDConnectionImpl initializeEntitlements

INFO: com.reuters.rfa.connection.ssl.myNS.RemoteConnection
DACS disabled for connection myNS::RemoteConnection

The output specifies a successful connection to the Enterprise Platform.

Request the product permissions information 'PROD_PERM' for the Google security from Reuters.

sec = 'GOOG.O';
field = 'PROD_PERM';

d = fetch(c,sec,[],field)
d = 

    PROD_PERM: 74

Request the product permissions information 'PROD_PERM' and the display information for the IDN terminal device 'RDNDISPLAY' for the Google security from Reuters. Use a cell array to input these two fields to the function.

sec = 'GOOG.O';
fields = {'PROD_PERM','RDNDISPLAY'};

d = fetch(c,sec,[],fields)
d = 

     PROD_PERM: 74
    RDNDISPLAY: 66

Close the Refinitiv connection.

close(c)

To subscribe to a security and process the data in real time, specify an event handler function. MATLAB runs this function each time it receives a real-time data event from Reuters.

Connect to Refinitiv.

c = reuters('myNS::remotesession','dIDN_RDF');
Jan 13, 2014 2:23:09 PM com.reuters.rfa.internal.connection.md.MDConnectionImpl initializeEntitlements

INFO: com.reuters.rfa.connection.ssl.myNS.RemoteConnection
DACS disabled for connection myNS::RemoteConnection

The output specifies a successful connection to the Enterprise Platform.

The event handler rtdemo function returns the real-time Reuters data for the Google security to the MATLAB workspace variable A. openvar displays A in the Variables editor.

sec = 'GOOG.O';
eventhandler = 'rtdemo';

subs = fetch(c,sec,eventhandler);
openvar('A')

In this instance, the fields represent a bid or ask tick.

The fetch function returns the subscription handle associated with this request in the variable subs. Display the subscription handle contents.

subs
subs =
 
com.reuters.rfa.internal.common.SubHandleImpl[]:
    [com.reuters.rfa.internal.common.SubHandleImpl]

Stop the real-time subscription.

stop(c,subs)

Close the Refinitiv connection.

close(c)

Input Arguments

collapse all

Reuters session, specified as a Reuters session object created using reuters.

Security list, specified as a character vector, string scalar, cell array of character vectors, or a string array to denote Reuters securities.

Data Types: char | cell | string

Reuters fields list, specified as a character vector, string scalar, cell array of character vectors, or string array to denote Reuters field names.

Data Types: char | cell | string

Reuters real-time event handler, specified as a MATLAB function that runs for each data event that occurs. The sample event handler called rtdemo.m returns Reuters real-time data from the Enterprise Platform from Refinitiv to the MATLAB workspace. The sample event handler specifies these input arguments.

Event Handler Input Argument

Description

x

Return data structure

itemName

Reuters data name

serviceName

Reuters service name

The sample event handler writes variable A to the Workspace browser with the contents of x.

Data Types: function_handle

Output Arguments

collapse all

Reuters request data, returned as a structure. The structure contains many Reuters data fields. For details, see Reuters Data Support.

Reuters subscription handle, returned as a Reuters subscription object.

Introduced in R2008a