¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 ¿ªÔÆÌåÓý

two questions about the 50 msg/sec rate limit

 

Regarding the 50 msg/sec TWS rate limitation, is IBKR checking it by calculating a continuously sliding window, or are they doing a nonoverlapping time window? The first is stricter.
?
If it's the second one, then theoretically you can send up to 100 messages in? a short burst. As long as the first fifty were near the end of the first window, and the next 50 were at the beginning of the next window.?
?
If this was an option, then there would be the challenge of trying to figure out where TWS' clock was. Does anyone know if the calculation is made in TWS before orders are sent out over the wire, or are the calculations made upon receipt at the data center?


Error using TWS scanner to filter stocks

 

Hi, I've created a script that uses the TWS scanner to filter stocks for a strategy but I'm receiving this error: "Error 162, reqId 5: Historical Market Data Service error message:API scanner subscription cancelled: 5"
?
?
Has anyone experienced this/knows how to deal with this or what I'm missing?
?
?


Re: VSTOXX daily settlement prices

 

Thanks Juergen. Great idea!


IB Gateway 10.30.1t

 

Does anyone have available the installation file(s) for IB Gateway 10.30.1t ? If possible for all operating systems. Thank you.

--


Re: VSTOXX daily settlement prices

 

I don't know of a source for the settlement data either, and scraping web pages is never a reliable path.

One approach could be to calculate/estimate the settlement price yourself. Both going forward on a daily basis as well as historical values for a couple years at least. The specification for the future gives you the recipe at

The daily settlement prices for the current maturity month are derived from the volume-weighted average of the prices of all transactions during the minute before 17:30 CET (reference point), provided that more than five trades transacted within this period.

Just grab historical TickByTickLast for the timeframe [17:29, 17:30) and calculate the VWAP. Probably rounded to the minTick of EU0.05 since the published values allways end in 5 or 0.

As a "proof of concept", here the results for yesterday:

  • There were 78 trades with a total volume of 493 contracts traded
  • The exact VWAP was 17.5305273833671
  • That makes a settlement price estimate of 17.55, just as published.
Just a thought.
´³¨¹°ù²µ±ð²Ô

?

?
On Tue, Feb 25, 2025 at 03:42 AM, Despair wrote:
I can get down the txt yes but the prices in the file are the daily closing prices of the index and not the settlement prices of the futures I'm afraid.
?
You can see the daily settlement prices here:
?
Sadly I don't manage to download from this site.
?
?


Re: VSTOXX daily settlement prices

 

I can get down the txt yes but the prices in the file are the daily closing prices of the index and not the settlement prices of the futures I'm afraid.
?
You can see the daily settlement prices here:
?
Sadly I don't manage to download from this site.
?
?


Re: VSTOXX daily settlement prices

 

Well, it looks like their txt is just a csv (-:

Did you examine it?

Then, you can find the conid for V2TX and see if the ib history matches... it'll be fun.

If you have any problems make sure to let ´³¨¹°ù²µ±ð²Ô know.


Re: VSTOXX daily settlement prices

 

The csv-links are greyed out. You maybe need an account? This makes it difficult to download the data programmatically. :-/


Re: VSTOXX daily settlement prices

 

It seems as though everything you need shouldn't be far from .

What have you tried so far?


VSTOXX daily settlement prices

 

Can I somehow retrieve the VSTOXX daily settlement prices via the API? An alternative source where I candownload a CSV would be also great.


Web API no Info

 

Hi together,
?
I'm not quite sure if this is the right group, because there are two API options (via TWS and via Client Portal API). ?I am looking for?
https://www.interactivebrokers.com/campus/trading-lessons/requesting-market-data/
and can also retrieve conid's for given symbols.
But if I now use?
/iserver/secdef/info/
to retrieve data for a symbol I only get
Error 404 - File not found
Does this perhaps only work if you have paid for market data? Otherwise there is only cash on my securities account...?
?
Best regards
joh


Re: TWS 10.33 and 10.34 crashing on Windows and Mac OS

 

Replying to myself with the feedback that I have received from IB:

"Please be informed that the minimum system requirement for TWS on PC is Windows 10 on higher.
We are not supporting errors on Windows 7.

Based on your report you are using Mac OS 10.14.6 which has been released in 2018. Minimum operating system requirement to run TWS on a MAC is MAC OS 11.

Please update your Mac OS on the latest version if it is possible and try again.
Please take care that you are installing the correct version for your Intel or Apple Silicon Processor."

These issues are very likely caused by older operating systems no longer being supported by current Java versions.

--


Closing SELL order being treated as SHORT order in the api

 

Has anyone else had this occur to them for stock trades?:

I take a long position, and then try to close out the position (as a in a stop-loss situation), and the closing SELL order is treated as a SHORT order, occasionally resulting in a security being 'hard to borrow' and not being able to close out my position!? This is a little unnerving...

I don't seem to have this problem doing things 'by hand', just with orders via the API.


I'm looking through the documentation to see if there's some 'closing trade' flag I can stick on an order, but it looks like 'BUY' and 'SELL' are my only options as far as side or 'action' as it's called in the docs.


I DID see this, but it's only for institutional clients:

string? ?[get, set]
? For institutional customers only. Valid values are?O (open) and C (close).
Available for institutional clients to determine if this order is to open or close a position.
When Action = "BUY" and OpenClose = "O" this will open a new position.
When Action = "BUY" and OpenClose = "C" this will close and existing short position.



any help would be appreciated!? thanks

https://interactivebrokers.github.io/tws-api/classIBApi_1_1Order.html


Re: "438 : The application is now locked" and "326 : Unable to connect as the client id is already in use..." discontinued ?

 

When you say "using on old API client", do you have a feel for what API level that client supports? Do you still have the API source code?

I always run TWS/IBGW with "never lock", so that I cannot speak to error 438. Does the error message actually come from TWS (as in TWS records a message in the API log?) or does the API in the client assume TWS is locked based upon how the socket gets closed?

The earliest Java API I have used is 9.73.04 (API level 134) from 2017 and I have never seen error 326 upon clients attempting to connect with duplicate clientIDs. I always had client-side error 502 that is somewhat unspecific since it gets raised whenever the socket gets closed by TWS/IBGW or the operating system.

As you can see from the flow below, TWS/IGBW simply close the socket when the client sends a"StartAPI" message that contains a duplicate clientID. So I am wondering, whether your "old" client API locally raises error 326 upon socket closure after "StartAPI". I had thought about a patch like that for my framework since a more prescriptive error code would make a lot of sense in cases of duplicate clientIDs.


´³¨¹°ù²µ±ð²Ô

?

?
On Thu, Feb 20, 2025 at 07:04 AM, Orionn wrote:

Can anyone confirm that the errors in the subject have been discontinued in recent API versions ?

I have performed the following tests:

1) TWS locked:
- using an old API client to connect to TWS 10.19 or 10.34 correctly shows "438 : The application is now locked"
- using an API 10.34 client to connect to TWS 10.19 or 10.34 shows: "502 | Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket Clients" is enabled ..."

2) client Id already in use:
- using an old API client to connect to TWS 10.19 or 10.34 correctly shows "326 : Unable to connect as the client id is already in use. Retry with a unique client id."
- using an API 10.34 client to connect to TWS 10.19 or TWS 10.34 shows: "502 | Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket Clients" is enabled ..."

So it is clear that the issue is in the API, not in TWS.

The most recent TWS API versions do not provide the correct error message and instead always trigger error 502 in both scenarios of locked TWS and client Id already in use.

Can anyone confirm these findings ?

--


Re: "438 : The application is now locked" and "326 : Unable to connect as the client id is already in use..." discontinued ?

 

I just checked the Java TWS API documentation and it looks like the "438 : The application is now locked." error has been deprecated which is very unfortunate.

--


Re: "438 : The application is now locked" and "326 : Unable to connect as the client id is already in use..." discontinued ?

 

Hi ´³¨¹°ù²µ±ð²Ô. Please apologize for the missing information. It is Java on Windows.

--


Re: "438 : The application is now locked" and "326 : Unable to connect as the client id is already in use..." discontinued ?

 

