Dear guys,
I Have a problem when I import data from Yahoo (e.g. stock data). This is quite frustrating.
For the non-stock guys: a ticker is a code (a name) for a stock. And C = yahoo, tells Matlab to import data from Yahoo…
Let me proceed: I use the following code to import stock data for three stocks:
C = yahooticker = { 'GOOG' 'AA' 'AXP' } % ticker codes of stocks
for i = 1:3Price.(ticker{i}) = fetch(C, ticker(i), 'Adj Close', 'Jan 5 10', 'Aug 1 13', 'm'); % 'steal' the individual stock data (all other ' ' information is just the time-series lenght and other finance stuff).
temp = Price.(ticker{i}); % take the individual stock price
ClosePrice(:,i) = temp(:,2); % and collect it in one matrix (only use second column because we do not need the first one)
end
This works great and provide me with great data. However, my problem arrives when I use another ticker code from Yahoo (which should be perfectly legal and fine)…
For example if I instead useticker = { 'DANSKE.CO' 'AA' 'AXP' },
in the same code, I will get the following error:
"Invalid field name: 'DANSKE.CO'."
It looks like it does not like the 'dot' in the ticker code. But 'DANSKE.CO' should be a perfectly legal ticker at Yahoo, and nevertheless: it also works with the Matlab 'dftool' command (another way to import data from Yahoo)…
Any suggestions?
hope to hear from someone, – thanks in advance.
All the best
Mergh
Best Answer