Documentation Center

  • Trial Software
  • Product Updates

fetch

Request data from Reuters data servers

Syntax

d = fetch(r,s)
d = fetch(r,s,callback)
d = fetch(r,s,[],f)

Arguments

r

Reuters® session object created with reuters.

s

Reuters security object.

callback

MATLAB® function that runs for each data event that occurs.

Description

d = fetch(r,s) returns the current data for the security s, given the Reuters session object r.

d = fetch(r,s,callback) uses the Reuters session object r to subscribe to the security s. MATLAB runs the callback function for each data event that occurs.

d = fetch(r,s,[],f) requests the given fields f, for the security s, given the Reuters session object r.

Examples

Retrieving Current Securities Data

Retrieve the current data for the security GOOG.O using the Reuters session object r:

d = fetch(r,'GOOG.O')

Following is a partial listing of the returned security data:

d = 
PROD_PERM: 74.00
RDNDISPLAY: 66.00
DSPLY_NAME: 'DELAYED-15GOOGLE'
RDN_EXCHID: '0'
TRDPRC_1: 474.28
TRDPRC_2: 474.26
TRDPRC_3: 474.25
TRDPRC_4: 474.25
TRDPRC_5: 474.25
NETCHNG_1: -4.73
HIGH_1: 481.35
LOW_1: 472.78
PRCTCK_1: '1'
CURRENCY: '840'
TRADE_DATE: '30 APR 2007

Subscribing to a Security

To subscribe to a security and process the data in real time, specify a callback function. MATLAB runs this function each time it receives a real-time data event from Reuters. In this example, the callback function, rtdemo, returns the subscription handle associated with this request to the base MATLAB workspace, A. The openvar function is then called to display A in the Variables editor. A partial list of the data included in A appears in the figure.

d = fetch(r,'GOOG.O','rtdemo')
openvar('A')

See Also

| |

Was this topic helpful?