Which API language and operating system has your client used for your tests?
?
?
On Thu, Feb 20, 2025 at 07:04 AM, Orionn wrote:

Can anyone confirm that the errors in the subject have been discontinued in recent API versions ?

I have performed the following tests:

1) TWS locked:
- using an old API client to connect to TWS 10.19 or 10.34 correctly shows "438 : The application is now locked"
- using an API 10.34 client to connect to TWS 10.19 or 10.34 shows: "502 | Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket Clients" is enabled ..."

2) client Id already in use:
- using an old API client to connect to TWS 10.19 or 10.34 correctly shows "326 : Unable to connect as the client id is already in use. Retry with a unique client id."
- using an API 10.34 client to connect to TWS 10.19 or TWS 10.34 shows: "502 | Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket Clients" is enabled ..."

So it is clear that the issue is in the API, not in TWS.

The most recent TWS API versions do not provide the correct error message and instead always trigger error 502 in both scenarios of locked TWS and client Id already in use.

Can anyone confirm these findings ?

--


TWS 10.33 and 10.34 crashing on Windows and Mac OS

 

I am seeing crashes with TWS versions 10.33 and 10.34 on Windows and Mac OS.

TWS versions 10.33 and 10.34 are crashing on Windows 7 when exiting TWS. Windows displays a pop-up with "Trader Workstation stopped working" error.

TWS version 10.34 crashes on Mac OS X 10.14.6 right when it is starting. Identifier: com.install4j.5556-0173-2810-3400.22; Crashed Thread: 4 Java: JTS-Main; Exception Type: EXC_BAD_ACCESS (SIGABRT); Exception Codes: EXC_I386_GPFLT; Exception Note: EXC_CORPSE_NOTIFY

Is anyone else experiencing crashes and/or instability with TWS versions 10.33 and up on Windows and Mac OS ?

--


"438 : The application is now locked" and "326 : Unable to connect as the client id is already in use..." discontinued ?

 

Can anyone confirm that the errors in the subject have been discontinued in recent API versions ?

I have performed the following tests:

1) TWS locked:
- using an old API client to connect to TWS 10.19 or 10.34 correctly shows "438 : The application is now locked"
- using an API 10.34 client to connect to TWS 10.19 or 10.34 shows: "502 | Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket Clients" is enabled ..."

2) client Id already in use:
- using an old API client to connect to TWS 10.19 or 10.34 correctly shows "326 : Unable to connect as the client id is already in use. Retry with a unique client id."
- using an API 10.34 client to connect to TWS 10.19 or TWS 10.34 shows: "502 | Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket Clients" is enabled ..."

So it is clear that the issue is in the API, not in TWS.

The most recent TWS API versions do not provide the correct error message and instead always trigger error 502 in both scenarios of locked TWS and client Id already in use.

Can anyone confirm these findings ?

--


Re: Auto Restart & Auto Login w/ IB Gateway and Linux

 

Hi Brendan. See this:?
I think it's done by some members of this forum. Thank them ;)

On Mon, Feb 17, 2025 at 9:17?PM Brendan Lydon via <blydon12=[email protected]> wrote:
Hi,
?
I would like to reopen a thread on auto login, and auto restart for IB Gateway on Linux. I have been using TWS for my entire algorithmic trading journey only building strategies within the confines of the stock market's cash open (9:30am to 4pm) to keep systems running all day without needing many restart solutions and auto login credentials. But, now I want to run strategies all night long and for long periods of time. That is how I came across the benefits of using IB Gateway. I have built watchdogs for my applications to handle crashes from disconnecting from TWS, but TWS itself never crashed, only my application. But now I want to build algorithms to trade all through the night without much supervision with IB Gateway. I plan to continue using bash scripting within a linux machine for process monitoring & watchdogs. So to start, how can I enable auto login on IB gateway? What are the limitations you guys have come across? I already have set up a 5:15pm auto restart, as I have a futures trading algorithm backtested and ready to go throughout the night and non cash market hours, but I do not see a place for auto login, etc?
?
Thanks,
Brendan



--
Daniel