Yahoo Finance and Quandl data downloader

版本 1.131 (545.4 KB) 作者: Artem Lensky
YahooFinance/Quandl data downloader
6.8K 次下载
更新时间 2021/3/7
The toolbox contains two functions:
(a) getMarketDataViaYahoo()
% INPUT:
% symbol - is a ticker symbol i.e. 'AMD', 'BTC-USD'
% startdate - the market data will be requested from this data
% enddate - the market data will be requested till this date
% interval - the market data will be returned in this intervals
% supported intervals are '1d', '5d', '1wk', '1mo', '3mo'
%
% OUTPUT:
% data - is a retrieved dataset returned as a table
data = getMarketDataViaYahoo('AMD', '1-Jan-2018', datetime('today'), '5d'); % Downloads AMD share historic price
(b) getMarketDataViaQuandl()
% INPUT:
% set_name - is a dataset name e.g. 'WIKI/AAPL'
% startdate - the market data will be requested from this data
% enddate - the market data will be requested till this date
% collapse - the market data will be returned in this intervals
% supported intervals are 'daily', 'weekly', 'monthly', 'quarterly', 'annual'
% key - user's api key
%
% OUTPUT:
% data - is a retrieved dataset returned as a table
opec_orb_raw = getMarketDataViaQuandl('OPEC/ORB', '1-Jan-2018', date(), 'weekly'); % Downloads historic OPEC basket price from Quandl
For a complete list of free datasets provided by Quandl check https://www.quandl.com/search?filters=%5B%22Free%22%5D
Examples:
(a) Yahoo Finance
disp('Request historical YTD Bitcoin price and plot Close, High and Low');
initDate = '1-Jan-2018';
symbol = 'BTC-USD';
btcusd = getMarketDataViaYahoo(symbol, initDate);
btcusdts = timeseries([btcusd.Close, btcusd.High, btcusd.Low], datestr(btcusd(:,1).Date));
btcusdts.DataInfo.Units = 'USD';
btcusdts.Name = symbol;
btcusdts.TimeInfo.Format = "dd-mm-yyyy";
plot(btcusdts);
legend({'Close', 'High', 'Low'});
(b) Quandl
dataset = 'LBMA/GOLD';
initDate = '1-Jan-2018';
lbma_gold_raw = getMarketDataViaQuandl(dataset, initDate, date(), 'daily');
lbma_gold_ts = timeseries(lbma_gold_raw.("EURO(AM)"), datestr(lbma_gold_raw.Date));
lbma_gold_ts.DataInfo.Units = 'USD';
lbma_gold_ts.Name = dataset;
lbma_gold_ts.TimeInfo.Format = "dd-mm-yyyy";
figure, plot(lbma_gold_ts);

引用格式

Artem Lensky (2024). Yahoo Finance and Quandl data downloader (https://github.com/Lenskiy/Yahoo-Quandl-Market-Data-Donwloader/releases/tag/v1.131), GitHub. 检索来源 .

MATLAB 版本兼容性
创建方式 R2018a
兼容任何版本
平台兼容性
Windows macOS Linux
致谢

启发作品: Yahoo! Finance Data Loader

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

无法下载基于 GitHub 默认分支的版本

版本 已发布 发行说明
1.131

See release notes for this release on GitHub: https://github.com/Lenskiy/Yahoo-Quandl-Market-Data-Donwloader/releases/tag/v1.131

1.130

.

1.13

Added Big Mac example

1.12

* removes rows with missing values

1.11

The function has been updated according to the new Yahoo interface.

1.03

Data older than 1970 can now be downloaded.

1.02

Seems crumb value is not required anymore, hence now the function continues even if crumb is not found.

1.01

Thanks to Christian, Xiang Chen Fixed, Ryan Hendry for pointing out the bug. The most recent sample was not loaded. The problem was in two slightly different formats data is returned by Quandl and Yahoo. The bug is fixed.

0.934

Fixed a bug

0.933

.

0.932

Fixed a bug in getMarketDataViaQuandl()

0.931

.

0.93

fixed bug in getMarketDataViaQuandl()

0.92

Added Quandl data downloader

0.91

404 error has been dealt with

0.9

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库