Datafeed problem - yahoo finance cant find stock ?
1 次查看(过去 30 天)
显示 更早的评论
I am trying to get data on a bunch of danish stocks, fx. the Ap Moeller Maersk B stock. I am using the code
C = yahoo;
name = 'MAERSK-B.CO';
Price.(name) = fetch(C,name,'Adj Close',startDate,endDate,'d');
But am receiving an error, the problem i think is with the name, though i found it on the yahoo finance webpage it seems odd when compared to the tickers i have that does work (like 'CABGY' for carlsberg fx.)
1 个评论
Kevin Connor
2013-11-7
dftool statement will enable a GUI from which these stocks an be downloaded. I have same issue with Australian stocks ( eg BHP.AX ) where the fetch statement appears not to recognize a stock ticker with a ".xx" type extension.
回答(1 个)
Kawee Numpacharoen
2016-11-2
The problem is not in the fetch function, but in the struct's name. You can easily fix it here:
C = yahoo;
name = 'MAERSK-B.CO';
name2 = strrep(name, '.', '_')
name2 = strrep(name2, '-', '_')
Price.(name2) = fetch(C,name,'Adj Close',today-10,today,'d');
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Web Services 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!