timeseries
Retrieve Money.Net intraday and historical data
描述
例子
在几秒钟内检索日内数据
Create Money.Net connectionc
使用用户名和密码。
username ='user@company.com';PWD ='999999';C = MoneyNet(用户名,PWD);
Retrieve intraday data for the last 5 minutes in 30-second bars for the symbol IBM®使用Money.net连接c
。Specify the date as a约会时间
数组包含具有开始日期和结束日期的日期范围。开始日期在当前时刻开始5分钟。结束日期是当前时刻。要指定当前时刻,请使用约会时间('now')
。To specify 5 minutes earlier, subtractminutes(5)
from the current moment. To retrieve data in 30-second bars, specify the interval as“ 30年代”
。
s ='IBM';date = [dateTime('now')-minutes(5) datetime('now');间隔=“ 30年代”;d = limeseries(c,s,日期,间隔);
Display the first three rows of intraday datad
for all valid Money.Net fields.
d(1:3,:)
ans = Date High Low Open Close Volume _________________ ______ ______ ______ ______ _______ 05/09/16 13:30:30 147.52 147.48 147.48 147.51 2763.00 05/09/16 13:31:00 147.53 147.50 147.50 147.52 7241.00 05/09/16 13:31:30 147.54 147.51 147.51 147.53 5608.00
d
is a table that contains these columns:
日期timestamp
高价
低价
Open price
关闭价格
交易量
Close the Money.Net connection.
close(c)
在几分钟内检索日内数据
Create Money.Net connectionc
使用用户名和密码。
username ='user@company.com';PWD ='999999';C = MoneyNet(用户名,PWD);
使用Money.NET连接检索昨天在30分钟的符号IBM中检索昨天的盘中数据c
。Specify the date as yesterday using约会时间
。要在30分钟的条中检索数据,请将间隔指定为'30M'
。
s ='IBM';date = dateTime('昨天'); interval ='30M';d = limeseries(c,s,日期,间隔);
Display the first three rows of intraday datad
for all valid Money.Net fields.
d(1:3,:)
ans = Date High Low Open Close Volume _________________ ______ ______ ______ ______ _______ 05/06/16 08:00:00 145.22 145.07 145.07 145.22 2455.00 05/06/16 08:30:00 144.66 144.66 144.66 144.66 300.00 05/06/16 09:00:00 145.00 144.90 144.90 145.00 4758.00
d
is a table that contains these columns:
日期timestamp
高价
低价
Open price
关闭价格
交易量
Close the Money.Net connection.
close(c)
Retrieve Daily Historical Data for Specified Fields
Create Money.Net connectionc
使用用户名和密码。
username ='user@company.com';PWD ='999999';C = MoneyNet(用户名,PWD);
Retrieve historical data in daily bars for the symbol IBM using the Money.Net connectionc
。Specify the date range from June 1, 2015, through June 5, 2015, using约会时间
。要检索每日数据,请指定间隔为'1D'
。仅检索高价和低价领域f
来自Money.net。
s ='IBM';date = [dateTime('1-Jun-2015') datetime('2015年6月5日');间隔='1D';f = {'High','Low'}; d = timeseries(c,s,date,interval,f);
Display the first three rows of daily datad
。
d(1:3,:)
ans = Date High Low _________________ ______ ______ 06/01/15 00:00:00 171.04 169.03 06/02/15 00:00:00 170.45 168.43 06/03/15 00:00:00 171.56 169.63
d
is a table that contains these columns:
日期timestamp
高价
低价
Close the Money.Net connection.
close(c)
Retrieve Weekly Historical Data for Specified Fields
Create Money.Net connectionc
使用用户名和密码。
username ='user@company.com';PWD ='999999';C = MoneyNet(用户名,PWD);
Retrieve historical data in weekly bars for the symbol IBM using the Money.Net connectionc
。Specify the date range from June 1, 2015 through June 30, 2015 using约会时间
。To retrieve weekly data, specify the interval as'7d'
。仅检索高价和低价领域f
来自Money.net。
s ='IBM';date = [dateTime('1-Jun-2015') datetime('30 -Jun-2015');间隔='7d';f = {'High','Low'}; d = timeseries(c,s,date,interval,f);
显示前三行的每周数据d
。
d(1:3,:)
ans =日期高_________________ ______ ______ 06/01/15 00:00:00:00 171.56 167.20 06/08/15 00:00:00:00:00 170.44 170.44 163.37 06/15/15/15 00:00:00:00:00:00 168.72 168.72 164.25
d
is a table that contains these columns:
日期timestamp
高价
低价
Close the Money.Net connection.
close(c)
Input Arguments
c
—Money.net连接
connection object
Money.net连接, specified as a connection object created usingmoneynet
。
s
—Money.Net symbol
character vector|字符矢量的细胞阵列|string scalar
Money.net符号,指定为字符向量,字符向量的单元格数组或字符串标量表示一个符号。
例子:“ IBM”
Data Types:char
|细胞
|string
日期
—日期
约会时间
大批|character vector|字符矢量的细胞阵列s|双倍的|string scalar|字符串数组
日期,指定为约会时间
数组,字符向量,字符向量的单元格数组,双,字符串标量或字符串数组。如果日期
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日期
contains two dates, the first date is the start date and the second date is the end date.
例子:约会时间('yesterday')
Data Types:约会时间
|char
|细胞
|双倍的
|string
间隔
—间隔
character vector|string scalar
间隔between bars, specified as a character vector or string scalar. Specify the interval as a number followed by one of these letters:S
,M
, 和D
。这些字母分别表示秒,分钟和几天。例如,30年代
是30秒的酒吧和1D
是日常数据。
Data Types:char
|string
f
—Money.Net data field list
character vector|字符矢量的细胞阵列s|string scalar|字符串数组
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"
或相应的字段定义“高的”
。使用字段定义时,软件会忽略定义的情况。要查看有效货币的列表。NET字段和字段定义,请参见Money.Net API Documentation。
例子:“高的”
例子:["High" "Low"]
Data Types:char
|细胞
|string
Output Arguments
Version History
matlab命令
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.
选择一个网站
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:。
您还可以从以下列表中选择一个网站:
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.
美洲
- AméricaLatina(Español)
- 加拿大(英语)
- 美国(英语)