Java app(s) to update quotes


[UPDATED link  1/20/2011 - the author (Hung Le) updated the Java app and the link now points to the updated version.  This is an ideal alternative for those that only need to update quotes (no Account Statement updates) and don’t wish to install Python scripting]

The first comment I received on my new Blog site is from Hung Le and he offers a Java app (hleOfxQuotes) he wrote to obtain quotes from Yahoo! and output them into an OFX file for import into Money.   If you already have Java installed, download the latest Release version of the app , save it on your PC, and just click on it.   

The program is easy to use and works great!   The first time you import the file,  just link it to a Dummy Investment Account you can create on the spot (don’t link it to a real account, since the download shows you own zero (0) shares of each so as to not have any effect on your net worth).  If you mess this up, see this Blog Page to fix the linked account.

NOTES:

  1. The other accounts that actually contain these stocks and funds will automatically update, but you will not see a daily change value as you do with online updates.
  2. The first download update of the day takes hold for that date, so run this after 6 or 7 pm EST if you’d like the quotes to be “closing bell” values, especially regarding mutual funds (stock values don’t have to be computed).
  3. If you’d like currency exchange rates (although they work a little differently than the MSN method) or Market indexes, the method I’ve discovered and blogged here works with this app too!
  4. [added 2/4/2011] Apparently the newer test version(s) also work for Options and foreign exchange investments (see comments below for more)
  5. If you’d like quotes from other non-USA exchanges and other countries, the method I’ve discovered and blogged here works with this app too!
  6. Keep in mind though that the Yahoo interface is a “work around” intended solely for tracking things that aren’t held in an OFX-enabled account.  If your investments are held in accounts for which you have an OFX download option, that may be the prefered method.

Thank you Hung Le!

-ameridan

For those of you that are curious as what an OFX file looks like, I’m publishing the file generated with the hleOfxQuotes app requesting quotes for Ford stock and the Dow Jones Avg this evening:

<?xml version="1.0" encoding="UTF-8"?>
<?OFX OFXHEADER="200" VERSION="200" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="3379335459138709546"?>
<OFX>
  <SIGNONMSGSRSV1>
    <SONRS>
      <STATUS>
        <CODE>0</CODE>
        <SEVERITY>INFO</SEVERITY>
        <MESSAGE>Successful Sign On</MESSAGE>
      </STATUS>
      <DTSERVER>20100213033831</DTSERVER>
      <LANGUAGE>ENG</LANGUAGE>
    </SONRS>
  </SIGNONMSGSRSV1>
  <INVSTMTMSGSRSV1>
    <INVSTMTTRNRS>
      <TRNUID>3965303700877776334</TRNUID>
      <STATUS>
        <CODE>0</CODE>
        <SEVERITY>INFO</SEVERITY>
      </STATUS>
      <INVSTMTRS>
        <DTASOF>20100213033831</DTASOF>
        <CURDEF>USD</CURDEF>
        <INVACCTFROM>
          <BROKERID>le.com ofx quotes updater</BROKERID>
          <ACCTID>0000-0001</ACCTID>
        </INVACCTFROM>
        <INVPOSLIST>
          <POSSTOCK>
            <INVPOS>
              <SECID>
                <UNIQUEID>F</UNIQUEID>
                <UNIQUEIDTYPE>TICKER</UNIQUEIDTYPE>
              </SECID>
              <HELDINACCT>OTHER</HELDINACCT>
              <POSTYPE>LONG</POSTYPE>
              <UNITS>0</UNITS>
              <UNITPRICE>11.12</UNITPRICE>
              <MKTVAL>0.00</MKTVAL>
              <DTPRICEASOF>20100213033831</DTPRICEASOF>
              <MEMO>Price as of date based on closing price</MEMO>
            </INVPOS>
            <REINVDIV>Y</REINVDIV>
          </POSSTOCK>
          <POSSTOCK>
            <INVPOS>
              <SECID>
                <UNIQUEID>^DJI</UNIQUEID>
                <UNIQUEIDTYPE>TICKER</UNIQUEIDTYPE>
              </SECID>
              <HELDINACCT>OTHER</HELDINACCT>
              <POSTYPE>LONG</POSTYPE>
              <UNITS>0</UNITS>
              <UNITPRICE>10,099.14</UNITPRICE>
              <MKTVAL>0.00</MKTVAL>
              <DTPRICEASOF>20100213033831</DTPRICEASOF>
              <MEMO>Price as of date based on closing price</MEMO>
            </INVPOS>
            <REINVDIV>Y</REINVDIV>
          </POSSTOCK>
        </INVPOSLIST>
      </INVSTMTRS>
    </INVSTMTTRNRS>
  </INVSTMTMSGSRSV1>
  <SECLISTMSGSRSV1>
    <SECLIST>
      <STOCKINFO>
        <SECINFO>
          <SECID>
            <UNIQUEID>F</UNIQUEID>
            <UNIQUEIDTYPE>TICKER</UNIQUEIDTYPE>
          </SECID>
          <SECNAME>FORD MOTOR CO</SECNAME>
          <TICKER>F</TICKER>
          <UNITPRICE>11.12</UNITPRICE>
          <DTASOF>20100213033831</DTASOF>
          <MEMO>Price as of date based on closing price</MEMO>
        </SECINFO>
      </STOCKINFO>
      <STOCKINFO>
        <SECINFO>
          <SECID>
            <UNIQUEID>^DJI</UNIQUEID>
            <UNIQUEIDTYPE>TICKER</UNIQUEIDTYPE>
          </SECID>
          <SECNAME>Dow Jones Industr</SECNAME>
          <TICKER>^DJI</TICKER>
          <UNITPRICE>10,099.14</UNITPRICE>
          <DTASOF>20100213033831</DTASOF>
          <MEMO>Price as of date based on closing price</MEMO>
        </SECINFO>
      </STOCKINFO>
    </SECLIST>
  </SECLISTMSGSRSV1>
