history
Tick History from Refinitiv historical data
Description
returns historical data using: d = history(c,sec,fields,startdate,enddate)
Tick History from Refinitiv™ connection object
Refinitiv securities (for example, Reuters® Instrument Codes, or RICs)
Refinitiv historical fields
Start date for the beginning of the historical date range
End date for the end of the historical date range
Examples
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.35d is a timetable that contains these variables:
Date for the prior day
Open price
Closing price
Use a Tick History connection to retrieve historical data for two securities.
Create a Tick History from Refinitiv 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 and Ford Motor Company® securities. Using the history function,
retrieve the open and closing prices for the days in the date range from
October 30, 2017, through November 3, 2017.
sec = ["IBM.N","Ric";"F.N","Ric"]; fields = ["Open";"Last"]; startdate = datetime('10/30/2017','InputFormat','MM/dd/yyyy'); enddate = datetime('11/03/2017','InputFormat','MM/dd/yyyy'); d = history(c,sec,fields,startdate,enddate)
d =
10×2 timetable
Time Open Last
__________ ______ ______
2017/10/30 153.76 154.36
2017/10/31 154.26 154.06
2017/11/01 153.97 154.03
2017/11/02 154.25 153.35
2017/11/03 153.36 151.58
2017/10/30 12.00 12.10
2017/10/31 12.14 12.27
2017/11/01 12.40 12.35
2017/11/02 12.33 12.42
2017/11/03 12.40 12.36d is a timetable that contains these variables:
Date in the date range
Open price
Closing price
The first five rows contain data for the IBM security. The next five rows contain data for the Ford Motor Company security.
Input Arguments
Tick History from Refinitiv connection, specified as a connection object created with trth.
Security, specified as an N-by-2 string array or cell array of character
vectors. The first column of the string array or cell array identifies the security. The
second column identifies the type of security (for example, Reuters Instrument Code, or RIC).
Example: ["IBM.N","Ric"]
Data Types: string | cell
Fields, specified as a string array or cell array of character vectors. Specify Refinitiv historical fields to retrieve historical data. You can search for fields in MyRefinitiv.
Example: ["Low";"Last";"Volume"]
Data Types: string | cell
Start date of the date range, specified as a datetime array, string scalar, character vector, or numeric scalar.
Example: datetime('yesterday')
Data Types: double | char | string | datetime
End date of the date range, specified as a datetime array, string scalar, character vector, or numeric scalar.
Example: datetime('today')
Data Types: double | char | string | datetime
Output Arguments
Historical data from Tick History, returned as a timetable. Except for the
Time variable, each variable in the timetable
corresponds to a specified field in the fields input
argument.
Version History
Introduced in R2018a
See Also
External Websites
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)