Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue running reqContractDetails #38

Open
rjvelasquezm opened this issue Feb 7, 2023 · 2 comments
Open

Issue running reqContractDetails #38

rjvelasquezm opened this issue Feb 7, 2023 · 2 comments

Comments

@rjvelasquezm
Copy link

Description

In the new version of IBrokers I can't seem to get reqContractDetails to work with futures.

Minimal, reproducible example

If I run the following code

contract_raw = IBrokers::twsFuture(symbol ='',exch = '',expiry = '',local = 'MESH3')
tws = twsConnect()
contract_details = reqContractDetails(conn = tws,Contract = contract_raw)

I get an error that says:

Error in if (curMsg != .twsIncomingMSG$CONTRACT_DATA) { : 
  argument is of length zero
In addition: Warning message:
In writeBin(as.character(request), con) : problem writing to connection

but running the exact same code with IBrokers version 0.9-12 works without issues.

@diegoperoni
Copy link

take a look to issue #43

@diegoperoni
Copy link

I fixed a lot of problems just adding this lines of code to processMsg to fix empty content returned by TWS caused by socket delay:

processMsg = function(curMsg, con, eWrapper, timestamp, file, twsconn, ...) {

if (is.null(curMsg) || length(curMsg)==0) {
return(NULL)
}

default normal code following....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants