reqAccountUpdates {IBrokers}R Documentation

Request Account Updates

Description

Request and view account details from Interactive Brokers

Usage

reqAccountUpdates(conn, 
                  subscribe = TRUE,
                  acctCode = "1",
                  eventWrapper = eWrapper(), 
                  CALLBACK=twsCALLBACK, 
                  file="", ...)

.reqAccountUpdates(conn, subscribe = TRUE, acctCode = "1")

Arguments

conn A twsConnection object
subscribe subscribe (TRUE) or unsubscribe (FALSE)
acctCode an account description - not used for most accounts
eventWrapper message-level callback closure
CALLBACK main receiver loop, if any
file send output to "file", where file may be any valid connection in R
... additional args

Details

By default, for non-FA accounts, this returns the current login's account information.

This main version simply prints to screen the results returned by the TWS. .reqAccountUpdates sends the request to subscribe or cancel, but returns immediately. This is designed to be used within a larger custom callback routine, where the eventWrapper object passed to processMsg (see also) keeps trace of the portfolio updates in a consistent manner.

Author(s)

Jeffrey A. Ryan

References

Interactive Brokers API: http://www.interactivebrokers.com

Examples

## Not run: 
  tws <- twsConnect()

  reqAccountUpdates(tws)        # this will require a user interrupt
  .reqAccountUpdates(tws)       # this will return immediately

  .reqAccountUpdates(tws, "0")  # cancel the request
  cancelAccountUpdates(tws)     # the same

  twsDisconnect(tes)
## End(Not run)

[Package IBrokers version 0.2-6 Index]