MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: The FinancialData Function

  • To: mathgroup at
  • Subject: [mg87211] Re: The FinancialData Function
  • From: jasonc <jasonc at>
  • Date: Fri, 4 Apr 2008 02:58:05 -0500 (EST)
  • References: <fsibce$64l$> <ft2arl$pf2$>

To Harvey:

On oil prices, that is one in the coming soon category, but I can give
you a solution that will work today, outside of FinancialData proper.
Soon there won't be a need for these sorts of lines, that is sort of
the idea.  But for now, you can use -

Daily spot oil prices from the Department of Energy, back to 1986

dailyDOEOil = {#[[1, 1 ;; 3]], N[#[[2]]]} & /@  DeleteCases[
PET_PRI_SPT_S1_D.xls", "XLS"][[2, 4 ;;, 1 ;; 2]], {"", ""} | {_, ""}];

Monthly spot oil prices from the Fed, back to 1946

monthlyFedOil = {DateList[#[[1]]][[1 ;; 3]], N[#[[2]]]} & /@ Rest[

Both are in the same format as any other FinancialData time series,
and ready for a DateListPlot, etc.  I hope they help in the meantime.
A prime reason we made FinancialData is to spare everyone else the
need to figure out the fiddly details of such lines of code.

As for getting lists of symbols that work in FinancialData today, you
can use string patterns and wildcards in the first argument, and
"Lookup" in the second argument.  So e.g. just to see how many that
is, you could ask for

Length[FinancialData["*", "Lookup"]]

- where the * is a wildcard that will match any string.  The answer is
186,000 symbols and change.  I won't try to guarantee that every one
of them will give you meaningful data - some will return Missings,
representing entities that merged recently or failed etc.  For any
subset of them, the symbol and second argument "Name" will tell you
what it is.

Clearly this sort of discovery can be improved, and is another area
I'd call experimental.  Briefly, there is good coverage of stocks,
mutual funds, and indices in the existing data.  Including many
foreign exchanges.  Newer versions should have more of the futures and
economic time series you'd want for commodity-specific questions.

Fine questions by the way.


Jason Cawley

  • Prev by Date: Label vertices in Graph to display with GraphPlot
  • Next by Date: contouring
  • Previous by thread: Re: The FinancialData Function
  • Next by thread: Re: Problems with differentiating Piecewise functions