reqAccountUpdates: Request Account Updates

Description Usage Arguments Details Author(s) References Examples

Description

Request and view account details from Interactive Brokers

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
reqAccountUpdates(conn, 
                  subscribe = TRUE,
                  acctCode = "1",
                  eventWrapper = eWrapper(), 
                  CALLBACK=twsCALLBACK, 
                  ...)

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

twsPortfolioValue(x, zero.pos=TRUE, ...)

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

x

object to extract PortfolioValue from. See details.

zero.pos

should PortfolioValue include zero positions?

...

additional args

Details

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

This main version returns a list of objects as 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.

twsPortfolioValue extracts into a data.frame commonly used fields from all positions held. There are currently methods for the the default returned object of reqAccountUpdates.

Author(s)

Jeffrey A. Ryan

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
  tws <- twsConnect()

  reqAccountUpdates(tws)        # this will return a AccountUpdate object
  .reqAccountUpdates(tws)       # this will return immediately

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

  twsDisconnect(tes)

## End(Not run)

hgodinez/ibrokers documentation built on May 17, 2019, 3:57 p.m.