Skip to content

Instantly share code, notes, and snippets.

@sguzman
Created March 28, 2021 03:20
Show Gist options
  • Save sguzman/a6d3bbd67ea2f170a349ff078b621922 to your computer and use it in GitHub Desktop.
Save sguzman/a6d3bbd67ea2f170a349ff078b621922 to your computer and use it in GitHub Desktop.
Precache sp500 closing prices for all stocks
With[{items = EntityList@EntityClass["Financial", "SP500"]},
finhash[str_] := finhash[str] = FinancialData[str, "Close", All];
Monitor[
Table[
finhash[items[[n]]]
, {n, 1, Length@items}
]
, ProgressIndicator[n, {1, Length@items}]
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment