开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: Java tws api 972.03 too old? Causing errorCode 505 not found


 

开云体育

闯ü谤驳别苍

I think what you’re missing here is that the ‘extra byte issue’ was never a problem for any of IBKR’s APIs, at any version, that use V100 protocol (and didn’t have DisableV1000 set).

?

This is because of the way they work. They split the incoming message stream into individual messages using the message length header, and these individual messages are queued. Each message is then eventually removed from the queue, and EDecoder parses it according to the expected structure. Once it has dealt with the expected last field, any remaining bytes are simply ignored, job done.

?

But if you have a pre-V100 API implementation, the only way the parser knows when it has got to the end of a message is that it has processed the relevant number of fields for that message, and the very next field is the message type for the next message. There is no possibility here of breaking the overall byte stream into individual messages first, because there is nothing to indicate where the breaks between messages are without actually parsing the whole lot. Note that if you set DisableV100 for a V100 implementation, then the individual messages are extracted in precisely this way by parsing the byte stream – see the readSingleMessage() function in EDecoder: so in this case it’s vulnerable to the extra byte problem.

?

So the only people who have had a problem with the extra byte are those using pre-V100 APIs, (ie API 971 or earlier) ?or using API 9.72 or later versions with DisableV100 explicitly turned off. This included me, Ross Hemingway, and the others who voiced their experience with the faulty version of TWS 10.30.

?

As far as 10.30.1o is concerned, it is simply indisputable that it still adds this extra byte to the open order message, as my example from earlier today showed. My example was produced with my own .Net API implementation, which I haven’t fixed yet for this issue (it doesn’t use the message length headers). But my COM-based implementation that has been enhanced to use the message length headers works perfectly.

?

So I repeat, anyone using one of the IBKR APIs from 9.72 onwards will have no problems ?with TWS 10.30.1o (at least, not from the extra byte issue). Just for completeness, I still have the installer for API 9.72 (and for other versions going right back to 2003). I installed it today and ran a test with it: the order went through fine and the open order and order status messages were processed without a problem.

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of 闯ü谤驳别苍 Reinold via groups.io
Sent: 25 October 2024 20:10
To: [email protected]
Subject: Re: [TWS API] Java tws api 972.03 too old? Causing errorCode 505 not found

?

Let me do a little train conducting here. The various posts describe API situations correctly, but they are from different time frames and vastly different versions of the API and Trader Workstation.

Let;s start with Trader Workstation TWS 10.30.1.e from July 1, 2024 (a "latest" version at that time). There were several reports about an extra byte in messages clients received from TWS. That caucused issues when that specific TWS talked with clients that implement certain lower version APIs (such as version 177 as Richard reported). In July, closely related Trader Workstations 10.29 and 10.31 did not show the issue.

Very recently, Trader Workstation 10.30.1l replaced 10.19.2p as the new "stab;e" version. Between the faulty version 10.30.1e in July and 10.30.1l now, Trader Workstation had several minor releases that may have addressed the Julz issue. And as of right now, the "stable" TWS has actually moved to 10.30.1o.

After upgrading to TWS API 10.19.04 (which is API version 176) , It looks like Raoul is able to run a client successfully with "stable" Trader Workstation 10.30.1l. I also have not seen any "extra byte" issues when my stable Trader Workstation 10.30.1l talked with clients of TWS API version 173 all this week.

So right now it looks to me as if "stable" Trader Workstation 10.30.1l is, indeed, stable and does not show the issues reported in July. I will try out "stable" Trader Workstation 10.30.1o over the weekend as well.

闯ü谤驳别苍

?

?

?

On Fri, Oct 25, 2024 at 05:04 AM, Orionn wrote:

Don't use version 10.30 (even if it's the current stable version). This issue is fixed in versions 10.31 and newer. It didn't exist with versions 10.29 and older.

The problem started with TWS version 10.30 and since stable version rolled from 10.19 to 10.30 a few days ago, you have started experiencing the problem just now.

This is why one should always prefer the offline versions of TWS that do not automatically update (even while using the stable version).

Here's a list of my findings.

I have experienced this issue myself with API clients that use older versions of the API.

The problem triggers in the orderStatus callback. In the newest APIs, the orderStatus callback sends Decimal fields (instead of Integer) for filled and remaining quantities (openOrder does too but in the Order object).

Months ago, I have contacted IB to ask if a TWS API setting could be introduced to maintain compatibility with older API clients but my request was denied due to lack of demand.

I decided to start upgrading my applications to use the newest API.

Later, I found that TWS version 10.31 and 10.32, for some unknown reason, do not trigger this error.

Stable version is currently 10.30 but it has this issue with older API clients, specifically, in the orderStatus callback.

I have also found that there is a thread in this group that mentioned this issue:

/g/twsapi/topic/107023187

Hope this helps.

--

Join [email protected] to automatically receive all group messages.