Message Boards Message Boards

Downloading a spread sheet with financial data on 150 stocks

GROUPS:

I need to get into excel a spread sheet with multiple financial data entries on 150 stocks. The things I need are closing prices on certain dates, average p/e 2011-2015, average p/s 2011-2015, and more.

When I try to enter these directly into wolfram alpha it stops giving me a downloadable table after I input more than 4 or so stocks, so I have concluded that I need to use either a executable notebook or file on the development platform not sure which.

I have experimented with the FinancialData and come up with this code for my first data needed:

FinancialData["GE", "Close",{{2011,12,30},{2011,12,30}}]

However I cannot figure out how to input this for multiple stocks to be downloaded in an excel file. I have experimented a bit with the Export function but it just returns that my file has been created. Where do I go to download it?

I apologize that these questions are very elementary as programming is not my strong suit. If someone can give me the code to export a FinancialData value for all of my stocks to an excel file and how to use it I believe I can figure out how to alter the code for each different needed statistic.

It would save me hours of hand entry if someone can help me figure this out!

Thanks!

POSTED BY: Keith Ravid
Answer
3 months ago

Please make sure you know forum rules http://wolfr.am/READ-1ST about code formatting. Please also always try to post complete code, not just meta-describe "experimented a bit with the Export function". Info in my answer below can be found in various places in Documentation, it is very detailed:

http://reference.wolfram.com/language

http://reference.wolfram.com/language/tutorial/NamingAndFindingFiles.html


Easy to check:

Directory[]

Which in my case on Win7 gives:

"C:\Users\vitaliyk\Documents"

You can always specify a complete path to a destination you'd like to save with, for example, top menu Insert >> FilePath which will bring a standard browse-directory window:

enter image description here

This would go instead of your "domniationrootsstargraph.gif". A useful trick to know is command

SetDirectory[NotebookDirectory[]]

which will allow saving your files by default (without full-path specification) into the directory where your notebook is saved. Also to check files in the CurrentDirectory use

FileNames[]

or, for example,

FileNames["*.gif"]

for specific file types.

POSTED BY: Vitaliy Kaurov
Answer
3 months ago

Group Abstract Group Abstract