Closed fidoandfido closed 13 years ago
Okay, so now we have a problem. Shares are sold and the time that is recorded is the wall time; this should potentially be converted to 'period' time - ie time related to the period. This is actually going to be slightly non-trivial; the easiest way to do this would be at the time of the event, since at that point there we can get access to 'when' it is in the period.
Since graphs of profit / loss and so on are going to be against game time, it makes sense that share prices should be too.
This would require the conversion of the share prices to arbitrary precision to a period in the day.
This would also meant that we can potentially create graphs of share prices versus book value and earning per share over time.
The alternative is to always use wall time; I am less enamoured of this idea.
Turns out using wall time is not as dumb as I thought. Since periods all have wall time recorded, it actually makes life quite easy, but will probably have to be revisited in the future.
So I have done up some graphs, and am about to commit. Some work to be done, I will probably look at purchasing the jfreechart manual in order to get the graphs to look suitably pretty, but in the mean time it is pretty cool.
To get the required data, I have included a new attribute in the company period report - share count. This is to take into consideration the fact that stocks will split over time. This allows quick and easy calculation of book value and earning per share. To implement this with the existing data set, I added the column and set it's value to be 100,000 (the default starting value). This is good; except when a company has already split. Then hilarity ensues.
Code to be promoted shortly!
Tool tips on the graph would be nice, so that when you scroll your mouse curser over a point you can see its price. This feature is pretty standard on most financial graphing apps.
A number of issues currently with graphs:
Colours slightly better and the data points are slightly better. Still some work required for this to really 'shine'.
For a first cut, this is done. I will create new issues for graphing problems as they arise.
Graphing of historical data using JFreeChart should be undertaken ASAP.
Share Price is probably the most important piece of data.