history
从数据流Web服务来自再镀金
句法
Description
[[
返回ad
,,,,response
] =历史(___)回应
包含错误消息的对象。要访问错误消息,请参阅访问datastream Web服务错误消息。
Examples
Retrieve Historical Data for Security
Use a Datastream Web Services connection to retrieve historical data for the specified security.
使用您的用户名和密码创建DataStream Web服务连接。
用户名='abcdef';password ='abcdef12345';C= datastreamws(username,password)
c =带有属性的datastreamws:用户名:'abcdef'超时:100
C
is theDataStreamws
Connection object with the用户名
andTimeOut
特性。这用户名
property contains the specified user name. TheTimeOut
property specifies waiting for a maximum of 100 seconds to return historical data before canceling the request.
调整显示格式显示货币。
format银行
检索去年的历史末日数据数据。指定VOD
秒urity.d
is a timetable that contains the date in the first variable and the end-of-day price in the second variable.
sec ='VOD';d=历史(C,,,,秒);
Display the first few prices.
head(d)
ANS = 8×1时间表时间VOD ______________________________________________________________________00:00:00 202.95 04-May-2017-2017 00:00:00:00 203.70 203.70 05-May-2017 00:00:00:00 204.95 08-May-2017-2017-2017 00:May-2017 00:00:00 205.15 09-May-2017 00:00:00 205.15 10-May-2017-2017 00:00:00:00 206.60 11-May-2017 00:00:00:00:00 206.25 2017年5月12日至2017年5月12日211.05:00 211.05:00
Use the end-of-day prices to make investment decisions for theVOD
秒urity.
返回指定字段和日期的历史数据
使用DataStream Web服务连接来检索指定安全性,字段和日期的历史数据。
使用您的用户名和密码创建DataStream Web服务连接。C
is theDataStreamws
Connection object.
用户名='abcdef';password ='abcdef12345';C= datastreamws(username,password);
调整显示格式显示货币。
format银行
Retrieve and display historical end-of-day price data for March 29, 2018. Specify theVOD
秒urity and these fields:
开头
High price
Last closing price
d
是第一个变量中的日期和后续变量中的字段的时间表。
sec ="VOD";字段= [“ po”;"PH";"P"];date = datetime('03 -29-2018',,,,'InputFormat',,,,'MM-dd-yyyy');D =历史记录(C,SEC,字段,日期)
d= 1×3 timetable Time PO PH P ____________________ ______ ______ ______ 29-Mar-2018 00:00:00 194.94 196.01 194.22
Use the end-of-day prices for each field to make investment decisions for theVOD
秒urity.
Return Historical Data for Date Range
使用DataStream Web服务连接来检索指定安全性,字段和日期范围的历史数据。
使用您的用户名和密码创建DataStream Web服务连接。C
is theDataStreamws
Connection object.
用户名='abcdef';password ='abcdef12345';C= datastreamws(username,password);
调整显示格式显示货币。
format银行
Retrieve historical end-of-day price data from April 1, 2018, through April 30, 2018. Specify theVOD
秒urity and these fields:
开头
High price
Last closing price
d
是第一个变量中的日期和后续变量中的字段的时间表。
sec ="VOD";字段= [“ po”;"PH";"P"];StartDate = DateTime('04-01-2018',,,,'InputFormat',,,,'MM-dd-yyyy');enddate = dateTime('04-30-2018',,,,'InputFormat',,,,'MM-dd-yyyy');d=历史(C,,,,秒,,,,字段,,,,开始日期,,,,enddate);
Display the first few prices.
head(d)
ans = 8×3 timetable Time PO PH P ____________________ ______ ______ ______ 02-Apr-2018 00:00:00 NaN NaN 194.22 03-Apr-2018 00:00:00 193.70 194.15 193.90 04-Apr-2018 00:00:00 196.64 198.10 197.22 05-Apr-2018 00:00:00 200.45 203.90 203.65 06-Apr-2018 00:00:00 203.15 205.15 204.00 09-Apr-2018 00:00:00 204.35 205.45 203.65 10-Apr-2018 00:00:00 204.45 205.90 205.60 11-Apr-2018 00:00:00 205.50 207.70 206.30
Use the end-of-day prices for each field to make investment decisions for theVOD
秒urity.
使用时期返回历史数据
Use a Datastream Web Services connection to retrieve historical data for the specified security, fields, date range, and period.
使用您的用户名和密码创建DataStream Web服务连接。C
is theDataStreamws
Connection object.
用户名='abcdef';password ='abcdef12345';C= datastreamws(username,password);
调整显示格式显示货币。
format银行
从2017年1月1日到2017年12月31日检索并显示历史结束价格数据。VOD
秒urity and these fields:
开头
High price
Last closing price
Specify a quarterly period.d
是第一个变量中的日期和后续变量中的字段的时间表。
sec ="VOD";字段= [“ po”;"PH";"P"];StartDate = DateTime('01 -01-2017',,,,'InputFormat',,,,'MM-dd-yyyy');enddate = dateTime('12 -31-2017',,,,'InputFormat',,,,'MM-dd-yyyy');period ='Q';d =历史记录(C,sec,fields,startdate,enddate,ofende of enec)
d = 4×3时间表时间po ph p ____________________________________________________________________________- 00:00:00 nan nan Nan 199.85 01-apr-2017 00:00:00:00 209.00 209.00 209.10 206.10 206.65 01-JUL-JUL-2017 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00217.65 219.20 218.70 01-OCT-2017 00:00:00 209.35 211.60 210.50
Use the quarterly prices for each field to make investment decisions for theVOD
秒urity.
输入参数
C
-DataStream Web服务连接
DataStreamws
目的
DataStream Web服务连接,,,,specified as aDataStreamws
目的。
秒
-安全
角色向量|字符向量的单元格数|字符串标量|细绳array
安全性,指定为字符向量,字符向量的单元格数组,字符串标量或字符串数组。使用字符向量或字符串标量来指定一个安全性。使用字符向量或字符串数组的单元格数组来指定多个证券。对于组成列表,请在秒
例如,输入参数“ LFTSE100”
。
Example:"VOD"
数据类型:Char
|细绳
|Cell
字段
-Field list
角色向量|字符向量的单元格数|字符串标量|细绳array
字段列表,指定为字符向量,字符向量的单元格数组,字符串标量或字符串数组。使用字符向量或字符串标量来指定一个字段。使用字符向量或字符串数组的单元格数组来指定多个字段。
Example:[“ pH”,“ po”,“ p”]
数据类型:Char
|细绳
|Cell
date
-Date
datetime
array|numeric scalar|字符串标量|角色向量
Date, specified as adatetime
数组,数字标量,字符串标量或字符向量。Use this date to retrieve historical data for a specific day.
Example:datetime('03 -29-2018','inputformat','mm-dd-yyyy')
数据类型:double
|Char
|细绳
|datetime
开始日期
-Start date
datetime
array|numeric scalar|字符串标量|角色向量
Start date of a date range, specified as adatetime
数组,数字标量,字符串标量或字符向量。这default start date is the first date of available historical data for the specified security秒
。
Example:datetime('04 -01-2018','inputformat','mm-dd-yyyy')
数据类型:double
|Char
|细绳
|datetime
enddate
-结束日期
datetime
array|numeric scalar|字符串标量|角色向量
结束日期of a date range, specified as adatetime
数组,数字标量,字符串标量或字符向量。默认结束日期是指定安全性的最新可用历史数据可用日期秒
。
Example:datetime('04-30-2018','InputFormat','MM-dd-yyyy')
数据类型:double
|Char
|细绳
|datetime
period
-Period
'D'
|' W '
|'M'
|'Q'
|'Y'
时期,指定为以下值之一:
'D'
- 日常的' W '
- 每周'M'
-Monthly'Q'
-Quarterly'Y'
-Yearly
您可以将值指定为字符向量或字符串标量。默认期限取决于指定的安全性秒
。
输出参数
d
- 历史数据
timetable | table
历史数据,作为时间表或表格返回。这history
功能返回带有数据安全性的时间表。对于多个证券,history
函数仅返回第一个语法的时间表和其他语法的嵌套时间表表。要访问其中一个嵌套时间表,请使用点符号,例如d。VOD
。
response
-Response message
matlab.net.http.Responsemessage
响应消息,返回为matlab.net.http.Responsemessage
目的。这回应
对象包含一个错误消息。要访问错误消息,请参阅访问datastream Web服务错误消息。
版本历史记录
matlabコマンド
Matlabコマンドコマンドにするがクリックされまし。。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
选择一个网站以获取可用的翻译内容,并查看本地事件和优惠。根据您的位置,我们建议您选择:。
You can also select a web site from the following list:
如何获得最佳网站性能
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
Americas
- América Latina(Español)
- Canada(English)
- United States(English)