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
Retrieve Historical Data for One Security
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
Retrieve Historical Data for Two Securities
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.36
d
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
c
— Tick History from Refinitiv connection
connection object
Tick History from Refinitiv connection, specified as a connection object created with trth
.
sec
— Security
string array | cell array of character vectors
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
— Fields
string array | cell array of character vectors
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
startdate
— Start date
datetime
array | string scalar | character vector | numeric scalar
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
enddate
— End date
datetime
array | string scalar | character vector | numeric scalar
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
d
— Historical data
timetable
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
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)