开云体育

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

Client ID 7 creates an order, master client ID try to update or cancel the order

 

I can reproduce this, I wonder if it is a known bug?

According to IB, Only Master Client ID can update or cancel order clients’ orders

Scenario:
Master Client ID = 1 defined in TWS configuration.?
?
Client ID 7 creates the orderId = 2225.
Client ID 1 (master) try to update the order 2225. It encounters this error:

2024-05-22 18:49:15 - ibinsync.wrapper - ERROR - Error 135, reqId 2235: Can't find order with id = **_2234**

Where the orderId 2234 came from??? I verified the order id being sent is 2225
Could it be due to ib_insync gets confused processing cross clientId update (or cancel) operations?

?

Thank you,


Merci

 

Thanks for letting me join this group

What are the plan?concerning the archive regarding the previous post on ib_insync, this was a gold mine of learning and it seems a missed opportunity for everyone not to migrate it to the new group?

Have a great day
Olivier Van Parys


Re: Handling Bot Restarts with OrderRef Issues?

 

This is too broad a question for this group. Esp. if your system works across trading sessions, and needs to keep track of various things, some sort of a storage is required.


Handling Bot Restarts with OrderRef Issues?

 

Hi, I'm not sure if this question falls within the scope of our discussion since it pertains to a broader topic. Here it is: I run with ib-async several strategies per client. To handle the restart of my bot at the correct level after a system or network shutdown, I implemented a local database to store orders and their metadata. This was due to the limitation I encountered with the OrderRef field, where my client and strategy identifiers are stored, being empty on execFilter. Is maintaining this database the best approach, or is there a more straightforward solution to handle this issue?
Txs
Yed


Re: [TWS API] Split data

 

开云体育

I found the latest split available through the API, but just the latest

On “ReportSnapshoot”

xml = ib.reqFundamentalData(contract,reportType='ReportSnapshot')


<Issues>
<Issue ID="1" Type="C" Desc="Common Stock" Order="1">
<IssueID Type="Name">Ordinary Shares</IssueID>
<IssueID Type="Ticker">AAPL</IssueID>
<IssueID Type="RIC">AAPL.O</IssueID>
<IssueID Type="DisplayRIC">AAPL.OQ</IssueID>
<IssueID Type="InstrumentPI">331724</IssueID>
<IssueID Type="QuotePI">7645713</IssueID>
<IssueID Type="InstrumentPermID">8590932301</IssueID>
<IssueID Type="QuotePermID">55835312773</IssueID>
<Exchange Code="NASD" Country="USA">NASDAQ</Exchange>
<GlobalListingType>OSR</GlobalListingType>
<MostRecentSplit Date="2020-08-31">4.0</MostRecentSplit>


On 12 May 2024, at 17:57, Mel <climbermel@...> wrote:




-------- Forwarded Message --------
Subject: Re: [TWS API] Split data
Date: Sun, 12 May 2024 06:00:16 -0700
From: rwk via groups.io <rwk0434@...>
Reply-To: [email protected]
To: [email protected]


For current (i.e. upcoming) splits, I use briefing[dot]com, split calendar. For historical data, I simply search on the symbol or company name looking for news around the time of a pricing anomaly.

Important functions of a stock data service include keeping a symbol universe current and adjusting for splits and share dividends. We need that to have any hope of gleaning useful data for testing ideas.


Re: Forum planning #forum_planning

 

Hi Mel, thanks for the info. Yeah this site has a Web 1.0 feel to it lol!

I am fine with your suggestions. It makes sense to split between groups.io for everyone and discord for a smaller group.?

Feel free to delegate stuff as needed, glad to help out with this!

Cheers.


[TWS API] Split data

 

开云体育




-------- Forwarded Message --------
Subject: Re: [TWS API] Split data
Date: Sun, 12 May 2024 06:00:16 -0700
From: rwk via groups.io <rwk0434@...>
Reply-To: [email protected]
To: [email protected]


For current (i.e. upcoming) splits, I use briefing[dot]com, split calendar. For historical data, I simply search on the symbol or company name looking for news around the time of a pricing anomaly.

Important functions of a stock data service include keeping a symbol universe current and adjusting for splits and share dividends. We need that to have any hope of gleaning useful data for testing ideas.


Re: Welcome to [email protected]

 

On Fri, May 10, 2024 at 04:20 PM, mdelvaux2 wrote:
Background on myself
- engineer working in the semiconductor industry
- strong interest in trading, including automated trading
- not very active right now, but looking into volatility based trading
- living in California but originally from Belgium
This could be me. Except for the 'living in California' part .... :-D?


