trth

Thomson Reuters Tick History connection

Description

The trth function creates a trth object, which represents a Thomson Reuters® Tick History connection. This connection uses the Thomson Reuters Tick History REST API to retrieve data. After you create a trth object, you can use the object functions to retrieve historical and intraday data.

Creation

Description

example

c = trth(username,password) creates a Thomson Reuters Tick History connection object using a password and sets the Username property.

Input Arguments

expand all

Password, specified as a character vector or string scalar. For credentials, contact Thomson Reuters.

Example: 'password'

Data Types: char | string

Properties

expand all

User name, specified as a character vector or string scalar. For credentials, contact Thomson Reuters.

Example: 'username'

Data Types: char | string

Timeout value in seconds that MATLAB® attempts to connect by using the Thomson Reuters Tick History REST API, specified as a numeric scalar.

Example: 100

Data Types: double

Object Functions

historyThomson Reuters Tick History historical data
timeseriesThomson Reuters Tick History intraday data

Examples

collapse all

Use a Thomson Reuters Tick History connection to retrieve historical data for a security.

Create a Thomson Reuters Tick History connection by using a user name and password. The appearance of the connection object c in the MATLAB workspace indicates a successful connection.

username = 'username';
password = 'password';
c = trth(username,password);

Retrieve historical data for the IBM® security. Using the history function, retrieve the open and closing prices for the prior day.

sec = ["IBM.N","Ric"];
fields = ["Open";"Last"];
startdate = datetime('yesterday');
enddate = datetime('today');

d = history(c,sec,fields,startdate,enddate)
d =

  1×2 timetable

       Time        Open      Last 
    __________    ______    ______

    2017/11/02    154.25    153.35

d is a timetable that contains these variables:

  • Date for the prior day

  • Open price

  • Closing price

Introduced in R2018a