Program to alert and check IB account value?

Discussion in 'Automated Trading' started by sheepsucker, Dec 20, 2011.

  1. you might run a second computer that only checks the balances and flashes the house lights if the balance seems out of whack...
     
    #11     Dec 24, 2011
  2. That is what we are trying to accomplish here
     
    #12     Dec 25, 2011
  3. you can add a tickwatching component which will notify you if the feed fails.

    if you have questions about this join the users list and somebody will help you. google tradelink project or community.tradelink.org for more info
     
    #13     Dec 27, 2011
  4. I don't know of a program that will do this out-of-the-box, but if this is a sanity check / alert mechanism for your IB account, IMHO it makes sense to pull the data from directly from IB using the API.

    http://institutions.interactivebrokers.com/en/control/standalone_api.php?os=unix&ib_entity=inst
    http://institutions.interactivebrokers.com/php/apiguide/apiguide.htm

    Anyhow, you'll need to take a look at the TWS API. In the Java version which is what I use, look at:

    EClientSocket.java
    public synchronized void reqAccountUpdates(boolean subscribe, String acctCode)

    You'd basically call that (acctCode should just be an empty string). You'll get notifications back via:

    EWrapper.java
    public void updateAccountValue(String key, String value, String currency, String accountName)

    updateAccountValue will be called many times, each with a different keys. The one you're probably interested in would be "NetLiquidation", which should be the same as the "Net Liquidation Value" in your Account dialog in TWS.

    Anyway, it's a fairly straightforward program to write if you're already somewhat familiar with the TWS API, but if not there's a bit of a learning curve to crank out that first program.
     
    #14     Jan 5, 2012
  5. Thanks spearhead, yes its sanity-check. After some trial and error I got it working now on the API with excel and some VBA.
     
    #15     Jan 5, 2012