Datafeed problem - yahoo finance cant find stock ?

1 view (last 30 days)
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 Comment
Kevin Connor
Kevin Connor on 7 Nov 2013
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.

Sign in to comment.

Answers (1)

Kawee Numpacharoen
Kawee Numpacharoen on 2 Nov 2016
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');

Categories

Find more on Financial Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!