joshuaulrich / quantmod

Quantitative Financial Modelling Framework
http://www.quantmod.com/
GNU General Public License v3.0
798 stars 219 forks source link

the error for unknown symbols is terrible #333

Closed peterccarl closed 3 years ago

peterccarl commented 3 years ago

Description

When I ask for a symbol that might make sense to someone familiar with Yahoo website symbology, I get an obscure error message:

getSymbols("^SPX") Warning: ^SPX download failed; trying again. Error in getSymbols.yahoo(Symbols = "^SPX", env = , verbose = FALSE, : Unable to import “^SPX”. argument "conn" is missing, with no default

Eventually, I figure out (usually by asking Josh directly) that that's a stupid user error: the spx ticker on Yahoo is "^gspc". D'oh!

Expected behavior

Tell me that the symbol isn't found.

Session Info

I'm using version 0.4.18

joshuaulrich commented 3 years ago

Thanks for the report! I'll step through the code to see where this breaks and throw a more informative error.