Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: Google Protocol Buffers usage in the latest Java API
开云体育Ross ? You’re absolutely right! ? I was too lenient in my earlier post, because after a cursory glance a couple of weeks back I had mistakenly thought that the EClient.useProtoBuf() function was a settable attribute of EClient. But of course it’s not… ? So it looks like I’m pretty much shafted by this. One of my API implementations is actually written in Visual Basic 6 (believe it or not, lots of history there) and is still a vital component in my trading platform, but there’s seems to be no chance of using protobuf in that. My other API implementation is .Net based, so there is a way forward there. ? Oh well, life is full of surprises… ? Richard ? ? ? From: [email protected] <[email protected]> On Behalf Of rossh_yh via groups.io
Sent: 03 April 2025 17:56 To: [email protected] Subject: Re: [TWS API] Google Protocol Buffers usage in the latest Java API ? I see in 10.35 in the C++, there is no option to ignore this ProtoBuf.? 10.35 is version 201 (MIN_SERVER_VER_PROTOBUF), and its all coded into the source.? It does not seem there is way to avoid this mistake.? Looks like 10.34 will be the max build version for some time for many of us. |
Re: Google Protocol Buffers usage in the latest Java API
I see in 10.35 in the C++, there is no option to ignore this ProtoBuf.? 10.35 is version 201 (MIN_SERVER_VER_PROTOBUF), and its all coded into the source.? It does not seem there is way to avoid this mistake.? Looks like 10.34 will be the max build version for some time for many of us. |
TWS Time zone
I’m in the central time zone but I have my computers on EDT. When I run TWS on my new computer it displays CDT, not EDT. When I run it on any of my other computers it uses EDT. My new computer is setup for EDT and that’s what it shows in the task bar. Selecting “more options” on the TWS login screen shows the time zone as “(UTC-05:00) America/New York” on the new and old computers. ? Any ideas? ? Frank |
Re: Google Protocol Buffers usage in the latest Java API
When use of Protocol Buffers was first suggested back in 2015, I posted
some comments on IBKR's GitHub repository that were fairly critical of the idea. If you have access to the API repository, you can see these at: (For those who don't have access, the attached file contains the text from these posts.) Most of what I wrote then is still true, but one thing that has changed is that protobuf compilers now exist for many common languages: for example WikiPedia says this: "Protobuf 3.0 provides a code generator for C++, Java (including JavaNano, a dialect intended for low-resource environments), Kotlin, Python, Go, Ruby, Objective-C, C#, PHP, Dart.[14] It also supports JavaScript since 3.0.0-beta-2.[15] Third-party implementations are also available for Ballerina, [16] C,[17][18] C++,[19] Dart, Elixir,[20][21] Erlang,[22] Haskell,[23] JavaScript,[24] Julia,[25] Nim,[26] Perl, PHP, Prolog, [27][28] R,[29] Rust,[30][31][32] Scala,[33] and Swift.[34]" So those who develop their own API implementations using such languages should have no trouble making use of IBKR's protobuf work. Those who use other languages will be in serious trouble, unless IBKR commits long-term to allowing use of either the old protocol or the protobuf implementation. At present, the protobuf implementation is very limited in scope, and use is optional. But presumably the long-term goal is to extend the protobuf implementation to all API message types, and who knows what IBKR will insist on then? So my overall position is that this is all a big waste of IBKR's time and effort, for no real benefit. If they were starting to develop the API now, use of protobuf throughout would be a no-brainer, but after decades of development using the current protocol I'd say: it ain't broke, so don't fix it! Richard |
Re: reqContractDetails() does not get a callback if secType = "OPT"
Yep, you need to specify the option multiplier ("100").
?
You don't need to set conId = 0 unless you're reusing the same contract for the option as for the underlying; otherwise, I've noticed TWS will simply retrieve the contract associated to the conId if not 0. |
Re: Anyone has code to show all option chain names for a symbol?
You're welcome :)
?
Regarding Open Interest, I don't use it but found this (very old) thread that mentions the tick types you could set in your reqMktData() call:
?
Basically, it says that you should add generic tick 101 to the reqMktData() function:
m_pClient->reqMktData( ++m_requestId , retContract, "101" , false , false , NULL ); ?
This should return a value in the tickSize() callback.
?
In the callback, just check the value of the field parameter and if it's field = 27, then the?size parameter will be the call open interest, and if field = 28 then it will be the put open interest. |
Re: Anyone has code to show all option chain names for a symbol?
Hey, I use these functions to get the options chain:
?
First, create a Contract for the underlying, as well as 2 vectors to capture options chain details (one of type std::string to retrieve expiry dates, and the other of type double to retrieve strike prices).
?
First, get the underlying contract ID to retrieve the options.
?
In the callback for reqContractDetails, we retrieve the contract ID and assign it to our underlying contract.
?
Once you have the conId, you can retrieve the options chain.
?
The response will be returned in the following callback:
?
|
Late Prints don't show up when I call reqHistoricalTicks()
I am trying to download all tick data for SPY
?
?m_pClient->reqHistoricalTicks(19001, ContractSamples::SPY_ETF(), TimeCode, "", 1000, "TRADES", 1, true, TagValueListSPtr());
?
I am getting all the data for 9:30 -> 16:00 hours Using this method
?
?
//! [tickbytickalllast]
void TestCppClient::tickByTickAllLast(int reqId, int tickType, time_t time, double price, int size, const TickAttrib& attribs, const std::string& exchange, const std::string& specialConditions) { ?
?
?
BUT when I look they are some prints that are late but don't show up calling reqHistoricalTicks()? (beyond 16:00 hours) See attached image.
?
Anyone know how I can get all the late prints that come after 16:00 hours???
?
?
?
?
? ?? |
Re: How to programatically approve a transaction: Security is under Surveillance
Glad that worked, Pranav, and thank you for sharing the solution. You asked about files where you can read TWS/IBGW settings from. Each account folder under the TWS/IBGW installation folder (the random looking folder names with 40 lower case characters) contains a file called tws.xml (for TWS), ibg.xml (for IB Gateway), or both depending on what you used for login. Those files contain all configuration and layout information. There are also daily backup copies such as tws.Wed.xml. Unfortunately, those files are encrypted and, in order to decrypt them, you'd have to log into TWS/IBGW:
The XML documents are length and have sections for many different layout and operational settings. Among them sections for API "Settings", "Precautions", and "News Configuration". I always wanted to make some tools to automate the monitoring and changing of TWS/IBGW configurations as well as TWS tabs so that I can guarantee consistency between multiple accounts. Reading and updating the XML files once decrypted is not that hard, but the decryption and recovery steps have to be done manually at this point (as far as i know). 闯ü谤驳别苍 ? ? ? On Thu, Mar 27, 2025 at 11:40 AM, Pranav Lal wrote:
|
Re: How to programatically approve a transaction: Security is under Surveillance
开云体育Hi all, ? Problem solved. I had to use a key value pair when specifying the string in the advancedErrorOverride property. advancedErrorOverride="8229,SURVEILLANCE" ? Pranav |