Giter VIP home page Giter VIP logo

Comments (5)

SamoPP avatar SamoPP commented on July 28, 2024

Hi. This is quite critical... Any idea how to solve this? Thanks.

from ibrokers.

joshuaulrich avatar joshuaulrich commented on July 28, 2024

I looked into this, but I'm not very familiar with the TWS API or this code... @jaryan is the expert. That said, I ran Wireshark on the connection and found that the first write to the TWS API connection in Script 2 causes TWS to reset the connection (i.e. it sends a TCP RST response and closes the connection). That's what causes the error later.

?twsConnect() says that clientId must be unique for each client and it will throw an error if you try to create another connection to the API with a clientId that's already in use. But it doesn't throw an error like documented. Script 2 doesn't error if you use tws <- twsConnect(clientId = 2, port = 4002). Please try that. I'm not sure it's actually a solution, but it prevents the error.

from ibrokers.

PradeepNanduri avatar PradeepNanduri commented on July 28, 2024

@joshuaulrich thanks for taking a look at the issue.

I've tried implementing your suggestion but it's not working. I've set 'ClientId' = 2 while defining 'tws' object in my script 2 but it's failing to generate an order ID with function 'reqIds'. The error message is still the same. And script 1 is successfully running collecting market data where tws <- twsConnect(port = 7496)

Want to highlight a point that it works all ok with previous version of IBrokers package.

from ibrokers.

joshuaulrich avatar joshuaulrich commented on July 28, 2024

I'm not confident I can help more than I have. I can't replicate the issue when I use the steps in my previous comment.

A few questions that might help find the source of the issue:

  • When did you upgrade IBrokers? I assume it was right before you created this issue. What was the old version IBrokers and what is your current version?
  • Did you upgrade R around this time? What was the old version and what's your current version?
  • Was there a TWS upgrade recently?
  • Does it work if you downgrade to the old version of IBrokers you were using?

from ibrokers.

PradeepNanduri avatar PradeepNanduri commented on July 28, 2024

@joshuaulrich thanks again! This issue is NOT impacting my work as i moved back to V 0.9.12. So I would wait to see if anyone else reports a similar issue. The problem occurs with i upgrade to V 0.10.2.

As of now i am using RStudio/2023.06.0+421 with R 4.3.1. I've tested with previous versions of R and R Studio but the problem persists with V 0.10.2 of IB. And my TWS is the latest one available.

from ibrokers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.