Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: Fractional shares rounding issue
Nick
Yes, that's the api log but unfortunately IB isn't showing the fields from the initial connection which is where the version numbers are. I couldn't remember if they were included or not but figured if you already had the logs it was worth a chance.
toggle quoted message
Show quoted text
Maybe you could ask in the ib_insync group and they could tell you how to get a version of the lib that has the features you need. On 10/19/2021 11:16 PM, hieuimba@... wrote:
Just so we're on the same page, |
Re: Fractional shares rounding issue
Just so we're on the same page, I believe you are talking about this API log right:?
Due to privacy regulations, logs are?encrypted?before they are saved to disk. They can be decrypted from the associated TWS or IB Gateway session. In TWS: Classic TWS -> Account -> Diagnostics -> TWS Logs. In IB Gateway, File -> Gateway Logs.If I have it correct it should be this file: C:\Jts\oboecfmlfmiihkmhcllfnckaeplfhfnchppdchbn\api.0.20211019.162140.ibgzenc However, I couldn't find any "API" text, here are the first few lines of the log: ============================== Log file: C:\Jts\oboecfmlfmiihkmhcllfnckaeplfhfnchppdchbn\api.0.20211019.162140.ibgzenc =============================
16:21:40:453 -> ---15-1-[MyAccountID]-
16:21:40:475 -> ---9-1-8-
16:21:40:476 -> ---54-2--1-2104-Market data farm connection is OK:usfarm-
16:21:40:476 -> ---34-2--1-2106-HMDS data farm connection is OK:ushmds-
16:21:40:476 -> ---84-2--1-2158-Sec-def data farm connection is OK:secdefnj-
16:21:40:477 <- 15-1-1- 16:21:40:477 <- 61-1- |
Re: Fractional shares rounding issue
Nick
I haven't looked at the api logs in a while. If the logs include the connect processing (ie the very first things the client sends to tws) then the version numbers will be in there.
toggle quoted message
Show quoted text
Assuming it's the newer protocol you will see the client sending the text "API" and "V100..NNN" where NNN is the max version the client can support. Then TWS will send the actual server version followed by connect time. On 10/19/2021 10:28 PM, hieuimba@... wrote:
I might have to go ask the guys at ib_insync on how to track down MinClientVersion and MaxClientVersion |
Re: Fractional shares rounding issue
Welp that explains it.
toggle quoted message
Show quoted text
I might have to go ask the guys at ib_insync on how to track down MinClientVersion and MaxClientVersion? However, the ibapi package probably came with the library because I didn't explicitly download or install it, which would imply that the API version is outdated in the package But again I'm using the same or even older version of the library on my other machine and it works fine Will have to confirm and see? On Tue, Oct 19, 2021 at 08:14 PM, ´³¨¹°ù²µ±ð²Ô Reinold wrote:
Sure, a lot of them actually, I was quite surprised when I found out about this too. Pretty much all the large and medium caps, I've only had one instance where fractional sizes weren't supported and it was with a very small stock? |
Re: Support and Resistance of a stock
¿ªÔÆÌåÓýThis is awesome thanks
On 10/19/2021 2:40 PM, ´³¨¹°ù²µ±ð²Ô Reinold via groups.io wrote: The available market data is described in the section of the . The table is probably the most comprehensive list of Level I related data items. |
Re: Fractional shares rounding issue
Okay I was able to go into ib_insync ib.py and look at the client object I'm running this TWS on a cloud instance, with IBC 3.10.0:? |
Re: Fractional shares rounding issue
Nick
I would also note that IB often allows TWS to accept quite old api versions. So a recent TWS version is not an indicator that a recent api version is being used.
toggle quoted message
Show quoted text
On 10/19/2021 6:22 PM, ´³¨¹°ù²µ±ð²Ô Reinold via groups.io wrote:
The required minimum client protocol level for fractional size support is 163. So I'm sure, TWS will send rounded sizes to a client (any language) that indicates a MAX_VERSION of less than 163. |
Re: Fractional shares rounding issue
Which instrument are you trading? I can't tell you how to find the client and server versions with ib_insync, but there is probably a way. During connect(), TWS API client indicate the [min, max] protocol level they understand, and TWS replies with its level. Levels are defined (for example):
The required minimum client protocol level for fractional size support is 163. So I'm sure, TWS will send rounded sizes to a client (any language) that indicates a MAX_VERSION of less than 163. The protocol level for the connected TWS is available through the EClient object. ´³¨¹°ù²µ±ð²Ô |
Re: Fractional shares rounding issue
Thanks for the pointers guys,
I looked at the API logging file and it looks like TWS is indeed sending rounded values More specifically these values: - Order quantity (open and closed) - Position quantity For example: I inputted all orders manually and used fractional shares like 3.333, TWS has no problem with accepting and executing the order. However the API sends/ I receive only 3 for quantity My TWS version is: 10.10.2q - where do I find the API version? Another interesting thing is that I tried the same script with the same account in another computer running version 10.10.2r and it gives the desired/correct qty amount in fraction. |
Re: Adding multiple Exchanges to a scanner
¿ªÔÆÌåÓýOk,
I created a tool to parse the XML GetScannerParameters results and got this.. On 10/19/2021 10:26 AM, Colin B Maharaj via groups.io wrote: Hi, firstly I got the scanner working with the tools I mentioned before. |
Support and Resistance of a stock
¿ªÔÆÌåÓýIs it possible to either1. Get via an API call,? the current support and resistance of a stock or 2. Calculate if it is not available. |
Re: Fractional shares rounding issue
Can you be a little more specific about a couple aspects of your issue?
´³¨¹°ù²µ±ð²Ô |
Re: Fractional shares rounding issue
Nick
I don't know if it's due to a setting but if you enable api logging you can see what TWS sent and verify if it's a TWS issue or something on the client side.
toggle quoted message
Show quoted text
On 10/19/2021 1:59 PM, hieuimba@... wrote:
I'm having trouble getting data from TWS where the quantity amount is being returned as rounded numbers instead of their correct fractional shares value. |
Fractional shares rounding issue
I'm having trouble getting data from TWS where the quantity amount is being returned as rounded numbers instead of their correct fractional shares value.
This happened with all positions and orders which led me to think that this option in Settings might have something to do with it: But as you can see it is turned off here but the error still persists: I use ib_insync btw but as far as I can tell it should not be the source of the issue. |
Re: Scanning with IABSocketAPI in C++ Builder
¿ªÔÆÌåÓýwow, ok, I got it working.
On 10/18/2021 1:37 PM, Nick wrote:
|