Moneydance II
Few things I learned on developing with moneydance, as I say my final 'good bye' to Quicken.
First, getting it hooked with tomcat is trivial - just copy all jars in WEB-INF/lib, then a small serlvet/JSP that runs ( in a thread )
com.moneydance.apps.md.controller.Main.main(args)
The most important object in moneydance is the RootAccount. To get it, you can easily modify the sample extension they provide, and in the init() method save the FeatureContext
or the FeatureContext.getRootAccount() object in some global place. Then you can access it from the web application. I use JSP right now - it's faster for prototyping with the auto recompilation. Note that the Swing window will be visible - my goal is to enhance it with some better data visualisation and extra features, but I still use the UI for what it has.
The data structures are a bit weird, but probably there are many historical reasons for this. There are few important structures:
- The account list - includes normal accounts ( "Ameritrade" ) but also each stock is stored in a separate account ( "Ameritrade::MOT" ).
- The 'currency' list - includes information about the stock value, including the snapshots which can be retrieved from yahoo or imported from quicken.
- The transaction list - all transactions from all accounts, but you can query for a particular account.
Now, the interesting part - to get to the real numbers, you have to do some tricks ( at least in the version I have ): the number of stocks is Account.getBalance() / 10000, the value of a transaction is SplitTxn.getAmount() / 100, the actual price of the stock is ( 100 / Account.getCurrencyType().getSnapshot(i).getRawRate() ). Also, the transaction in the stock account only includes the number of stocks - to get the ammount, you need to get the parent transaction and look for one of the other splits.
While the API is not the cleanest in the world, I got some nice tables showing data similar with the quicken portfolio view in a couple of hours - and most time was spent doing HTML and XUL. There are few things I still don't know how to do ( realized based on lots ), but it shouldn't be hard.
Downloading the data from Ameritrade seems to work pretty well, so does downloading the stock quotes from yahoo. Of course, it will take a while until I get a decent look and feel on the html interface, but it's really good that I can present the data as I really want, and I can do any manipulation and import/export that I can think of.
On the negative side - I was trying to present the data as a XUL tree, and discovered that while it's one of the most complex xul tags, it is also extremely limited. You can only display text and some image, instead of anchors and complex markup that are trivial in a regular table. And I found no way to select a single cell. It seems the listbox is similar, couldn't select a cell either, so probably I'll go back to use mixed html and xul. I want to use XUL because I want the keyboard support and some of the more advanced things from xul ( and I only use firefox anyway ).
Posted by costin at July 21, 2005 11:54 AM
Disabled due to spam. Click on the link to post a comment, it'll be sent in email ( and thus usual mail spam filters and blacklist applied ). It may be made accessible later on, but code needs to be written for that.