[R-SIG-Finance] Using attachSymbols with non-default argument values (Was: the ZigZag function)

G See gsee000 at gmail.com
Fri Apr 27 00:40:32 CEST 2012


I suggest re-downloading all 150 days each day instead of downloading
1 day, and deleting a day.

I doubt it will take any longer to download 150 days from yahoo than
it would to download 1 day.  To download 7,000 symbols, you'll most
likely have to add a Sys.sleep call between your calls to getSymbols.
You'll also probably want to wrap those calls in a while loop that
retries a number of times if there were errors downloading.  I don't
think you want to use attachSymbols for this.

Also, to delete the first day, you have to load all data from disk first.

Garrett

On Thu, Apr 26, 2012 at 5:22 PM, Gordon Erlebacher
<gordon.erlebach at gmail.com> wrote:
> Thanks Garrett. I thought about this solution on my way home from work. Glad
> I did not have to do it. So here is a harder problem, but one you might have
> solved, or might need to solve.
>
> I wish to keep the last 150 days of 7000 stocks on disk. Every day, I would
> like to run an update that removes the earliest entry of every stock, and
> stores the latest entry of every stock. So cache size remains constant, but
> contents change.
> Any ideas? Am I clear?
>
>    thanks,
>
>     Gordon



More information about the R-SIG-Finance mailing list