主要内容

timeseries

Retrieve Money.Net intraday and historical data

描述

example

d=时间(时间)(c,s,日期,间隔)使用Money.NET连接返回Money.NET室内和历史数据cfor all available fields. Specify the Money.Net symbols以及当前或历史日期。要指定返回的数据量,请使用条间隔。

example

d=时间(时间)(c,s,日期,间隔,f)returns Money.Net intraday and historical data for the specified Money.Net fieldsf

例子

全部收缩

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 datadfor 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

dis 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 datadfor 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

dis 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);

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

dis a table that contains these columns:

  • 日期timestamp

  • 高价

  • 低价

Close the Money.Net connection.

close(c)

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

dis a table that contains these columns:

  • 日期timestamp

  • 高价

  • 低价

Close the Money.Net connection.

close(c)

Input Arguments

全部收缩

Money.net连接, specified as a connection object created usingmoneynet

Money.net符号,指定为字符向量,字符向量的单元格数组或字符串标量表示一个符号。

例子:“ IBM”

Data Types:char|细胞|string

日期,指定为约会时间数组,字符向量,字符向量的单元格数组,双,字符串标量或字符串数​​组。如果日期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

间隔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

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

全部收缩

Money.Net data, returned as a table. Each row in the table represents data at different times. The first column日期是时间戳。其余列包含每个Money.NET字段的一列数据f

To return data for all available historical fields, use this syntax:

d = limeseries(c,s,日期,间隔);

Money.NET仅在交易活动的工作日返回数据。

Version History

Introduced in R2016b