Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

newbie q-n about FinancialData

24 views
Skip to first unread message

xamdam

unread,
Nov 24, 2009, 6:10:21 AM11/24/09
to
Hi,
I would appreciate some pointer on how to use FinancialData API to
retrieve fundamentals (e.g. PERatio ) on a list of tickers (all US)
and export it to a file. One hour of googling did not help!
Thanks a lot,
max.

dh

unread,
Nov 25, 2009, 2:30:28 AM11/25/09
to

xamdam wrote:

> Hi,

> Thanks a lot,

> max.

>

Hi,

here is an example how to retrive the data:

FinancialData[#, "PERatio"] & /@ {"GE", "AAPL"}

note that many data are missing.

To write it to a file you can e.g. use Export.

Daniel

Sjoerd C. de Vries

unread,
Nov 25, 2009, 2:39:45 AM11/25/09
to
Hi Max,

I'd suggest you read the help docs available from within Mathematica
instead of Googling. FinancialData has an extensive page there.
Something along the following lines should work for you:

Export["C:\\Financialdata.xls", {#,
FinancialData[#, "PERatio"]} & /@ {"MSFT", "GE", "XOM", "XRX",
"UPS"}].

This is a compund statement which does all the work at once. /@ is the
shorthand for the infix form of the function Apply, which applies the
FinancialData function (using a "pure function" construction, # &, --
look it up in the help docs) on a whole list of financial ticker
symbols. Export does the rest.

Cheers -- Sjoerd

DrMajorBob

unread,
Nov 25, 2009, 11:03:44 PM11/25/09
to
Every time I get interested in FinancialData (or any of M's on-line data),
I encounter something like the following, where data is available for only
339 of (only) the last 789 days, with a HUGE gap of 297 days in the middle.

data = FinancialData["EUR/USD", {2000, 1, 1}];
dates = data[[All, 1]];
differences = DateDifference @@@ Partition[dates, 2, 1];
Length@dates
DateDifference @@ dates[[{1, -1}]]
{Median@#, Length@#} & /@ Split[differences, Max[##] < 6 &]

339

789

{{1, 102}, {297, 1}, {1, 235}}

DateListPlot@data

First@data

{{2007, 9, 27}, 1.42}

That's not impressive coverage, considering that (according to Wiki):

"The name euro was officially adopted on 16 December 1995. The euro was
introduced to world financial markets as an accounting currency on 1
January 1999..."

and

"As of November 2008, with more than �751 billion in circulation, the euro
is the currency with the highest combined value of cash in circulation in
the world, having surpassed the U.S. dollar."

Bobby

On Wed, 25 Nov 2009 01:32:30 -0600, Sjoerd C. de Vries
<sjoerd.c...@gmail.com> wrote:

> Hi Max,
>
> I'd suggest you read the help docs available from within Mathematica
> instead of Googling. FinancialData has an extensive page there.
> Something along the following lines should work for you:
>
> Export["C:\\Financialdata.xls", {#,
> FinancialData[#, "PERatio"]} & /@ {"MSFT", "GE", "XOM", "XRX",
> "UPS"}].
>
> This is a compund statement which does all the work at once. /@ is the
> shorthand for the infix form of the function Apply, which applies the
> FinancialData function (using a "pure function" construction, # &, --
> look it up in the help docs) on a whole list of financial ticker
> symbols. Export does the rest.
>
> Cheers -- Sjoerd
>
>
> On Nov 24, 1:10 pm, xamdam <maxkhe...@gmail.com> wrote:


--
DrMaj...@yahoo.com

Michael Stern

unread,
Nov 25, 2009, 11:53:56 PM11/25/09
to
If you have access to a Bloomberg license, you can get higher quality
data with the Mathematica link to Bloomberg, which is available for free
at http://library.wolfram.com/infocenter/MathSource/7357/

The code to call up the P/E ratios for your list of stocks would be

BBGetCurrent[{"MSFT Equity", "GE Equity", "XOM Equity", "XRX
Equity","UPS Equity"},"PE_Ratio"]

If you wanted to use next year's consensus estimated P/E, which most
people would probably find more useful, the call is

BBGetCurrent[{"MSFT Equity", "GE Equity", "XOM Equity", "XRX
Equity","UPS Equity"},"Est_PE_Nxt_Yr"]

You can combine this with he Export command if you like, as demonstrated
by others.

Cheers,

Michael

Sjoerd C. de Vries wrote:
> Hi Max,
>
> I'd suggest you read the help docs available from within Mathematica
> instead of Googling. FinancialData has an extensive page there.
> Something along the following lines should work for you:
>
> Export["C:\\Financialdata.xls", {#,
> FinancialData[#, "PERatio"]} & /@ {"MSFT", "GE", "XOM", "XRX",
> "UPS"}].
>
> This is a compund statement which does all the work at once. /@ is the
> shorthand for the infix form of the function Apply, which applies the
> FinancialData function (using a "pure function" construction, # &, --
> look it up in the help docs) on a whole list of financial ticker
> symbols. Export does the rest.
>
> Cheers -- Sjoerd
>
>
> On Nov 24, 1:10 pm, xamdam <maxkhe...@gmail.com> wrote:
>

igod...@gmail.com

unread,
Mar 19, 2013, 12:04:55 AM3/19/13
to
Is it possible to get the Profit earning for a company for the last so many years. In a graph format or does not keep that kind of information. I mean it works for this year but i would like to see how the company has preformed in the last so many years. Please advise

0 new messages