Margin Info

Discussion in 'Risk Management' started by CPTrader, Feb 7, 2011.

  1. drp7804


    You could parse the HTML for that page, but not sure how set-in-stone a lot of the wording is, etc. As in, I wouldn't feel confident that a parser would continue to read correctly over the long term... unless a long time had gone by and IB had updated/changed the page a few times w/o major parsing issues on your end. Or the address for the page could change, as another example.

    I guess my point is that w/ the parsing route there's a fairly strong dependency/reliance on how IB makes updates to that page... not only that, but you need to be able to detect when they change the page so you know to be on the lookout for errors on your end. Though I suppose you could keep a local copy of the page and diff vs. what's on the website to detect if the page has changed (ignoring any updated date/timestamp type of things).

    Is margin info available via the API? Wondering if something useful might be in the updateAccountValue call...?
  2. Thanks for your comments, drp7804

    I think a parser is a good albeit not perfect solution. Does anyone have or know of a freely available parser for the IB margins page that I could access?