</OFX>

[UPDATED 1/29/2011] There are also beta test versions  posted on Hung Le’s site as well, for those wishing to experiment further, that support two additional quote sources: ft.com and Google Finance Portfolio. Hopefully, those will give our UK/Canada users additional sources for their quotes. He has also added a new mapper.csv function. Please read the Help files (Readme.txt) carefully.

In your current working dirctory, create a file named mapper.csv. It is a comma-separated-value, you can use Excel to create it but remember to save as CSV file.

mapper.csv MUST have the following header (case-sensitive, make sure spelling is correct)
MSMoneySymbol,QuotesSourceSymbol,IsMutualFund

Add row as needed
. First column: the symbol for a stock/fund in your MS Money
. Second column: the symbol that can be find in your quote source
. Third column: true if is a mutual fund

Let’s say your ft.com’s results.csv has price info for BBT:NYQ. But in MS Money the same stock has symbol BBT and this is a
stock, you would add row
BBT,BBT:NYQ,FALSE

Your results.csv use BBT:NYQ (QuotesSourceSymbol)
The generated *.ofx SHOULD have BBT (MSMoneySymbol)


added by ameridan from Hung Le’s comment 1/31  on Microsoft Money forum:
For currency issue: currently I do write out the OFX currency tag per security but I have no clue if MM will honor it

[SECID]
[UNIQUEID]EZJ:LSE[/UNIQUEID]
[UNIQUEIDTYPE]TICKER[/UNIQUEIDTYPE]
[/SECID]

[CURRENCY]
[CURRATE]1.00[/CURRATE]
[CURSYM]GBP[/CURSYM]
[/CURRENCY]

I set CURRATE to 1.00 right now but I have code to look up the exchange rate (using the pseudo-symbol USDGBP) but I have not put the code in yet because I did not want to muddle the water right now for the UK folks who are still having problem getting MM2005UK to update the price. Obviously, we can also convert from GBP -> USD before writing to *.ofx.

