Constructing Stock Data Charts

Reviews
Shared by: Malik Hairston
Stats
views:
0
rating:
not rated
reviews:
0
posted:
8/13/2009
language:
English
pages:
0
Constructing Stock Data Charts David Park, djmpark@comcast.net http://home.comcast.net/~djmpark/Mathematica.html In[1]:= Needs@"Presentations`Master`"D Through its online FinancialData sources Mathematica provides a wide range of stock data. Useful graphical representation of this data requires custom graphics. In this notebook I show how to construct a conventional price and volume chart with tooltips. Price-Volume Financial Chart Often it is necessary to write custom routines to proceed conveniently with our work. Mathematica is not so much a tool for doing mathematics, but a meta-tool for making the tools to do mathematics. In this case we want to generate a data set where each record contains the date for the period and a sequence of property values of a stock for that date. The FinancialData command will retrieve only a single property value at a time. The following routine retrieves multiple values. In[2]:= Out[6]= 882008, 882008, 882008, 882008, 882008, 882008, 882008, ClearAll@GetFinancialDataD; GetFinancialData::usage = "GetFinancialData@name, 8property1,property2...<,iteratorD will generate a data set where each record will contain 8datelist, propertyvalues..<. The iterator is the standard 8start,end, period< used in FinancialData. This is basically a method of retrieving a number of property values at once."; SyntaxInformation@GetFinancialDataD = 8"ArgumentsPattern" → 8_, 8_, __<, _<<; GetFinancialData@name_String, 8first_String, rest__String<, iterator_ListD := Module@8work, other<, work = Transpose @ FinancialData@name, first, iteratorD; other = FinancialData@name, , iterator, "Value"D & ê@ 8rest<; Transpose@Join@work, otherDD D H∗ Test ∗L GetFinancialData@"^DJI", 8"Open", "Close", "Price", "Volume"<, 8"Oct 1 2008,", "Nov 15 2008", "Week"
Related docs
premium docs
Other docs by Malik Hairston
dv260
Views: 82  |  Downloads: 0
Gruen v Gruen
Views: 862  |  Downloads: 6
Spivey v Battaglia_Brief
Views: 346  |  Downloads: 6
Create In Me
Views: 188  |  Downloads: 3
Great is the Lord Almighty
Views: 238  |  Downloads: 1
at115
Views: 135  |  Downloads: 0
adr109
Views: 75  |  Downloads: 0
Contracts Outline- Alford(1)
Views: 1578  |  Downloads: 66
Resources in World History
Views: 421  |  Downloads: 9
A Guide to Exercise
Views: 393  |  Downloads: 30
Commercial Real Estate Mortgage Qualifier
Views: 658  |  Downloads: 51
de157
Views: 93  |  Downloads: 1
at135
Views: 106  |  Downloads: 0
French Literature
Views: 543  |  Downloads: 10
Undivided Heart
Views: 164  |  Downloads: 0