5

I've been using quantmods getSymbols function a lot and would like to reduce the load on the external data providers and reduce the time it takes to execute longer code loops because of network latency.

Ideal would be a function that takes a list of symbols (like getSymbols), downloads them from the provider configured in 'setSymbolLookup' and saves them in a MySQL database for easy retrieval later using getSymbols.MySQL.

A major bonus would be if another function (or the same one) allowed only downloading the difference since the last update.

Alternatively a type of proxy where the symbol is downloaded if it doesn't already exist in a local MySQL database/cache would also be good.

Has anyone developed something like this, or come across any documentation on how to do it? I've searched around but the closest I can get are some questions about how to use MySQL as an input source.

Thanks in advance!

psandersen
  • 113
  • 1
  • 5
  • setDefaults(getSymbols.MySQL) and then set it as src? I'm pretty sure it's in the documentation. – Hansi Mar 16 '12 at 23:21
  • @Hansi I think the question is for something that still fetches from the external source, but _caches_ the data in the local MySQL DB. AFAIK quantmod does not do that, and I've not see anything that does. – Darren Cook Mar 18 '12 at 09:21
  • 1
    Thanks for the comments, @DarrenCook is right. I was looking for a way to cache the results and reuse the data in MySQL for other programs. So far I think I'll either investigate the memoization packages or write my own simple caching function as the symbols are just stored as a table in MySQL. If I get something useable I'll share it here. – psandersen Mar 24 '12 at 04:16
  • I've used Redis for stuff like this here's a [library](https://cran.r-project.org/web/packages/rredis/index.html) that has the bindings - just did a simple search, no idea if it will be exactly what you need. – theWanderer4865 Sep 05 '15 at 17:39

0 Answers0