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$
1
  • $\begingroup$ Aren't you looking for ATD-B.TO? $\endgroup$ Commented Jan 30, 2017 at 21:44

1 Answer 1

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$
3
  • $\begingroup$ HI: OK, that works for most except there are a few securities that are still causing problems. $\endgroup$
    – spindoctor
    Commented Jan 31, 2017 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
    Commented Jan 31, 2017 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$
    – nbbo2
    Commented Jan 31, 2017 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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