Comments (5)
Hi. This is quite critical... Any idea how to solve this? Thanks.
from ibrokers.
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.
@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.
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.
@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)
- New incoming message code missing from twsIDs.R ? HOT 14
- Realtime feed restart after gateway reset HOT 1
- Problem in placing future order HOT 2
- Placing bracket order
- Trailing stop order of IBrokers in R
- Guidance for adding support for high resolution (tick based) historical data retrieval
- function reqHistoricalData() stalls HOT 3
- tws <- twsConnect() just hangs often HOT 4
- same day and historical intraday prices
- reqAccountUpdates portfolioValue returning wrong results HOT 6
- reqAccountUpdate HOT 2
- Option Greeks HOT 8
- Historical Time and Sales Data HOT 1
- Issue running reqContractDetails HOT 2
- placeOrder does not include/transmit algoParams
- Make placeOrder working with comboleg
- Make reqContractDetails always working when R API invokes remote TWS
- option contract specification
- Your API version does not support fractional size rules. Please upgrade to a minimum version 163.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ibrokers.