Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
VC and 10.35 and Protocol Buffers
In MSVC, has anyone succeeded in downloading the protocol buffer code, and the extra linked project ABSL code, and gotten it to compile with the sample API projects?? Not me so far.
?
The TWS-API revision # of PB in the supplied files is 5029003, and it needs the .h files from the protocolbuf project to compile.
The closest I can find for PB source version is the 29.x branch.? Though this build is actually 5029005 - so I adjusted the # to match.
?
Next is the linked ABSL (abseil-cpp) project and the branch with LTS 2024-07-22 was likely the current one to match PB 29 at the time, and avoids a bunch of function / link errors that the master and other branches cause.
?
Next adjust the VC source to the PB demanded C++ v17 code.
?
This combination gets me almost compiled, but with one error I cannot solve:? error C2857: '#include' statement specified with the /Ycstdafx.h command-line option was not found in the source file.? All the included files are there, so something is still a miss.?? The google side is built without a global include file, but the VC project uses the stdafx.h.??? I can't get anything to agree here.
?
Stumped.
?
?
? |
|||||||||||||||
volume data for stock
Hi All, one question on volume data received from IBKR. I know?that requesting data for STK, on past days with?reqHistoricalData, for example the ohlcv?with 1 min bar, for past days the volume is divided by 100 (I don't know why but comparing with other sources that is...). I noticed anyway if I use the reqHistoricalData to request data for CURRENT session (for example last 5 or 30 minutes), the volume data is correct,?without the division by 100. if my understanding is correct, this is not a big issue, but is there any option to configure ibapi?to return consistent volume numbers for both current sessions and past days? thanks! Marco |
|||||||||||||||
Re: Live data on multiple contracts - Python
You would have only one TestApp(). But you would remember the value of app_underlying.nextId() used for the subscription of each contract since future data callbacks will contain that requestId. That way you know which market data item belongs to which contract. Hope that helps. ´³¨¹°ù²µ±ð²Ô ? On Thu, Apr 24, 2025 at 09:21 PM, <danielsojka1@...> wrote:
...
?
?
?
|
|||||||||||||||
Live data on multiple contracts - Python
Hello!
?
I am not a programmer by trade. I started messing around with the TWS API as a side project to learn a little bit of coding.
?
I have figured out how to get historical data, get a full option chain etc. A friend of mine helped me figure out how to dump all the data I want into a CSV file.
?
I recently also took a day off of work to play with the code during market hours to see how live data works and because there is no greeks and no volume for options available in historical data.
?
Now, the line of code that requests live data is:
app_underlying.reqMktData(app_underlying.nextId(), option_contract, "", False, False, []) ?
where app_underlying is the instance of TestApp (I kept the name the same as in the IBKR documentation and basic tutorials on IBKR campus) and option_contract is an instance of Contract().
?
Now, suppose there is 50 contracts between all calls, puts, strikes, and expirations. I was thinking of instantiating Contract() class for every single one of those options.
?
But, how do I live stream all of them? Do I also have instantiate 50 TestApp() classes:
app_underlying = TestApp() and give each one a unique clientid and run threading on every one of them?
?
Thanks in advance!
? |
|||||||||||||||
Re: Securities for this order were not immediately available for short sale, but not asking to short...
I will try to lower LMT price.
This is for the STP LMT to work.
Original issue I'm having are orders that get an error message about not being able to short the stock.
I never ask to short a stock.
I only buy stocks then create OCA group sell orders...
Any idea what can be done for this? |
|||||||||||||||
Re: Securities for this order were not immediately available for short sale, but not asking to short...
Copilot is suggesting it'll work after hours as long as you set outsideRTH to true but some exchanges restrict these. It might also work if you just lower the STP LMT price if it's the order type that makes the difference. |
|||||||||||||||
Re: Securities for this order were not immediately available for short sale, but not asking to short...
Hi Patrick. I think the order isn't filling because the STP LMT order's LMT price is too high.? The LMT price normally will have to be lower than your STP price for this order to be triggered. Can you display both the LMT price and the STP price? Since these are STP LMT orders rather than STP orders, they will only trigger after going below the Aux price but will still require them to be above the LMT price. You may want to just have an STP order instead to guarantee an exit. Let me know your thoughts. |
|||||||||||||||
Re: missing contract details ie PCUSEQTR or COR1M COR3M COR70D
¿ªÔÆÌåÓýthank you for trying. I wanted to use the IB contract lookup tool and was surprised to see it had nothing in it. Have an excellent weekend. cp
On 4/24/25 10:44, ´³¨¹°ù²µ±ð²Ô Reinold via
groups.io wrote:
|
|||||||||||||||
Re: missing contract details ie PCUSEQTR or COR1M COR3M COR70D
All four contract details come up just fine for me. I simply use INDEX as the security type, the respective name as the symbol, and leave the resp undefined. Don't "overspecify" the contract for the call.
?
´³¨¹°ù²µ±ð²Ô
?
?
On Thu, Apr 24, 2025 at 10:06 AM, comicpilsen wrote:
|
|||||||||||||||
missing contract details ie PCUSEQTR or COR1M COR3M COR70D
using the IB contract lookup tool I can enter PCUSEQTR, COR1M ,COR3M ,COR70D and they all are contracts BUT there is no information pertaining to Type,Symbol,Exchange,Currency. I can also add them to a watch list ( ie PCUSEQTR right now is c0.54) but the tear sheet has nothing either. In cases like this how can I handle populating a request for historical data? |
|||||||||||||||
Re: Securities for this order were not immediately available for short sale, but not asking to short...
Did the OCA group in question fail to perform as expected though? I.e. none of the orders executed when price targets were reached, and/or some OCA orders were not dropped following another's execution? I could be missing something but it looks like it's possibly just a misleading message rather than an execution error. In this case it would of course still be troubling but not problematic.
?
?
--
Best, DS |
|||||||||||||||
Re: Some Paper trade Orders not filling after updating to 10.30
Thanks Orion.
The Order seems correct. I found one such case (AREB) which should have closed at 9:26:15 or a few seconds later. The MKT order (highlighted) was submitted at 9:23:15, should have become active at 9:26:15, but was then closed at 9:26:42 by the app and then replaced with a new order. The Start Time and End Time are showing in the Exchange's timezone (EST) and the Compltd Tm is showing in the local time (PST). Is there more detail I should look at?
?
|
|||||||||||||||
Re: Some Paper trade Orders not filling after updating to 10.30
In Classic TWS, if you do a mouse right-click over an API order placed by your application, then follow Modify -> Order Ticket and finally review all fields and tabs in the Order Ticket dialog do you confirm that all are set exactly as submitted by your application ?
-- |
|||||||||||||||
Paper Trading Account orders stuck in PendingSubmit
Does anyone have this issue? This is the case for orders submitted through the API, manually through TWS, or entered manually on the website. The paper trading API also has all kinds of weird slowness. For example, reqMarketTime can be 30 seconds different from the local clock occasionally, and qualifyContract takes 20 seconds. I have never had this issue until 2-3 days ago. |