fetch

Request Thomson Reuters Tick History data

Syntax

x = fetch(r,sec)
x = fetch(r,sec,tradefields,daterange,reqtype,messtype,exchange,domain)
x = fetch(r,sec,tradefields,daterange,reqtype,messtype,exchange,domain,marketdepth)

Description

x = fetch(r,sec) returns information about the security, sec, such as the code, currency, exchange, and name. r is the Thomson Reuters™ Tick History connection object.

x = fetch(r,sec,tradefields,daterange,reqtype,messtype,exchange,domain) returns data for the request security, sec, based on the type request and message types, reqtype and messtype, respectively. Data for the fields specified by tradefields is returned for the data range bounded by daterange. Specifying the exchange of the given security improves the speed of the data request. domain specifies the security type.

x = fetch(r,sec,tradefields,daterange,reqtype,messtype,exchange,domain,marketdepth) additionally specifies the depth of level 2 data, marketdepth, to return for a 'MarketDepth' request type. marketdepth must be a numeric value between 1 and 10, returning up to 10 bid/ask values for a given security.

    Note:   Do not use date ranges for end of day requests. You can specify a range of hours on a single day, but not a multiple day range.

Examples

To create a Thomson Reuters Tick History connection, the command

 r = rdth('user@company.com','mypassword')

returns

r =
client: [1x1 com.thomsonreuters.tickhistory. ...
webservice.client.RDTHApiClient]
user: 'user@company.com'
password: '**********'

To get information pertaining to a particular security, the command

d = fetch(r,'GOOG.O',{'Volume','Price','Exchange ID'},...
{'09/05/2008 12:00:00','09/05/2008 12:01:00'},...
'TimeAndSales','Trade','NSQ','EQU')

returns data starting with (not all data is shown):

d =
'#RIC'      'Date[L]'        'Time[L]'         'Type'...
     'Ex/Cntrb.ID'    'Price'
'GOOG.O'    '05-SEP-2008'    '12:00:01.178'    'Trade'...
    'NAS'            '443.86'
'Volume'
'200'    

The command

d = fetch(r,'GOOG.O',{'Volume','Last'},{'09/05/2008'},...
'EndOfDay','End Of Day','NSQ','EQU')

returns

d =
    '#RIC'      'Date[L]'        'Time[L]'       ...
  'Type'    'Last'     'Volume'
    'GOOG.O'    '05-SEP-2008'    '23:59:00.000'   ...
 'End Of Day'    '444.25'    '4538375' 

For

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

for example, the exchange of the security is x.Exchange or NSQ. To determine the asset domain of the security, use the value of x.Type, in this case 113. Using the information from v = get(r),

j = find(v.InstrumentTypes.Value == 113)

returns

j =46

The command

v.InstrumentTypes.Value(j)

returns

ans =
   113

The command

v.InstrumentTypes.Name(j)

returns

ans = 
    'Equities'

The command

v.AssetDomains.Value(strcmp(v.InstrumentTypes.Name(j),...
v.AssetDomains.Name))

returns

ans = 
    'EQU'

Knowing the security exchange and domain helps the interface to resolve the security symbol and return data more quickly.

To use a 'MarketDepth' level of 3, enter:

AaplTickData = fetch(R,'AAPL.O',{'Bid Price','Bid Size'},...
         {now-.05,now},'MarketDepth','Market Depth','NSQ','EQU',3);

More About

expand all

Tips

  • To obtain more information request and message types and their associated field lists, use the command get(r).

See Also

| |

Was this topic helpful?