Re: Welcome to [email protected]

 

开云体育

I'm confused, how do you run a cluster on one machine?

Mel





-------- Original message --------
From: "Gonzalo Saenz via groups.io" <yo@...>
Date: 2024-05-10 1:12 a.m. (GMT-08:00)
Subject: Re: [ib-async] Welcome to [email protected]

I keep it simple, it’s siting on the PC I have with kodi to watch films.

On 7 May 2024, at 19:35, Mel <climbermel@...> wrote:

OK that sounds fun, but it would be way beyond anything I would be doing. Here I thought having a server rack in my office was extreme... I have tried clusters yet.

Mel



Re: Welcome to [email protected]

 

开云体育

Good to have you on? board.? I started with excel api and then tws-api using C++ (struggled with that).? Then moved away from it to use NingjaTrader and C# for strategies.? I came back when I found how much easier ib_insync was, I started building a library of modules based on it.
Interestingly, I now find that I can actually build with tws-api using python, but it's still far harder.

I left being a software developer for financial programs, then hospital interfaces to trade full time.? Now I'm supposed to be retired, but still like programming and I manage our retirement accounts.

Mel






-------- Original message --------
From: "mdelvaux2 via groups.io" <mdelvaux@...>
Date: 2024-05-10 7:20 a.m. (GMT-08:00)
Subject: Re: [ib-async] Welcome to [email protected]

Hello,

I was a member of the old group and an active user of ib_insync, RIP Ewald.? I have used the IB API using different approaches, I give some more background below, and prefers ib_insync by far.? I do have some help routines that I may contribute but I am wondering if it is best to try to incorporate them into the library itself or simply as notebook/recipe.? Any advice on that appreciated.

About the discussion on storage, I currently do not use any form of database, but store bars on disk using parquet, possibly out of laziness.? I have thought about moving to some database for a while, and it would probably be some SQL based variant.? I am also not yet looking at dask level, not even close, everything done on a fast PC running Windows.

On a side topic, I much prefer the groups.io format compared to either discord or the github discussion.? Thank you for starting this.

Background on my IB API usage
- started with R and the IBrokers package, this was pre pandas days, so I was using R for data processing and python for everything else.? R is nice for table data but a pain for scripting (file and string manipulation)
- moved to a single language approach after numpy matured.? I started by using IbPy, this was before the introduction of the official python library by IB
- moved to the official python library when it become available, did not really like it, also tried C++ and liked it even less
- discovered ib_insync (tws_async at that time) and never looked back, this is paired with pandas for all data processing currently
- recently discovered polars, and somehow I prefer the polars approach to pandas, faster and somehow a more consistent syntax.? Not ready to switch yet as the library is not as rich as pandas yet.

Background on myself
- engineer working in the semiconductor industry
- strong interest in trading, including automated trading
- not very active right now, but looking into volatility based trading
- living in California but originally from Belgium


Re: Welcome to [email protected]

 

Hello,

I was a member of the old group and an active user of ib_insync, RIP Ewald.? I have used the IB API using different approaches, I give some more background below, and prefers ib_insync by far.? I do have some help routines that I may contribute but I am wondering if it is best to try to incorporate them into the library itself or simply as notebook/recipe.? Any advice on that appreciated.

About the discussion on storage, I currently do not use any form of database, but store bars on disk using parquet, possibly out of laziness.? I have thought about moving to some database for a while, and it would probably be some SQL based variant.? I am also not yet looking at dask level, not even close, everything done on a fast PC running Windows.

On a side topic, I much prefer the groups.io format compared to either discord or the github discussion.? Thank you for starting this.

Background on my IB API usage
- started with R and the IBrokers package, this was pre pandas days, so I was using R for data processing and python for everything else.? R is nice for table data but a pain for scripting (file and string manipulation)
- moved to a single language approach after numpy matured.? I started by using IbPy, this was before the introduction of the official python library by IB
- moved to the official python library when it become available, did not really like it, also tried C++ and liked it even less
- discovered ib_insync (tws_async at that time) and never looked back, this is paired with pandas for all data processing currently
- recently discovered polars, and somehow I prefer the polars approach to pandas, faster and somehow a more consistent syntax.? Not ready to switch yet as the library is not as rich as pandas yet.

Background on myself
- engineer working in the semiconductor industry
- strong interest in trading, including automated trading
- not very active right now, but looking into volatility based trading
- living in California but originally from Belgium


