Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: reqHistoricalData() for OTC only works if first typed symbol in TWS
I just moved over to IBKR a few months ago, and was thinking I could get the same data I had been getting from Polygon, cut that cost, and just use IBKR, I quickly found out I was wrong. Issues with Data limits. Number of concurrent connections. Historical data. Etc. Interactive Brokers, for my needs at least, just isn't set up in a way thats conducive for consuming data. Since Polygon upgraded their systems and APIs I've had zero issues with them. I don't even use IBKRs data for live trading unless it's for futures like DAX which polygon doesn't offer, for everything else, I use polygon streaming websockets data (but they offer REST as well). I can create and destroy API keys if we need to give an outside developer one to work on an issue not in our wheelhouse. I've never run into a connection limit issue. To download 2k tickers, of tick data for a full day, it only takes a few mins. If I want tick data or 2 minute bars or 17 minute bars, the data comes in any form I request it. They have all the other traditional metrics as well. IBKR has been really great for API integration. The one caveat to all this is, you need to be able to develop the programs/scripts you need to consume the polygon data. It's basically the only way to get it. GitHub has some good stuff others made but it made more sense for me to just build things for my usage. Hope that helps. On Fri, Feb 4, 2022, 11:10 PM Rob Tilley Jr. via <fladventurerob=[email protected]> wrote:
|
Re: Choose between: Client Portal API & TWS API
Thank you for your kind words, Rob. There are many reasons for abstraction layers (or wrappers, adapters, controllers, design patterns ...) The ability to hide implementations details and facilitate transparent changes is one of them. But I was thinking more about complexity reduction where you don't want to expose your higher level code to unnecessary detail and necessary API house keeping functions. An example for an essential API detail that is better hidden in some lower level code are request IDs. You want your trading logic focus on trading decisions and managing request IDs (or having to know exactly how to wire up three order objects to make bracket orders, ...) add unnecessary complexity, distraction, code duplication, and introduce many points of possible failure. So you will probably want to develop over time the kind of abstraction layers that make the API more stable and useful within your application architecture and preferences. Take a look at the ApiController class in the the Java API, for example. It is a traditional "Controller" class as you would expect it n a "Model - View - Controller" architecture. It operates EClient, EWrapper, and EClientSocket instances for you, bundles related requests and their responses into specialized interfaces and objects, and makes request Ids go away completely. There is nothing magical about Java and you can practice "do it right and forget about it" in all programming languages. ´³¨¹°ù²µ±ð²Ô |
Re: reqHistoricalData() for OTC only works if first typed symbol in TWS
¿ªÔÆÌåÓý
Thanks for the info. May you please share what headaches you had in using IBKR's data? Just to be curious, as I also need a data source.
From: [email protected] <[email protected]> on behalf of Rob Tilley Jr. <fladventurerob@...>
Sent: Saturday, February 5, 2022 12:09 PM To: [email protected] <[email protected]> Subject: Re: [TWS API] reqHistoricalData() for OTC only works if first typed symbol in TWS ?
The limitation is that interactive brokers is a broker, not a data provider. You can pull data, but it's not worth the headache to me, because everything IBKR does is centered around their core business, which is that of a broker. I use polygon.
They aren't expensive. It's a million times better and easier.?
On Fri, Feb 4, 2022, 10:53 PM PurpleIce <clone8080@...> wrote:
|
Re: Choose between: Client Portal API & TWS API
´³¨¹°ù²µ±ð²Ô, You always have such great responses. If I see you replied to an email to anyone, I always open it. So thank you for all your valuable?help. In your reply you discussed abstraction layers. I had a question about that just to clarify. The reason for hiding the details isn't to keep the details hidden per se, but for the purposes of making it possible to modify the implementation without breaking dependent code. Am I correct in my?understanding? Thanks, Rob On Fri, Feb 4, 2022, 12:22 PM ´³¨¹°ù²µ±ð²Ô Reinold via <TwsApiOnGroupsIo=[email protected]> wrote:
|
Re: reqHistoricalData() for OTC only works if first typed symbol in TWS
The limitation is that interactive brokers is a broker, not a data provider. You can pull data, but it's not worth the headache to me, because everything IBKR does is centered around their core business, which is that of a broker. I use polygon. They aren't expensive. It's a million times better and easier.? On Fri, Feb 4, 2022, 10:53 PM PurpleIce <clone8080@...> wrote:
|
Re: reqHistoricalData() for OTC only works if first typed symbol in TWS
¿ªÔÆÌåÓý
May I know what restrictions or issues the TWS API has that prevents it from being a data provider? Having a dedicated data source is fine - but adds another dependency for an auto trading system...
IB says in their TWS API documentation that the intended use of the API is not as a data provider.? That continues to show itself to be true.?
|
Re: Choose between: Client Portal API & TWS API
¿ªÔÆÌåÓý
Got you, totally agree. In the case of something going wild, I can imagine I'd open up anything available to recue
?
From: [email protected] <[email protected]> on behalf of FreeGoldRush <mike@...>
Sent: Saturday, February 5, 2022 4:57 AM To: [email protected] <[email protected]> Subject: Re: [TWS API] Choose between: Client Portal API & TWS API ?
Hard to add much to the answers here but I will agree that seeing my automated trades go through on the GUI is nice.? I trade every market day and will sometimes cancel an order because something unexpected happened.? This is rare but if you are running
automated trading you want backups for your backups.
|
Re: Choose between: Client Portal API & TWS API
¿ªÔÆÌåÓý
Thanks again for the detailed info. It seems Java is the way to go
?
The other thing matters is how many folks in the community (e.g., this email group) use a language - so I can get some help when weird things happen. May I know which language most folks use here? (also
Java?)
And thanks for the python framework and discuss group. I will check it out later.
Another question just pops up: what do most folks use the API for here? Auto trading? Or just get streamed quotes for other services? Is there some group discussing auto/programmed/AI trading?
Regards!
From: [email protected] <[email protected]> on behalf of ´³¨¹°ù²µ±ð²Ô Reinold via groups.io <TwsApiOnGroupsIo@...>
Sent: Saturday, February 5, 2022 4:38 AM To: [email protected] <[email protected]> Subject: Re: [TWS API] Choose between: Client Portal API & TWS API ?
When I said "clients" in my previous posts I was referring to TWS API client applications, not people who hire you. So if, for example. your API client application has placed a few orders but then crashes on you, having TWS instead of IBGW will let you
clean that up very quickly. We also found that having TWS helped with development and debugging.
Let me carefully meander into that programming language question "mine field" and share with you what this looks like from our end:
Did I hear a click ......... ? On Fri, Feb 4, 2022 at 01:22 PM, PurpleIce wrote:
|
Re: Conditions on twsactivex api
¿ªÔÆÌåÓýJoan ? Well, I did find time for this today after all (change of priorities). And I have to say, I was unable to reproduce your issue. ? I started by amending the demo program I mentioned earlier, to allow a condition to be specified for an order. This then used to set the Conditions property of the Order object in exactly the same way as the VBA in the Excel workbook, using the ParseConditions method of the TWS object. ? Because I don't have a market data subscription for the CT futures, I tried it first buying 100 IBM shares with the following condition, where 461318816 is the conid for ESH2: ? last of bid/ask Price of 461318816(GLOBEX) is >= 4460 ? and it worked perfectly. ? I then tried it using your CT2, like this: ? last of bid/ask Price of 376589407(NYBOT) is >= 1.2111 ? and it still worked! This seems to imply that you can use a contract in a condition for which you don't have market data, which is potentially very useful. (Mind you, the order just sat there waiting for the condition to be satisfied, but it wasn't rejected, so perhaps it would have remained waiting forever.) ? Next I tried it with the condition that gave you the error: ? last Price of 269459887(GLOBEX) is >= 1.15 ? and the order was accepted without problems. ? So clearly the order condition mechanism works fine when the ActiveX API is invoked from C#. So next I tried the same things with the sample Excel workbook, and they all worked fine there too. And I did all this with both API 976 and API 1012. ? I'm satisfied that there isn't actually a bug here, so the question is what caused your failure? Since I can't reproduce the problem, there's really not much more I can do. ? But I suggest you uninstall the API, then install the 9.76 version and start again, just in case something has got mixed up somehow. ? By the way, I notice that the order message information I was looking for from the API log isn't there at all, which seems completely bizarre to me. I always thought all API messages (except market data) were included in the log by default. Perhaps IB thought this is personal information so it shouldn't be in the log, but that seems daft to me, especially as the justification for encrypting the log files ¨C which is also daft ¨C was that they contain potentially personal information. ? Richard |
abapi installation
¿ªÔÆÌåÓýHello Folks,I am attempting to install abapi for use with the python TWS-API. Running pip install abapi gives the error message Defaulting to user installation because normal site-packages is not writeable ERROR: Could not find a version that satisfies the requirement abapi (from versions: none) ERROR: No matching distribution found for abapi (this is on a intel mac book pro, with python 2.7 and python 3.8.2, pip 22.0.3) Anybody know what is going on? thanks, Eric |
Re: Choose between: Client Portal API & TWS API
Nick
I agree with this and would add that it will take way more time and effort to implement your system with IB Api than it should.
toggle quoted message
Show quoted text
There are numerous gotcha's and general wackiness that you will just have to discover and solve. In the end you can accomplish pretty much anything you would expect a retail trading environment to do but it won't be a straight line from start to finish. On 2/4/2022 3:38 PM, ´³¨¹°ù²µ±ð²Ô Reinold via groups.io wrote:
I guess this is a long way of saying any of them will work but you will have to dig in a little to make the one you select work best for you. |
Re: reqHistoricalData() for OTC only works if first typed symbol in TWS
IB says in their TWS API documentation that the intended use of the API is not as a data provider.? That continues to show itself to be true.? I use polygon.io for data and IB for trade executions, but polygon is not yet offering OTC data.? So at this time I'm going to keep it simple and use IB only for trade executions.
|
Re: Choose between: Client Portal API & TWS API
Hard to add much to the answers here but I will agree that seeing my automated trades go through on the GUI is nice.? I trade every market day and will sometimes cancel an order because something unexpected happened.? This is rare but if you are running automated trading you want backups for your backups.
|
Re: Choose between: Client Portal API & TWS API
When I said "clients" in my previous posts I was referring to TWS API client applications, not people who hire you. So if, for example. your API client application has placed a few orders but then crashes on you, having TWS instead of IBGW will let you clean that up very quickly. We also found that having TWS helped with development and debugging.
toggle quoted message
Show quoted text
Let me carefully meander into that programming language question "mine field" and share with you what this looks like from our end:
Did I hear a click ......... ? On Fri, Feb 4, 2022 at 01:22 PM, PurpleIce wrote:
|
Re: Choose between: Client Portal API & TWS API
¿ªÔÆÌåÓý
Thank you, Nick.
Checked the API reference provided by Jurgen, so yes, useful things are hidden.
??
From: [email protected] <[email protected]> on behalf of Nick <news1000@...>
Sent: Saturday, February 5, 2022 3:07 AM To: [email protected] <[email protected]> Subject: Re: [TWS API] Choose between: Client Portal API & TWS API ?
IB's documentation is rather random in terms of organization but most of the info you need is there somewhere. You end up having to read or browse through the entire set of documentation to get a handle on what's available and how things fit together. On 2/4/2022 1:05 PM, PurpleIce wrote:
|
Re: Choose between: Client Portal API & TWS API
¿ªÔÆÌåÓý
Thanks for such detailed information, again, Jurgen.
I was surprised to learn the conid actually has a look up API - thank you!
So based on your info, I will definitely go with IBGW - I don't have clients so no GUI is needed for others.
I've used C# (at MSFT) and C++ (at GOOG), but I will choose Python for my trading project. Is there any difference for language support? (e.g. one language has better documentation than the other?)
From: [email protected] <[email protected]> on behalf of ´³¨¹°ù²µ±ð²Ô Reinold via groups.io <TwsApiOnGroupsIo@...>
Sent: Saturday, February 5, 2022 2:27 AM To: [email protected] <[email protected]> Subject: Re: [TWS API] Choose between: Client Portal API & TWS API ?
You are welcome, Yu.
The basic objects and concepts are the same between TWS API and the Web Portal API, so if in doubt, look at the TWS API documentation. Generally, you would make contract database lookups to retrieve contract IDs (conIds)? for more "human readable" descriptions of the instrument(s) you are interested in. Take a look atI and . Internally, TWS and IBGW are pretty much identical. We have not done it for the very latest versions, but when we compared that jars and classes for the same TWS and IBGW versions last year, they were virtually identical. IBGW will most likely use a little less memory, probably has fewer threads, and may use a little less CPU. IIBGW does not have to manage a complex UI with many moving and graphics intensive parts so there are fewer things that can go wrong. You also will have fewer pop-ups and "helpful" hints. If you know you won't use the GUI, go with IBGW. Your clients will not see a difference other than the four different default ports {IBGW, TWS} x {Paper, Live}. Which implementation language are you thinking of? ´³¨¹°ù²µ±ð²Ô On Fri, Feb 4, 2022 at 12:05 PM, PurpleIce wrote:
|
Re: Choose between: Client Portal API & TWS API
Nick
¿ªÔÆÌåÓýIB's documentation is rather random in terms of organization but most of the info you need is there somewhere. You end up having to read or browse through the entire set of
documentation to get a handle on what's available and how things
fit together. On 2/4/2022 1:05 PM, PurpleIce wrote:
|
Re: how to pause execution
There is a small fee for certain order modifications and cancellations, but there are credits for executed orders, too. And the ratio is (depending on market, exchange, and instrument)? between 10:1 and 20:1, meaning you would need to make 10 to 20 times more modifications/cancellations than you have order executions before you actually have to pay.
toggle quoted message
Show quoted text
On Fri, Feb 4, 2022 at 12:31 PM, ds-avatar wrote: One issue to keep in mind when cancelling orders as opposed to manually "unsubmitting" them in TWS is how that could count toward IBKR order cancellation guidelines as I believe there?are fees for non-SMART order cancellation via API above a certain balance against executions (). |