Quantcast

Documentation Center

  • Trial Software
  • Product Updates

rdth

Connect to Thomson Reuters Tick History

Syntax

r = rdth(username,password)
r = rdth(username,password,[],flag)

Description

r = rdth(username,password) creates a Thomson Reuters™ Tick History connection to enable intraday tick data retrieval.

r = rdth(username,password,[],flag) sets the reference data flag flag to toggle the return of reference data.

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: '**********'

Suppose you want to get the intraday price and volume information for all ticks of type Trade. To determine which fields apply to the message type Trade and the requestType of the Trade message, the command:

v = get(r,'MessageTypes')

returns

v = RequestType: {31x1 cell}
Name: {31x1 cell}
Fields: {31x1 cell}

The command

v.Name

then returns

ans = 
    'C&E Quote'
    'Short Sale'
    'Fund Stats'
    'Economic Indicator'
    'Convertibles Transactions'
    'FI Quote'
    'Dividend'
    'Trade'
    'Stock Split'
    'Settlement Price'
    'Index'
    'Open Interest'
    'Correction'
    'Quote'
    'OTC Quote'
    'Stock Split'
    'Market Depth'
    'Dividend'
    'Stock Split'
    'Market Maker'
    'Dividend'
    'Stock Split'
    'Intraday 1Sec'
    'Dividend'
    'Intraday 5Min'
    'Intraday 1Min'
    'Intraday 10Min'
    'Intraday 1Hour'
    'Stock Split'
    'End Of Day'
    'Dividend'

The command

j = find(strcmp(v.Name,'Trade'));

returns

j =     8

The command

v.Name{j}

returns

ans = Trade

The command

v.RequestType{8}

returns

ans = TimeAndSales

The command

v.Fields{j}

returns

ans = 
    'Exchange ID'
    'Price'
    'Volume'
    'Market VWAP'
    'Accumulative Volume'
    'Turnover'
    'Buyer ID'
    'Seller ID'
    'Qualifiers'
    'Sequence Number'
    'Exchange Time'
    'Block Trade'
    'Floor Trade'
    'PE Ratio'
    'Yield'
    'Implied Volatility'
    'Trade Date'
    'Tick Direction'
    'Dividend Code'
    'Adjusted Close Price'
    'Price Trade-Through-Exempt Flag'
    'Irregular Trade-Through-Exempt Flag'
    'TRF Price Sub Market ID'
    'TRF'
    'Irregular Price Sub Market ID' 

To request the Exchange ID, Price, and Volume of a security's intraday tick for a given day and time range the command

x = fetch(r,'ABCD.O',{'Exchange ID','Price','Volume'},...
{'09/05/2008 12:00:06','09/05/2008 12:00:10'},...
'TimeAndSales','Trade','NSQ','EQU');

returns data similar to

x = 

    'ABCD.O'  '05-SEP-2008'  '12:00:08.535' ...
   'Trade'    'NAS'    '85.25'    '100'
    'ABCD.O'  '05-SEP-2008'  '12:00:08.569' ...
   'Trade'    'NAS'    '85.25'    '400'

To request the Exchange ID, Price, and Volume of a security's intraday tick data for an entire trading day, the command

x = fetch(r,'ABCD.O',{‘Exchange ID','Price','Volume'},...
'09/05/2008','TimeAndSales','Trade','NSQ','EQU');

returns data similar to

x =

    'ABCD.O'    '05-SEP-2008'    '08:00:41.142'...
    'Trade'    'NAS'    '51'       '100'
    'ABCD.O'    '05-SEP-2008'    '08:01:03.024'...
    'Trade'    'NAS'    '49.35'    '100'
    'ABCD.O'    '05-SEP-2008'    '19:37:47.934'...
    'Trade'    'NAS'    '47.5'    '1200'
    'ABCD.O'    '05-SEP-2008'    '19:37:47.934'...
    'Trade'    'NAS'    '47.5'    '300' 
    'ABCD.O'    '05-SEP-2008'    '19:59:33.970'...
    'Trade'    'NAS'    '47'      '173'

To clean up any remaining requests associated with the rdth connection use:

close(r)

To create a Thomson Reuters Tick History connection so that subsequent data requests do not return reference data, use:

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

returns

r =
         client: [1x1 com.thomsonreuters.tickhistory.webservice.TRTHApiServiceStub]
           user: 'user@company.com'
       password: '**********'
           cred: [1x1 com.thomsonreuters.tickhistory.webservice.types.CredentialsHeaderE]
    refDataFlag: 0

The property flag can be modified after making the connection with:

r.refDataFlag = true

or

r.refDataFlag = false

To clean up any remaining requests associated with the rdth connection use:

close(r)

See Also

| |

Was this topic helpful?