Re: Welcome to [email protected]

 

开云体育

I keep it simple, it’s siting on the PC I have with kodi to watch films.

On 7 May 2024, at 19:35, Mel <climbermel@...> wrote:

OK that sounds fun, but it would be way beyond anything I would be doing. Here I thought having a server rack in my office was extreme... I have tried clusters yet.

Mel



Re: Forum planning #forum_planning

 

开云体育

Hi Gary and welcome.? I can set various things? like auto accept new members, but grant them read only access the the messages.? Later, myself or a moderator can set it so they can post.? I can also set up a welcome message that explains things like rules etc.

The old group was very large, so I can't really see limiting this one to only a few members.

My discord group can go back to a smaller group once this one is established and it's purpose was for shared coding projects.? I find the layout better on? discord for projects as it is simple to separate the messages into channels.? I was disappointed that the hash tags are just flags, I thought they would branch into various threads.

We have a fair bit of time to get this worked out and we can even have 90 days to try the premium features.?

Mel





-------- Original message --------
From: "Gary Moody via groups.io" <garymoody1@...>
Date: 2024-05-09 7:44 a.m. (GMT-08:00)
Subject: Re: [ib-async] Forum planning #forum_planning

I agree with taking it slowly to start off since I'm new to this groups.io thing. Mel when you say you can automate a lot of the admin, how exactly would you accomplish that??

Before we open the floodgates, we need to decide what kind of forum we want this to be: do we want it to be exclusive to maybe only a select few dozen vetted members that can share coding and trading ideas without requiring constant support / moderating etc., or a more open, inclusive forum that is more dedicated to helping newbies get started and troubleshooting issues? Personally I would prefer the former but am not against being more inclusive, although my capacity for providing support and troubleshooting might not be up to the task lol!

As for a list of hashtags, here's a start:

#async_support, #ib_support, #coding, #trading_ideas, #algo_trading, #general?

(note no #python_support since there's plenty of resources out there for this!)


Re: Forum planning #forum_planning

 

I agree with taking it slowly to start off since I'm new to this groups.io thing. Mel when you say you can automate a lot of the admin, how exactly would you accomplish that??

Before we open the floodgates, we need to decide what kind of forum we want this to be: do we want it to be exclusive to maybe only a select few dozen vetted members that can share coding and trading ideas without requiring constant support / moderating etc., or a more open, inclusive forum that is more dedicated to helping newbies get started and troubleshooting issues? Personally I would prefer the former but am not against being more inclusive, although my capacity for providing support and troubleshooting might not be up to the task lol!

As for a list of hashtags, here's a start:

#async_support, #ib_support, #coding, #trading_ideas, #algo_trading, #general?

(note no #python_support since there's plenty of resources out there for this!)


Re: Welcome to [email protected]

 

PySimpleGUI uses tkinter, QT, WxPython, and/or Remi under the hood.


?


Re: Welcome to [email protected]

 

开云体育

I may have to look at that.? I've just used tkinter since it is already part of python.?

Mel





-------- Original message --------
From: "Ray Johnson via groups.io" <lasgo2000-1@...>
Date: 2024-05-08 4:25 p.m. (GMT-08:00)
Subject: Re: [ib-async] Welcome to [email protected]

I forgot to add, that I use PySimpleGUI to program the GUI of my Ib_Insync code.

Simple and lightweight. I like it a lot!


Re: Welcome to [email protected]

 

I forgot to add, that I use PySimpleGUI to program the GUI of my Ib_Insync code.

Simple and lightweight. I like it a lot!


Re: Welcome to [email protected]

 

I use it daily to get all my portfolio data such as positions, trades etc. I use the flex queries for that. Let me know if you need help cleaning up the code.

Mel


Re: Welcome to [email protected]

 

I have been trading options with IBKR since 2012.?
About 4 years ago I started using Ib_Insync to extract information from TWS, mainly data about my open positions (margin requirement etc.).
Later I started to extract option chain data from TWS for graphing.

This journey, connecting with TWS via the API, was also my journey to learn Python. So it was a double learning experience for me.
Needless to say, the software I have now is a complete mess, and I should clean it up some day ....
That said, I use this software every day and I hope that the Ib_Insync library will be kept up-to-date as "Ib-Async" for a long time to come....?


Re: Welcome to [email protected]

 

OK that sounds fun, but it would be way beyond anything I would be doing. Here I thought having a server rack in my office was extreme... I have tried clusters yet.

Mel