2
$\begingroup$

Hi: I'm using R to start learning about quantitative finance. I'm good at R, just learning finance. Some stocks on the TSX have periods in their names, usually indicating that it's a class B share, for example. The usual functions to download stock data seem to crash on these characters. Thoughts?

#load library
library(fImport)
library(quantmod)
#these work
yahooSeries(symbols='AQN')
getSymbols('AQN', src='yahoo')
#These don't
yahooSeries(symbols='ATD.B')
getSymbols('ATD.B', src='yahoo')
$\endgroup$
  • $\begingroup$ Aren't you looking for ATD-B.TO? $\endgroup$ – Forgottenscience Jan 30 '17 at 21:44
0
$\begingroup$

I believe your symbol ATD.B is returning not found. In Yahoo a dot usually precedes the Exchange (eg. AQN.TO refers to Algonquin, Toronto Exchange). A minus sign (or dash) precedes the class: e.g. RDS-B refers to Royal Dutch, class B. So Try using ATD-B or ATD-B.TO instead of ATD.B.

$\endgroup$
  • $\begingroup$ HI: OK, that works for most except there are a few securities that are still causing problems. $\endgroup$ – spindoctor Jan 31 '17 at 14:14
  • $\begingroup$ For example, securities that are labelled "-UN.TO" are choking on this. But when I go to the Yahoo Finance website, they do just fine. Examples: BBU-UN.TO and NVU-UN.TO. It seems like these are both real estate trusts. Thoughts? $\endgroup$ – spindoctor Jan 31 '17 at 14:15
  • $\begingroup$ Interestingly enough I was unable to download a history .csv file for BBU-UN even through manual web site lookup (although I was able to get yesterday's quote). Maybe a problem with Yahoo? Or they just don't have history for these stocks? $\endgroup$ – noob2 Jan 31 '17 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.