Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
How to connect to TWS from server side
I'm looking to set up a connection from my database server to TWS running on my local machine, however I'm not sure what kinds of configuration is correct:
I have had success with using reverse SSH tunnel using these instructions: However I'm getting this error on the second step when trying to use the same method but modifying for connecting to port 7496 instead of the standard 22: A couple of questions: 1. Am I on the right track? Is this the right approach to use to set up this kind of connection? 2. Are we supposed to connect to port 7496 as I assumed here? 3. Is there a way to connect using Python? There is the sshtunnel library and it would be nice that I could leverage it to connect in the same script that I use to pull data Any help is very much appreciated, TIA! |
Re: Placing a crypto order
I'm not positive, but pretty sure that I read that IB crypto was, at this stage, only open to US residents.
Not sure where you are, but I am in Australia, I don't get any crypto when I search IB, and Crypto is not in Account Management when I try to request trading permission. The only crypto I see is CME futures, plus a couple of stocks with crypto related names. KH |
Re: Placing a crypto order
Ewald de Wit
Thanks for the link Kevin. Using this order:
does get one step further, which in my case is a 'No trading permissions' error. Not sure how to add the permissions either as there seems to be no Crypto products listed in account management. -- Ewald |
Placing a crypto order
Ewald de Wit
Hi all, Has anyone figured out how to place a CRYPTO order yet? When I try with
it gives the error -- Ewald |
Re: Version 10.10 of Gateway.
Craig Carr
The last forced upgrade broke F&F accounts pretty good:
- Different P/Ls in different TWS windows. - Complete garbage in account update values. - SMART no longer routing to lowest cost. - Leftover shares after trade close due to errors in allocation. 981.3c and the next version still have all these problems, I had to prove to them 10 still had these problems. IB's QA is garbage. |
Re: Version 10.10 of Gateway.
Nick
¿ªÔÆÌåÓýI don't know if this question is directed at me, but it's not a
technical issue but a matter of what you need for your particular
trading strategy. If you currently have everything you need then no reason to update unless a new feature would be worth the effort. On 10/3/2021 4:44 PM, Traveler wrote:
|
Re: Parent order missing
There may be nothing wrong with your approach and the issue may very well be with the 985 line of TWS versions. We are running TWS 985.1k as well but with API 9.85.2 "latest" and have no issues. But our order structure is quite simple so we would not trigger the issues you are seeing. The curious thing for me is that the 985 series of TWS and API have "disappeared" in the sense that:
And on the TWS side:
The size fields in some of the callbacks in 985 changed from "int" to "long" just to change to "Decimal" in 10.10. That probably goes along with significant and possibly destabilizing changes inside TWS-IBGW. Maybe it is time to reach out to IB unless you can do a quick trial with TWS 981.3c or 10.10.2p. ´³¨¹°ù²µ±ð²Ô On Fri, Oct 1, 2021 at 09:10 AM, <sede@...> wrote:
Yes, I use nextValidId(), and then increment values myself, for example like this: |
Re: Parent order missing
do you have other open positions at the time of placing the order?? You cannot be long & short on the same contract at the same time.? On Fri, Oct 1, 2021 at 7:10 AM <sede@...> wrote: Yes, I use nextValidId(), and then increment values myself, for example like this: |
Re: Parent order missing
Yes, I use nextValidId(), and then increment values myself, for example like this:
? long 3641 short 3721 tp 3722 sl 3723 tp long 3742 sl long 3743 I use tws Build 985.1k and api 9.85.1 I noticed there is another, possibly unrelated, problem which happens randomly. After placing all 6 orders, the first one is rejected with error: Error, reqId:? 3641? errorCode: 201 Order rejected - reason:Cannot have open orders on both sides of the same US Option contract. All child orders then also are rejected, since parent is missing. The instruments are options, and I didn't place any orders before for these specific contracts before. Does IB not understand the relationship between parent - child orders, and thinks that stop loss or take profit sell order would be an opposite side to initial buy order, and that is why it rejects initial buy order? There seems to be a lot of randomness involved, since the same contract combination works just fine after few retries. |
Re: Version 10.10 of Gateway.
Nick
IB occasionally breaks things. From your's and Jurgen's findings it appears this is one of those times.
toggle quoted message
Show quoted text
The best defense is when you find a TWS/Gateway version that works just keep using that, even if it's for a year or two. Only upgrade to a new version when you are forced or if you need a new feature. On 10/1/2021 5:07 AM, Kevin wrote:
I don't have enough experience with this aspect of TWS or Gateway, so I'm going back to stable for tonight, then I'll do new installs for both TWS and IBG over the weekend. |
Re: Version 10.10 of Gateway.
A further update to this: I've just started TWS for the US Friday session, no change in my Python code, the computer hasn't been used since being turned off after the Thursday session. Now I'm getting Java errors in here too.
Error 322, reqId 3: Error processing request.-'cc' : cause - jextend.cc.n(cc.java:310)I re-signed in using stable (TWS 981.3c), and the Python script runs without any problems. I am yet to start IBG. I don't have enough experience with this aspect of TWS or Gateway, so I'm going back to stable for tonight, then I'll do new installs for both TWS and IBG over the weekend. KH |
Re: Version 10.10 of Gateway.
On Fri, Oct 1, 2021 at 01:14 AM, ´³¨¹°ù²µ±ð²Ô Reinold wrote:
The "Quote Details" window would suddenly not update any longer,Hello, I solve this problem in TWS 10.10.2p by changing to the Classic TAB, then back to the Mosaic TAB. The other solution is to Reconnect all Farms. Saves having to restart. KH |