Main Content

trth

Tick History from Refinitiv connection

Description

The trth function creates a trth object, which represents a Tick History from Refinitiv™ connection. This connection uses the 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

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

example

Input Arguments

expand all

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

Example: 'password'

Data Types: char | string

Properties

expand all

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

Example: 'username'

Data Types: char | string

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

Example: 100

Data Types: double

Object Functions

historyTick History from Refinitiv historical data
timeseriesTick History from Refinitiv intraday data

Examples

collapse all

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

Create a 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

Tips

  • To access the latest Refinitiv API with the trth function, use Datafeed Toolbox™ R2022a or later.

Version History

Introduced in R2018a