Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Java 18 present but TWS installer script still downloads Java 1.8
I already have JDK 18 installed:
java -version
openjdk version "18" 2022-03-22
OpenJDK Runtime Environment (build 18+36-2087)
OpenJDK 64-Bit Server VM (build 18+36-2087, mixed mode, sharing
But running the TWS installer script doesn't use it and downloads 1.7 version. Why? ./tws-latest-linux-x64.sh? No suitable Java Virtual Machine could be found on your system.
Downloading JRE with wget ...
--2023-09-03 16:15:41--? https://download2.interactivebrokers.com/installers/jres/linux-amd64-1.8.0_202.tar.gz |
IB Gateway docker image
¿ªÔÆÌåÓýHi Everyone,For those using docker, I¡¯m maintaining a docker image with IB gateway. It¡¯s a fork of??which has not been maintained for a few months now. I have done some refactoring on the original Dockerfile and managed to squeeze a few Mb out of it. It¡¯s ~15% smaller now. It supports IBC 3.18.0, and new images will be published with latest IBC. The image repo is here ¡ª>? And the source code here ¡ª>? Hope you find it useful. Regards, Gonzalo |
Cannot get greeks via TickOptionComputation callback
Hi
It is regarding futures options (/MES) I have required data subscribtions - in TWS and mobile app I can see greeks for MES options. While I debug I get only ticks with prices etc. but?TickOptionComputation is not called at all. I tried both with snapshot and realtime data. Does not make difference. Any clues? |
Re: guide to using tws api logs??
so the upshot of this is that IB's documentation is in the code. Interesting, certainly something to raise with the great and good from Stamford next month. Ironically I'll be in 141 W. Jackson on Friday so I'll see what they have to offer. To be honest I am REALLY enjoying using ewald's ib_insync for python. He has an excellent way of documentation and it's a real pleasure to use jupyter labs with his code now that it's got an integrated debugger. I'm fine with spending a couple of hours on this as it's fun. Now you have pointed me at the code documentation I can have a little relax. This seems like a simple protocol and the asynch side looks pretty straightforward. Might be nice to just take a peek with wireshark to see how interesting IB's encryption is. Thanks again for your REALLY helpful observations. |
Re: guide to using tws api logs??
I know. But when you click the "Copyrights and Trademarks" link in the bottom left of that page you will find that the page is based on "TWS Javahelp version 008, March 2, 2007" hence my comment that the page is outdated. Everything was a little different 16 years ago and what they called "API Logging" then has some vague resemblance to what you'll find in TWSLog today: From my TWSLog from today: [JTS-EServerSocket-326] - [0:173:173:1:0:0:0:DET] ReqNewsBulletins(12)::[version=1,downloadDaysMsgs=true]
[JTS-EServerSocket-326] - [0:173:173:1:0:0:0:DET] ReqAcctData(6)::[version=2,ID=2147483647,acctCode=null,accountRequestType=START_UPDATE]
[JTS-EServerSocket-326] - [0:173:173:1:0:0:0:DET] [2;1;null]
[JTS-EServerSocket-326] - [0:173:173:1:0:0:0:DET] ReqAllOpenOrders(16)::[version=1]
[JTS-EServerSocket-326] - [0:173:173:1:0:0:0:DET] ReqAutoOpenOrders(15)::[version=1,autoOpenOrders=false] So forget about that ancient artifact. And before you spend a lot of time on log debugging, give direct routing to the SPX options exchange a try. Should not take you more than a few seconds. ´³¨¹°ù²µ±ð²Ô PS. A couple more hints that the page you are reading has little to do with reality is that it says "it logs certain information to its 'log.txt' log file," Try to find that one. And the page documents only 14 Request identifiers and 14 Response identifiers. In TWS API 10.24, the highest Request identifier is REQ_USER_INFO = 104 and the highest Response identifier is USER_INFO = 107. On Wed, Aug 30, 2023 at 08:23 PM, comicpilsen wrote:
|
Re: guide to using tws api logs??
Well, you are reading (outdated) documentation for TWS logs (as in Help->Troubleshooting->Diagnostics->TWSLogs) but you have posted API logs (as in Help->Troubleshooting->Diagnostics->APILogs). They are very different. I was commenting on the APILogs you had posted that your documentation link does not cover. The best documentation for APILogs is, still, the API source code. ´³¨¹°ù²µ±ð²Ô On Wed, Aug 30, 2023 at 06:51 PM, comicpilsen wrote:
|
Re: guide to using tws api logs??
I am a huge fan of youtube videos when it comes to this kind of thing but I get your point. I did find this and will be following up with IB when I meet up with them next month. I read through the docs that IB produce but I didn't see anything that leapt out at me regarding the source code. Thanks for pointing that out. I am using python for this. As I said in my follow up post I found the layout of the log and will run the test tomorrow using it, to me it reads that the message format differs from your version
Perhaps I am reading BOTH incorrectly. Thank you for taking the time to give me more information. I wanted to match my call to qualify contracts to the api log as it "seemed" simple. Decrypt the log to a text file and search for the relevant client call using the IB doc message layout. I'll take a quick look at EClientSocket tomorrow to see where I went wrong. Ewald ( ib_insync) has coded up an EXCELLENT notebook that I was using to test out jupyter lab and that's how I dug myself into this. Normally I would be using pluto and julia but I was too lazy to add in the julia kernel. Ho hum. Thanks again for the WONDERFUL analysis.You are doing a marvelous job. |
Re: guide to using tws api logs??
A YouTube video? Really? How about some popcorn and soda with that movie? What you are looking at are the raw messages your client sends to TWS/IBGW through the socket each time it calls a request method ("<-") and the responses from TWS/IBGW to your client that eventually become callbacks ("->"). You can find the source code for the message sender (the code in your client that converts your request calls into messages) and the decoder (that parses TWS/IBGW responses and makes the callbacks) in your TWS API installation for the programming language of your choice. Reading that source code also shows you how each message is structured. Each message starts with a binary 4 byte message length field. They are generally not printable characters and may show up as "bird dropping" or other funny characters in the log and have nothing to do with corruption. The second field in each message is the message id code that identifies what the message is about. It looks like you use Python (judging from a similar post you made in the ib_insync group) so that you can find the definition of the message id code in the IN and OUT classes that are defined in message.py:
The account related information you see are code 73 ACCOUNT_UPDATE_MULTI responses from TWS/IBGW () and are indeed part of the API operation between your client and TWS/IBGW. There can be any number of things going on, but what jumps at me is that you SMART route your SPX option market data requests. I don't have too much practical experience with SPX options, but there may just not be a lot of market data available through that route. One of the options users may want to comment here. I'd try contracts in your calls that route directly to the exchange where SPX options are traded and monitor in TWS that there is activity for those options. Happy debugging. ´³¨¹°ù²µ±ð²Ô On Wed, Aug 30, 2023 at 04:40 PM, comicpilsen wrote:
message.py IN and OUT classes <- IN (as seen from TWS) -> OUT |
Re: guide to using tws api logs??
I hit send too quickly, sorry. The api log level is "DETAIL" and I did read the docs
so the first line below makes sense to me BUT the next line ( from the actual log segment above) makes no sense to me.
|
guide to using tws api logs??
Hi all having some problems with my code. I want to qualify the Contracts on the SPX ( about 48) and it's not returning. I tried using the repl but nothing happens it just hangs. I tried leaving it for 30 minutes no luck. So I decided to look at the logs to see what is going on. I can download, decrypt and look at the api logs but they seem to be too poorly formatted to be correct. I am seeing a lot of sequences like this one
which looks like accounting information and not api centric. and nothing, that I can see, pertinent to my call. In the repl I see ( last few cells )
but in the log I see
So I can't tell if this is corruption ( denoted by ) or something else like a failed decryption. What I would like to see is just the api traffic and not the accounting information. I thought I specified just the api when I saved and decrypted the file from TWS desktop. Is there a guide for analyzing the logs? A youtube video would be excellent. |
Re: Parent/Child orders with different TotalQuantity not working
First of all, your example doesn't make logical sense because if the child order is triggered here, there is no way the parent orders hasn't executed anyway. Hence, the conditional structure is meaningless, and in fact TWS will even pop a big warning when trying to manually place attached orders aligned to the same trade side like this. On to the point, to assign different size proportions to the system-served attachment of opposite orders, the attachment must be modified with the pair-trade trade marker, as I described a few days ago elsewhere in these discussions sharing this same theme. Once submitted, the structure looks like the one on the screenshot below, with the tentative monetary quantity of the trades, highlighted with orange, exposing a 1:2 proportion of shares in the orders for same equity: -- Best, DS |
Re: MidPrice algo syntax, and other algo syntax
... and is described in more detail in the specifically at
toggle quoted message
Show quoted text
´³¨¹°ù²µ±ð²Ô On Mon, Aug 28, 2023 at 09:52 AM, John wrote: On Tue, Aug 22, 2023 at 09:49 AM, John wrote: |
Re: MidPrice algo syntax, and other algo syntax
On Tue, Aug 22, 2023 at 09:49 AM, John wrote:
MIDPXJust realized that although this order type is not explained on the Basic Orders page, it is defined in the Advanced Orders and Algos page?? This code works: c = Contract() c.secType = 'STK' c.symbol = 'AAPL' c.exchange = 'SMART' c.currency = 'USD' o = Order() o.action = 'BUY' o.totalQuantity = 1 o.orderType = 'MIDPRICE' app.placeOrder(3,c,o) |
Re: Parent/Child orders with different TotalQuantity not working
Yes, I believe this is by design. If this is to take partial profits, best to have independent parent/child orders for the runners. There is also an adjustable stop feature which you can set on the runner order if you want to move the stop based on how much price has moved..
|
Re: Parent/Child orders with different TotalQuantity not working
I have the same problem - for a long time. I believed this is by design and therefore stopped using the native parent/child order from TWS. I implemented almost all order types myself and only use mark order, stop order and limit order from TWS.?
|
Re: Parent/Child orders with different TotalQuantity not working
It seems this was brought up here too. |