timeseries
Description
Examples
Retrieve Intraday Data in Minutes
Create Money.Net web socket interface connection c
using a user name
and password.
username = "user@company.com"; pwd = "999999"; c = moneynetws(username,pwd);
Retrieve intraday data for yesterday in 5-minute bars for the
symbol Google® using the Money.Net web socket interface
connection c
. Specify the date as 1 hour ago
using datetime
. To retrieve data in
5-minute bars, specify the interval as
"5M"
.
s = "GOOG"; date = [datetime("now")-hours(1) datetime("now")]; interval = "5M"; d = timeseries(c,s,date,interval);
d
is a table that contains these variables:
Date timestamp
High price
Close price
Low price
Open price
Trading volume
Close the Money.Net web socket interface connection.
close(c)
Retrieve Daily Historical Data for Specified Fields
Create Money.Net web socket interface connection c
using a user name
and password.
username = "user@company.com"; pwd = "999999"; c = moneynetws(username,pwd);
Retrieve historical data in daily bars for the symbol
IBM® using the Money.Net web socket interface
connection c
. Specify the date range from
June 1, 2015, through June 5, 2015, using
datetime
. To retrieve daily data,
specify the interval as "1D"
. Retrieve only
the high and low price fields f
from
Money.Net.
s = "IBM"; date = [datetime("1-Jun-2015") datetime("5-Jun-2015")]; interval = "1D"; f = ["high" "low"]; d = timeseries(c,s,date,interval,f);
d
is a table that contains these variables:
Date timestamp
High price
Low price
Close the Money.Net web socket interface connection.
close(c)
Input Arguments
c
— Money.Net web socket interface connection
moneynetws
object
Money.Net web socket interface connection, specified as a moneynetws
object created using the moneynetws
function.
s
— Money.Net symbol
character vector | cell array of character vector | string scalar
Money.Net symbol, specified as a character vector, cell array of a character vector, or string scalar to denote one symbol.
Example: "IBM"
Data Types: char
| cell
| string
date
— Date
datetime
array | character vector | cell array of character vectors | double | string scalar | string array
Date, specified as a datetime
array,
character vector, cell array of character vectors, double,
string scalar, or string array. If date
contains one date, this date is the start date. The software
determines the end date to be the last second of the same day.
If date
contains two dates, the first date is
the start date and the second date is the end date.
Example: datetime("yesterday")
Data Types: datetime
| char
| cell
| double
| string
interval
— Interval
character vector | string scalar
Interval between bars, specified as a character vector or string
scalar. Specify the interval as a number followed by one of
these letters: S
, M
, or
D
. These letters indicate seconds,
minutes, and days, respectively. For example,
30M
is 30-minute bars and
1D
is daily end-of-day data.
Data Types: char
| string
f
— Money.Net data field list
character vector | cell array of character vectors | string scalar | string array
Money.Net data field list, specified as a character vector, cell array of character vectors, string scalar, or a string array. To specify one field, use a character vector or string scalar. To specify multiple fields, use a cell array of character vectors or a string array.
Specify the field by using the single character or the field
definition. For example, to specify the highest price for the
equity during the current trading day, use a single character
"H"
or the corresponding field
definition "high"
. When using the field
definition, the software ignores the case of the
definition.
Example: "high"
Example: ["high" "low"]
Data Types: char
| cell
| string
Output Arguments
d
— Money.Net data
timetable
Money.Net data, returned as a timetable. Each row in the table
represents data at different times. The first variable
bar
is the timestamp. The remaining
variables contain one variable of data for each Money.Net field
f
.
To return data for all available historical fields, use this syntax:
d = timeseries(c,s,date,interval);
Money.Net returns data only for business days with trading activity.
Version History
Introduced in R2021b
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.
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)