Keyboard Shortcuts
Likes
- Ib-Async
- Messages
Search
Re: Not properly parsing modified orders or am I missing the point of `Trade` objects?
Here is something that may be related. ?Take a look at line 512 of ib_async/wrapper.py, in the openOrder function, where it does ? ? ? ? ? ? trade.order.lmtPrice = order.lmtPriceIn my experience, after I submit a modified orde via ib_async to change the lmtPrice, later, when the modified order is then accepted by the server, IBKR sends back a response that ib_async handles via this openOrder function. ?Among other things, the openOrder function updates the lmtPrice field of the order registered with the trade (at the line noted above). ? This is how I've been tracking when IBKR accepts price modifications (which doesn't always happen right away). ?This has worked pretty reliably for me. ?There was a short email thread about it in the old ib_insync forum, which I don't have a copy of now. Here is code for the "patched" limit order object that I've used to implement this. ?It adds a new event that fires when the price is accepted in this way: class PatchedIBOrder(ibs.Order): |
Not properly parsing modified orders or am I missing the point of `Trade` objects?
I'm having some issues getting correct modified order data returned by As an example workflow, I place a position order and a stop order. Once the position order fills, I modify the stop order and send it. Placed Order
Here are the TWS API Logs to corroborate what's in the returned
Modified Order
However, the TWS API Logs show the modified price in the callback:
Since TWS is sending back the price as modified, maybe I'm missing the point of |
Re: Forum planning
#forum_planning
Dear Mel,
thanks for the discussion. Indeed I would appreciate a general instruction like your mentioned general framework. Personally, I have still the problem that I don't know if I am running into troubles as a result of a wrong IB setup routine (e.g. starting the async loop or qasync loop or using ib_async loop or class implementation or something else) or wrong calls of ib_async functions (e.g. ib.reqContractDetails vs. ib.reqContractDetailsAsync). I moved to ib_in/async because I ended with the tws-api in a dead-end street (of my knowledge), now I don't know if I should move left (function calls) or right (async calls) or is 3 times right = 1 time left (which means it's possible to mix with async calls) Therefore it would be very helpfull to have a structured example with base functions. It's not needed to have a full running code, but the logic should be visible to get the used strategie. There are many ways to Rome... Kind Regards Hans |
Re: Forum planning
#forum_planning
That is where sample code is difficult... I have a lot of basic modules I can call such as starting IB, various reporting, Flex Reports and on and on. But then when it comes to others using that code, there can be issues such as you would need to use the same folder structure as I do to use a lot of my code as I have the code in 3 folders (code, gui, flex) depending on what I want to run. I also have parm, input & output that all my modules expect to find. The other issue comes to other added modues... I use tkinter as it is already built in. Others use pyQt, pySide or even pyGame. One fellow built a nice framework () that was nice but complex. The downside was he wanted to make it multi broker and then TDA merged with Schwab and the API was gone. I may have to delve into it again and consider something like that except just for IB. If something like a general framework that utilizes ib-async interests you and you want to work on it with others, let me know and I will set up a repo for it. Then people could install that and have a lot of built in capabilities for ib_async. Just thoughts... Mel |
Re: Forum planning
#forum_planning
Dear Ray,
yes, I know them. But indeed, for use in a program they are sometimes not handy enough. Do you think that it makes sense to write small programs (Pyqt6 in my case) to demonstrate the usages and keep them like the notebook receipes? So, e.g. if we have a 'standard' init function for IB, it will also be easier to support and find bugs / program issues. Kind Regards Hans |
Re: Forum planning
#forum_planning
Yes I have added the new addresses to the Links Wiki. I re-wrote some of those notebooks to run simply with python as I don't use Jupyter Notebook. I will have those on ib_tools if anyone is interested. Thanks, Mel |
Updated Wiki Page: Links
#wiki-notice
Group Notification
The wiki page Links has been updated by Mel <climbermel@...>. |
Re: Merci
开云体育We don't have the "raw" files from the old forum.? One user has provided all the emails and email digests, but they need the personal data removed which we are close to finishing. Mel -------- Original message -------- From: "MB via groups.io" <mbaker@...> Date: 2024-06-06 5:33 a.m. (GMT-08:00) Subject: Re: [ib-async] Merci |
Re: Forum planning
#forum_planning
开云体育I have been trying to do something along those lines in my ib_tools.? It was a place for me to collect functions as I got them working.? I haven't used async much but I just posted an example there from the old forum that shows setting up a callback. I don't use jupyter so the notebooks were a pain when I first started.? So my ib_tools runs just under python. If there is a specific part you are having trouble with give us an example and some code that isn't working and I'm sure one of us can help. Welcome, Mel -------- Original message -------- From: "hjm via groups.io" <hjm@...> Date: 2024-06-06 5:33 a.m. (GMT-08:00) Subject: Re: [ib-async] Forum planning #forum_planning Hi there and many thanks that some people continue the work of erdewit. According suggestion what's interesting for the 'new' forum, I will give my 5 cent. |
Re: Forum planning
#forum_planning
Hans,
I assume you are familiar with the Ib_Insync Notebooks, code recipes and docs? For now, all or most of that code should still work for Ib_async: https://ib-insync.readthedocs.io/readme.html Kind regards Ray |
Re: Forum planning
#forum_planning
Hi there and many thanks that some people continue the work of erdewit. According suggestion what's interesting for the 'new' forum, I will give my 5 cent. |
Re: ib_tool on GitHub
开云体育I do that with clean up.? So I but an app for that.? It's a little python app that will search any drive or folder including network folders and servers. -------- Original message -------- From: "Patrick Dufour via groups.io" <info@...> Date: 2024-06-05 11:49 a.m. (GMT-08:00) Subject: Re: [ib-async] ib_tool on GitHub Mel, There is so many other examples i want to create. You know as me the recurring requests from beginners. This fall i hope i will have time to send you a bunch of them. From the one i have posted, i think there is 2 that could be interesting:
|
Re: ib_tool on GitHub
Mel, There is so many other examples i want to create. You know as me the recurring requests from beginners. This fall i hope i will have time to send you a bunch of them. From the one i have posted, i think there is 2 that could be interesting:
|
ib_tool on GitHub
I am cleaning up my ib_tools and I have added this code from the old forum as requested. Message #6484 1a. Re: Async event handling problem with orderStatusEvent From: Patrick Dufour Date: Tue, 29 Jun 2021 Sample Algo Template: If there are any code samples you feel would be good to put on there as well let me know. I do need to clean up the code as it is all using ib_insyc still. Mel |
Re: accessing advancing / declining issues
I did a bit of looking into this, here is some basic code to start with: You can change the AD-AMEX & AMEX to AD-NYSE & NYSE The marketDataType(3) gives me delayed data since I'm not subscribed to that index data. The code below gave the the same numbers as shown for Advancing Issues and Declining Issues as seen in the Market Statistics tab. I'll check on getting the other numbers. sym = 'AD-AMEX' ex = 'AMEX' contract = Contract(secType='IND', symbol=sym, exchange=ex, currency='USD') ib.qualifyContracts(contract) ib.reqMarketDataType(3) data = ib.reqMktData(contract) ib.sleep(2) AdvIssuses = data.bid DecIssuses = data.ask print(AdvIssuses) print(DecIssuses) Cheers, Mel |
Re: Merci
toggle quoted message
Show quoted text
-------- Original message -------- From: "mbaker via groups.io" <mbaker@...> Date: 2024-06-02 3:43 a.m. (GMT-08:00) Subject: Re: [ib-async] Merci |
Re: Sponsorship of group
开云体育Yes FP is helping me with that.? I'll probably set up storage for it on my GitHub or possibly in the files section here if it isn't too big. Mel -------- Original message -------- From: "Sdoof via groups.io" <olivier.vanparys@...> Date: 2024-06-01 9:18 a.m. (GMT-08:00) Subject: Re: [ib-async] Sponsorship of group |