Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

timeseries

Retrieve Money.Net intraday and historical data

Syntax

d = timeseries(c,s,date,interval)
d = timeseries(c,s,date,interval,f)

Description

example

d = timeseries(c,s,date,interval) returns Money.Net intraday and historical data using the Money.Net connection c for all available fields. Specify the Money.Net symbol s and the current or historical date. To specify the amount of data to return, use the bar interval.

example

d = timeseries(c,s,date,interval,f) returns Money.Net intraday and historical data for the specified Money.Net fields f.

Examples

collapse all

Create Money.Net connection c using a user name and password.

username = 'user@company.com';
pwd = '999999';

c = moneynet(username,pwd);

Retrieve intraday data for the last 5 minutes in 30-second bars for the symbol IBM® using the Money.Net connection c. Specify the date as a datetime array containing a date range with start and end dates. The start date starts 5 minutes after the current moment. The end date is the current moment. To specify the current moment, use datetime('now'). To specify 5 minutes earlier, subtract minutes(5) from the current moment. To retrieve data in 30-second bars, specify the interval as '30S'.

s = 'IBM';
date = [datetime('now')-minutes(5) datetime('now')];
interval = '30S';

d = timeseries(c,s,date,interval);

Display the first three rows of intraday data d 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:

  • Date timestamp

  • High price

  • Low price

  • Open price

  • Close price

  • Trading volume

Close the Money.Net connection.

close(c)

Create Money.Net connection c using a user name and password.

username = 'user@company.com';
pwd = '999999';

c = moneynet(username,pwd);

Retrieve intraday data for yesterday in 30-minute bars for the symbol IBM using the Money.Net connection c. Specify the date as yesterday using datetime. To retrieve data in 30-minute bars, specify the interval as '30M'.

s = 'IBM';
date = datetime('yesterday');
interval = '30M';

d = timeseries(c,s,date,interval);

Display the first three rows of intraday data d 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:

  • Date timestamp

  • High price

  • Low price

  • Open price

  • Close price

  • Trading volume

Close the Money.Net connection.

close(c)

Create Money.Net connection c using a user name and password.

username = 'user@company.com';
pwd = '999999';

c = moneynet(username,pwd);

Retrieve historical data in daily bars for the symbol IBM using the Money.Net 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);

Display the first three rows of daily data d.

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:

  • Date timestamp

  • High price

  • Low price

Close the Money.Net connection.

close(c)

Create Money.Net connection c using a user name and password.

username = 'user@company.com';
pwd = '999999';

c = moneynet(username,pwd);

Retrieve historical data in weekly bars for the symbol IBM using the Money.Net connection c. Specify the date range from June 1, 2015 through June 30, 2015 using datetime. To retrieve weekly data, specify the interval as '7D'. Retrieve only the high and low price fields f from Money.Net.

s = 'IBM';
date = [datetime('1-Jun-2015') datetime('30-Jun-2015')];
interval = '7D';
f = {'High','Low'};

d = timeseries(c,s,date,interval,f);

Display the first three rows of weekly data d.

d(1:3,:)
ans = 

          Date            High      Low  
    _________________    ______    ______

    06/01/15 00:00:00    171.56    167.20
    06/08/15 00:00:00    170.44    163.37
    06/15/15 00:00:00    168.72    164.25

d is a table that contains these columns:

  • Date timestamp

  • High price

  • Low price

Close the Money.Net connection.

close(c)

Input Arguments

collapse all

Money.Net connection, specified as a connection object created using moneynet.

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, 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 between bars, specified as a character vector or string scalar. Specify the interval as a number followed by one of these letters: S, M, and D. These letters indicate seconds, minutes, and days, respectively. For example, 30S is 30-second bars and 1D is daily end-of-day data.

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' or the corresponding field definition 'High'. When using the field definition, the software ignores the case of the definition. To view the list of valid Money.Net fields and field definitions, see the Money.Net API Documentation.

Example: 'High'

Example: {'High','Low'}

Data Types: char | cell | string

Output Arguments

collapse all

Money.Net data, returned as a table. Each row in the table represents data at different times. The first column Date is the timestamp. The remaining columns contain one column 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.

Introduced in R2016b

Was this topic helpful?