2

Trying to download fundamental data using the IBrokers - R package. API documentation shows two ways

http://xavierib.github.io/twsapidocs/interfaceIBApi_1_1EWrapper.html#af209070fa9583fb4780be0f3ff1e61e4

or http://xavierib.github.io/twsapidocs/reuters_fundamentals.html

I tried

library(IBrokers)
t <- ibgConnect()
isConnected(t)
[1]TRUE
reqCurrentTime(t)
[1] "2016-03-29 19:51:28 EST"
c <- twsEquity("ibm")
x <- reqFundamentalData(t,c)
Error: could not find function "reqFundamentalData"

The documentation for IBrokers R pkg does not explicitly call out this function - so am I to assume that it is not supported? I have the reuters subscription.

========== Tried Josh Ulrich' suggestion : x <- IBrokers:::reqFundamentalData(t,c) Got an error:

Error in inherits(x, "twscontract") :
  argument "contract" is missing with no default

got the same error requesting reqID and reportType. So I modified the code to

r <- reqId(t,numId =1)
[1] "1"
x <- IBrokers:::reqFundamentalData(t,reqId = r, contract = c, reportType = "ReportFinSummary")
x
[1] NULL

Command ran without error but returned NULL

Jai
  • 321
  • 1
  • 8

1 Answers1

0

It's not exported, but there is a reqFundamentalData function. You can try it via:

x <- IBrokers:::reqFundamentalData(t,c)

Since it's unexported, I don't know whether or not it works. Feedback would be appreciated.

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418
  • I tested this, but the `writeBin(as.character(msg), twsconn[[1]])` comes back as NULL (empty). Which is a shame. I can't create a github issues as it is a readonly github repository – phiver Feb 26 '18 at 15:36
  • @phiver: what GitHub repo? The R [IBrokers](https://github.com/joshuaulrich/IBrokers) package repo isn't read-only. – Joshua Ulrich Feb 27 '18 at 02:50
  • I found it on the metacran github site. my bad. Thanks for your link. I will go through the repo and see if I can add something usefull – phiver Feb 27 '18 at 09:03