I want to give Google Porfolio a plug here regarding how it handles currency. For Google Portfolio, you can set the porfolio base currency and Google will report the position market value in BOTH: “native” currency and portfolio based currency. For example, let say I set my base currency to GBP and have a position of AAPL, Google will report market value in both USD and GBP. So that will take of currency conversion outside OFX generation tool. Currently hleOfxQuotes.jar can fetch data from Google Portfolio and will:

1. preserve shared count (instead of using 0 count) // this is mostly to see if it will help the UK folks

2. using “native” currency // since I don’t know how multi-currency actually works in MM

But it is fairly easy to add a couple check boxes to let user choose what he/she wants.

FYI, I am back to using MM on daily basis now (hence more active in updating hleOfxQuotes.jar). I gave Quicken a college try but things are not working out:

. I am used how the UI works and could not really overcome that

. In Quicken, if I hide the reconciled transaction, the balance is displayed certain way that is just too confusing.

I don’t mean to bash Quicken here but just a note to say that I am back to the “right” side ;-) .

 

The comments below are only the most recent – if you wish to review older comments, there is a link near the bottom of the page to do so.

About these ads

368 Comments »

  1. hleofxquotes said

    There are on-going concern about Java’s security. Since hleofxquotes uses Java, I am trying to explain what are the risks and my recommendation:

    https://code.google.com/p/hle-ofx-quotes/wiki/Disable_Browser_Java_Plugin

  2. pere said

    Maybe a stupid question but I have read a lot in comments and the wiki and I cannot make it work.
    I’m trying to get the quotes for foreign stocks and funds that are in yahoo servers as let’s say BBVA.MC.
    The tools doesn’t seem to retrieve those with the dot, only in the yahoo historical but not in the yahoo tab.
    Same happens with some mutual funds.
    Another stupid question probably. Would it be difficult to make a tab to retrieve from http://money.msn.com/?

    Thx a lot

  3. For foreign stocks, you probably will have better luck with the quote source “Yahoo option”. It was created to deal with “options” but will work also for hard-to-find symbols that the primary “Yahoo” quote cannot find.

    For new quote source request, please log an issue at

    http://code.google.com/p/hle-ofx-quotes/issues/list

    Thanks,

  4. David A. Scheiwe said

    I have been using Money for ages and Hung Le’s java app to download stock prices since MS abandoned Money. I has worked fine in both XP SP3 and Windows 7. My 11 year old old XP computer crashed recently and I replaced it with a Windows 8 Dell. Money seems to run OK, but I can’t get Hung Le app (in any version) to run.
    I’m aware the java will only run from the Desktop.
    I downloaded and installed latest 32 and 64 bit versions of Java (7-15).
    I associated Java to run .jar apps.
    Made internet recommended changes to windows settings to run Java in Windows 8 desktop.

    Nothing has worked so far. I try to load the app, the Command Prompt screen appears momentarily (just a flash), and then nothing.

    Has anyone else had this problem with Windows 8 and how have you resolved it. I’ve done every trick that has been recommended on the internet, but really don’t want to screw up the entire operating system by messing with the innards of Window if I can help it.

  5. David A. Scheiwe said

    Java version is 1.7.0_15.

    Tried second tip – always get a message “unable to access jarfile “filename.jar”

  6. ameridan said

    I edited hleofxquotes response just now to try and help clarify – you shouldn’t type “filename.jar”, it’s whatever [your] jar file is named. Hope I interpreted your response correctly David.

    • hleofxquotes@gmail.com said

      Thanks Dan.

      David, for example if the filename is hleOfxQuotes-Build_20111221_78-app.jar, you will do

      java -jar hleOfxQuotes-Build_20111221_78-app.jar

    • David A Scheiwe said

      Thanks. That works. Figured it out in the middle of the night. Having some issues with accuracy of data import into Money, however.

  7. Long-time Money user who's still looking for anything better and dreading the version of Windows I can't install it on said

    Thank you thank you thank you!!!! The information here is going to make patching up a lot of missing historic prices in our Money files SO much easier!

RSS feed for comments on this post

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 75 other followers

%d bloggers like this: