[R-SIG-Finance] IBrokers: How to call eWrapper - updatePortfolio() ??
spy sixoneone
ispy611 at yahoo.com
Tue Apr 28 10:15:26 CEST 2015
Does anyone have an example of how to call
eWrapper - updatePortfolio() ??
So far I have this syntax working well inside my script:
library(IBrokers)
twsobj = twsConnect(clientId=myconid, port=myport)
res1 = reqAccountUpdates(twsobj, subscribe = TRUE, acctCode = "1")
Sys.sleep(4)
mysymbol = 'AUD'
mycurrency = 'USD'
mycntrct = twsCurrency(mysymbol,currency=mycurrency,exch="IDEALPRO",primary="",strike="0.0",right="",local="",multiplier="",include_expired="0",conId=myconid)
# I should call updatePortfolio() here using eWrapper
Sys.sleep(4)
res2 = reqAccountUpdates(twsobj, subscribe = FALSE, acctCode = "1")
twsDisconnect(twsobj)
More information about the R-SIG-Finance
mailing list