¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io
Date   
reqAccountSummary() socket API request unkown extra field (50000001) 3
Hi all, I'm implementing a direct socket connection to IB Gateway (v187) and constructing messages manually according to the low-level TWS API protocol. I ran into an undocumented (?) issue with the reqAccountSummary (opcode 62). According to all available documentation, the expected fields are: "62" + reqId + groupName + tags However, when I sent this message: 62?2?All?NetLiquidation,TotalCashValue? IBGW responded with the following error: Unable to parse field: 'Client Req Id' for input string: 'All' I have to send the following sequence in order to receive a valid response: 62?1?50000001?All?NetLiquidation,TotalCashValue? What is exactly this "50000001" field (accountId? clientKey? something else)? Is this field always required, or only under certain conditions (e.g., IBGW, multi-account setups, recent protocol versions)? I captured this "50000001" from the data sent by the C# sample code included with TWS API. Thanks in advance for any clarification ¡ª and for all the great help on this list!
Started by Tradiator @ · Most recent @
How is everybody plotting their data? 2
I've searched if anybody uses mplfinance or plotly and not much comes up. I'm curious how any of you are plotting your data (if you are). I need to in order to see if the indicators I've coded are behaving properly. I'm using this code to request historic and tickbytick. I have to wait for market to open to see if it does receive tickbytick. It's supposed to retrieve the last thousand ticks along with new tickbytick but it's not working this weekend. But I'm wondering what anybody is using to plot the data once it's in. I don't know how to pass it through mplfinance #request data app.reqTickByTickData(19001, mycontract, "Last", 1000, True) #receive data def tickByTickMidPoint(self, reqId: int, time: int, midPoint: float): print("Midpoint. ReqId:", reqId, "Time:", time, "MidPoint:", floatMaxString(midPoint))
Started by donye @ · Most recent @
are stop orders native ? 6
When I place a stop order, does it get placed at the CME Globx exchange natively? Or does IB manage the trigger and then place LMT or MKT order at the exchange? Thank you
Started by @sv624 @ · Most recent @
liquidHours and tradingHours format
Just received this in ContractDetails for liquidHours and tradingHours, BTC (PAXOS) market: ['', '20250504:0300-20250505:1600', '20250505:1601-20250506:1600', '20250506:1601-20250507:1600', '20250507:1601-20250508:1600', '20250508:1601-20250509:1600'] Does anyone know what's the empty string at the beginning? An error? Or does it mean "ongoing session"? I was trying to parse these data for building a per day opening and closing time, and the first data point is a challenge given they express the overnight trading including a next day date for the end time. Why don't they just use 00:00 and 23:59 and express directly per day? What do you do with the information this way for consistency? Like if I scrape "today", the first data point lacks information to build the full picture. The frustsration whilst dealing with IBKR design choices has no end. Renato
Started by Renato Votto @
Live data on multiple contracts - Python 5
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() app_underlying.connect("127.0.0.1", port, 0) threading.Thread(target=app_underlying.run).start() and give each one a unique clientid and run threading on every one of them? Thanks in advance!
Started by @Dan_F @ · Most recent @
parentPermId always 0 (zero)
I am placing a parent order with two attached bracket orders in TWS and when transmitting the orders, my client application connected to TWS sees the parentPermId of the bracket orders as always 0 (zero). I would expect the parentPermId field of the bracket orders to be set to the permId of the parent order. Has anyone had success using the parentPermId effectively ? -- https://www.tradingsoftwarelab.com
Started by Orionn @
Some Paper trade Orders not filling after updating to 10.30 16
Hi, I'm new on this forum. I found after updating, that some of my orders never filled despite the price conditions and time conditions being hit. I do an exit sell order using an OCA Group; one an optimistic LMT order, another is a pessimistic STP order and lastly have a MKT order set 3 minutes in the future. This worked well up until I updated to 10.30; The MKT and STP orders don't activate on some stocks while using a Paper Trading account. I read that some users here had issues with 10.30 and moved onto a later version. I would like to at least try that. For people that found success moving on to a new version what version did you move on to where you didn't have any issues?
Started by plborgprograms@... @ · Most recent @
Missing bid delta for some options 3
Hello, I use tickOptionComputation to retrieve Greeks from IB. I correctly receive the model Greeks, such as delta, and I also properly receive the ask deltas. However, for some options, I do not receive the bid delta (these are shown in yellow). Since at least one bid delta is received, I believe this is not a programming error ¡ª it seems that IB simply does not send this data in some cases. What do you think? Also, I have another question: in the picture, the model delta lies between the bid and ask deltas. However, sometimes the model delta falls outside the range defined by the bid and ask deltas. Why does this happen? Thanks, Zsolt
Started by Zsolt Soczo @ · Most recent @
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.
Started by rossh_yh @
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
Started by Marco @
Auto Restart & Auto Login w/ IB Gateway and Linux
Hi Bredan: I'm also having issues with IB Gateway crashes. Is it possible to restart it without manual intervention? Regards, Jes¨²s
Started by Jesus Barbero @
Securities for this order were not immediately available for short sale, but not asking to short... 18
Hi, I've been receiving this error for a long time now. Can't find anything online regarding this issue. In this example: I buy 2 stocks. I have 1 Sell OCA group with 3 orders. I have 1 other Sell OCA group with 4 orders. Any help would be much appreciated. Thanks
Started by Patrick Lapointe @ · Most recent @
missing contract details ie PCUSEQTR or COR1M COR3M COR70D 3
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?
Started by comicpilsen @ · Most recent @
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.
Started by Frank Bernett @
Streaming Market Data
I have a TWS account. I am looking to get a price list every 5 seconds from a list of stocks (about 40) - using IBKR API - and log to a file. Do I need any "Streaming Market Data" subscription? Thanks
Started by Danny @
TWS Time zone 5
I¡¯m in the central time zone but I have my computers on EDT. When I run TWS on my new computer it displays CDT, not EDT. When I run it on any of my other computers it uses EDT. My new computer is setup for EDT and that¡¯s what it shows in the task bar. Selecting ¡°more options¡± on the TWS login screen shows the time zone as ¡°(UTC-05:00) America/New York¡± on the new and old computers. Any ideas? Frank
Started by Frank Bell @ · Most recent @
IB via Lightspeed 8
Hello, Slightly off group topic, received an email from Lightspeed, saying they launched a new API that allows IB clients to do algo trading via direct API calls to their platform. Link Below. They claim it doesn't require IB Gateway running not sure if that's good or bad. - has anyone experience with it? - has anyone concerns with using this type of alternatives Thank you. https://lightspeed.com/trading/api-trading-at-IBKR
Started by John @ · Most recent @
TwsApi.jar and TwsApi_debug.jar
Does anyone know the difference between "TwsApi.jar" and "TwsApi_debug.jar" in IBJts/source/JavaClient of the Java TWS API ? Thank you. -- https://www.tradingsoftwarelab.com
Started by Orionn @
Place Trailing Stop Limit Order
Hi, I would like to place a trailing stop order based on execution details received back from IBKR. The original order is a market order, so using the trailing order for risk management and profit taking if any. I am struggling with: I need to ensure I only book the trailing limit stop order for new (original order), not get stuck in an infinite loop of booking at this point. How can I identify/tag the original order. If I use parent/child order (on execution Details not using brackets), I get error that stop orders can be attached to limit or stop limit, not market orders. The executionDetails callback sometimes fires n times for an order of quantity n. Should I be booking the trailing order each time or wait for when fill=totalOrder? Please advise. Thank you. Mugu
Started by mugu@... @
Maximum number of symbols for live prices
What is the maximum number of symbols the API can support getting live prices at the same time? I am wondering if I need a different price feed solution soon.
Started by Frank Bernett @
Current Image
Image Name
Sat 8:39am