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')

• Aren't you looking for ATD-B.TO? – Forgottenscience Jan 30 '17 at 21:44

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.

• HI: OK, that works for most except there are a few securities that are still causing problems. – spindoctor Jan 31 '17 at 14:14
• 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? – spindoctor Jan 31 '17 at 14:15
• 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? – noob2 Jan 31 '17 at 16:32