Dividend Yield
5
Hey TWSAPI guys, I have seen a couple of messages about retrieving dividend information, adding tick types 256 and 456 in the stringlist and capturing field 56, sadly to no avail. Is that an issue with requesting data using SMART routing? Any hint to at least get the SPX dividend yield would be great for a start. Thanks
|
Re forecast trader
Hi everyone I got an email about forecast trader quote (Trade your view on economics — Predict outcomes of economic indicators with simple YES/NO trades. Start today at IBKR! ) Doesn't look like there is any info on the API docs. Has anyone trade this thing looks like a joke to be honest at first glance? Not sure I like the direction ibkr is going also it looks like only ibkrs exchange is offering it. Full contract list at forecastex.com
|
How do folks here front load their databases with TWS?
9
Hello All, I have a fairly straight forward program that scans the market and looks for custom TA indicators with the One Hour bar. However, front loading my database causes some real headaches. I download available symbols from the NASDAQ FTP site daily ~7,000 symbols, sort them and remove warrants, preferred shares, etc. and then req.Historical Data usually 6 months of 1 hour bars (~850 bars) to front load my database. IB's limitation of no more than 60 requests in any ten minute period is brutal. (~7,000 symbols / max 360 per hour = ~20 hours of front loading ) However, after trial and error, it does not appear that IB has a limitation on req.HistoricalData when the data is less than 5 trading days in the past. If I do a req.HistoricalData for 4 days of one hour data (28 bars), it only gives an error when I exceed the 50 messages per second limitation--my database fills 7,000 stocks with 4 days of data in about 3 minutes. I've seen other folks post here and can request a years worth of data in seconds in some cases. I'm wondering if any others have experience with this or if there's a workaround that others employ. Thanks to all in advance,
|
Any updated TWS API C++ library?
2
Hi all, I am building a trading model in C++. TWS API is not easy to use so I am looking for a helpful library that abstracts away many low level details and ease the development process. Google suggested me this library https://github.com/JanBoonen/TwsApiCpp which was used in this video https://youtu.be/ZxwdTgMY44g?si=cGRbH1MLUYw0X-Cp too. BUT the repo has not been updated in the last 8-9 years. Are there any actively updated C++ library repo for TWS API? Thank you in advance!
|
Time of order submission
4
When I ask TWS API for a list of the orders that I have placed recently, I get back a number of attributes of each order (PermId, Action, LmtPrice, etc.) https://interactivebrokers.github.io/tws-api/classIBApi_1_1Order.html However, the order placement time does not appear to be here, which seems odd. Am I correct in thinking that TWS API is not able to tell me the time at which I placed orders, and thus it is up to me to keep track of those times? Or am I missing something? It seems odd that time of order placement would not be among the order attributes that TWS API reports to me.
|
API/CTCI orders for canadian stocks are not allowed error message
5
Hello We are trying to use the IB Python API to place an order in a paper trade account. We can get historic market data OK in our program, so there is some connectivity to IB working. But we get an error saying "API/CTCI orders for canadian stocks are not allowed" does this mean that the IB API can not be used to place orders on the TSX ? Hopefully we have just done something dumb but I googled a bit and am now worried its not achievable. Does anyone have any wisdom on this please ? Or does anyone know of an alternative API/broker we could use instead of IB if they don't support this anymore. Thanks for any help people can give us. Dave
|
How many reqHistoricalData requests with keepUpToDate=true can be run in parallel
Gents, Is there a limit on how many historical data requests (reqHistoricalData call) with keepUpToDate=true can be run in parallel? Also, if for the same security I request historical data (with keepUpToDate=true) of various bar sizes, does each bar size count to the limit, or only one "slot" is used?
|
C++ preventing EReader reading when socket is closed
15
I have faced a problem with my code for a long time that only occurs during the call to EClientSocket::eDisconnect() I have a separate message processing thread running which looks like this: ftrMsgProcThrd_ = pool_->submit( [&]() { while (clientSocket_->isConnected()) { signal_.waitForSignal(); // This waits 2 seconds. reader_->processMsgs(); } }); I decided to tackle this annoying bug (not the first time) and have found that after the call to EClientSocket::eDisconnect() which calls EClientSocket::SocketClose() which just calls a Windows Sockets closesocket() on the open socket, I am still getting the message processing thread (EReader thread) trying to perform a Windows Sockets recv() messages on the closed socket resulting in a 509 error. I have traced that error to be socket error 10038 which confirms it is an invalid socket (in this case, a closed socket). Before the line "reader_->processMsgs()" I have tried checking for the socket still being open with if(clientSocket_->isConnected()) but it does not solve the problem. The EReader is running in its own thread as per the reader_->start() call. I thought, perhaps I need to close the EReader before calling eDisconnect so I tried deleting the object and removing the call to eDisconnect() because the destructor of the EReader calls eDisconnect() itself but this does not fix the error. i still get the 509 caused by a read on the closed socket. I am struggling here and would appreciate advise from any C++ coders that use a multi-threaded approach like the above. It is likely a threading issue but if anyone else has faced a similar "disconnect" issue I would be happy to hear what you did to resolve it.
|
Error Code -> 366 w/ reqHistoricalData() in ib_insync for realtime stream
Hi, Anyone else seeing this error start popping up today? Only started since about 3 P.M. The contract is valid and has been working since this morning. This is through ib_insync and is using callbacks with self.ib.run() following the call below catching event updates. Here is the following error: reqHistoricalData: Timeout for Future(conId=563947733, symbol='NQ', lastTradeDateOrContractMonth='20241220', multiplier='20', exchange='CME', currency='USD', localSymbol='NQZ4', tradingClass='NQ') Error 366, reqId 5: No historical data query found for ticker id:5, contract: Future(conId=563947733, symbol='NQ', lastTradeDateOrContractMonth='20241220', multiplier='20', exchange='CME', currency='USD', localSymbol='NQZ4', tradingClass='NQ') Call: bars = self.ib.reqHistoricalData( self.contract, endDateTime='', durationStr='1 D', barSizeSetting='5 mins', whatToShow='Trades', useRTH=False, formatDate=1, keepUpToDate=True ) #event handler for updates to realtime historical OHLC data... bars.updateEvent += self.OnBarUpdate
|
Submitting many orders simultaneously
7
Hi. I am new here, so I apologize if this question has been covered already. Until recently I was trading on IBKR using the Client Portal API. Each day I would simultaneously place about 100 limit orders for various U.S. stocks, and I did this using the /orders REST endpoint. If one uses an array of orders as the payload of the post request, the orders are all submitted simultaneously. Sadly, on Sept 4 IBKR stopped allowed one to submit multiple orders this way. Only single orders are allowed now. But if I try to submit ~100 orders sequentially, it will take too long. I need to submit them all within a few seconds of each other. So, I am considering using the TWS API for this. My questions are: Is it possible to simultaneously place ~100 limit orders using TWS API (with ib-async)? If yes, how? In case people here are familiar with the Client Portal API, does anyone know an alternative way to submit simultaneous orders with the Client Portal API? (I submitted this question to IBKR, but there is no reply.) Thanks very much for any guidance that anyone can give me.
|
new IBKR desktop APP
6
As you guys probably know by now, there is a new desktop APP. I was wondering if anyone here knew what the long term plan is? Would it be to stop TWS completely and have everyone move to the new desktop app? I hope they will continue to support trading via a API. Its probably going to be a lot of work for us to learn and debug the API once thats available. I was wondering what thoughts you guys have about this pending change
|
API data not the same as TWS data?
2
Hi there. I'm retrieving data from stocks using a Python script and the methods tickPrice, tickSize and updateMktDepthL2 It looks like it is working, but checking the data I get from the API is not similar at all to the data shown in TWS (or other apps). I'm wondering if I'm doing things right. I have been reading about this on the internet and it happens to be a common subject. I know I should count with some deviation, the bars I could build with fetched data are not going to be exactly the same as the TWS bars, but the samples I have checked are far away from being close. I'm trying to build a system that takes data from the order book and trades (prices) to make a study, but with the provided accuracy is impossible. I don't need a 100% accuracy, let's say a 98% will be fine. By the way, I haven't found any documentation about the retrieved data, is there someone who can give me a link or confirm my understanding is right: 05/09/2024 15:29:59.427 HBAN tickPrice reqId: 3 tickType: BID price: 14.85 attrib: CanAutoExecute: 1 PastLimit: 0 PreOpen: 0 05/09/2024 15:29:59.427 HBAN tickSize reqId: 3 tickType: BID_SIZE size: 2300 The first line means an order has been filled in the BID side at 14.85 The second line means the order had a size of 2300 So the last crossed price will be 14.85 The same is true for ASK side orders. 05/09/2024 15:30:00.275 HBAN tickPrice reqId: 3 tickType: LAST price: 14.85 attrib: CanAutoExecute: 0 PastLimit: 0 PreOpen: 0 05/09/2024 15:30:00.276 HBAN tickSize reqId: 3 tickType: LAST_SIZE size: 2300 This is much more tricky, it could be: 1) a confirmation of the previous trade, so they are always redundant, 2) Market orders crossed with other market orders Could anyone confirm? Thank you,
|
What is manualOrderCancelTime param of Eclient::cancelOrder( int id, String manualOrderCancelTime)
24
The latest TWS API for Java added a new required parameter to the existing method EClient::cancelOrder. It now takes a string for manualOrderCancelTime which can be left null. What does this parameter do? Cancel an order if not already filled at a specific time in the future? It's not documented:
|
Expired contract & TimeZoneId
2
I found that when I request ContractDetails for an expired future contract, the contractDetails object I receive has TimeZoneId propertiy set to Null. But if I want to download HistoricalData for that contract I need to know its TimeZoneId to correctly send the request. So how can I to solve the problem?
|
Rolling futures to the next expiry
2
Hi all, I was trying to roll my future to the next expiry (RTY Sep, CME -> RTY Dec, CME) with a negative current position (RTY Sep, CME: -1) on TWS GUI, i.e. from RTY Sep, CME: -1 RTY Dec, CME: 0 to RTY Sep, CME: 0 RTY Dec, CME: -1 I'm also connecting to TWS through TWS API. However, when the callback function "openOrder" is called, i get the wrong action (BUY/SELL) for the respective orders. Details: 637533627: RTY Sep, CME 654503362: RTY Dec, CME contract.comboLegsDescrip: 637533627|-1|CME,654503362|1|CME Leg. conId: 637533627 action: SELL Leg. conId: 654503362 action: BUY To my best knowledge, isn't it supposed to be contract.comboLegsDescrip: 637533627|1|CME,654503362|-1|CME Leg. conId: 637533627 action: BUY Leg. conId: 654503362 action: SELL However, in the end, i'm able to get the correct execution details: 637533627: BOT 654503362: SLD So I was wondering if I misunderstood the definition, or could this be a bug from TWS?
|
Using Excel
I appreciate this may have been answered (please point me to the thread - or a vba code example). I have the TWS_ActiveX.xls working But I am unable to automate pulling down Account, Portfolio and Open order data using one button - I have to go to each tab and request data. I am sure its a scoping/hierarchy within the code but I have been unable to make it work . Any pointers - just want to press one button (preferably not on either of the account portfolio or open order tabs) and all data is refreshed Many thanks P
|
C++ TWS API reqMktDepth() giving 309 error
6
Hi, I have had the same setup for streaming the level 2 market depth for a long time now. Yesterday, I started receiving this error "[20240905-12:58:19] Error [Id, Code, Msg]: 1001 : 309 -> Max number (3) of market depth requests has been reached". My code makes the stream request right before entering my main trading logic loop, and it only makes it once, so I am confused as to why this is happening now. The contract I am trying to stream is a future w/ these details: TICKER -> "NQ" EXP_MONTH -> "202412" LOCAL_SYMBOL -> "NQZ4" EXCHANGE = "CME" CURRENCY = "USD" Any help would be appreciated, especially if a change has been made to the API without my knowledge. Here is the line where I am making the request, m_sPtrIbc is a smart pointer that represents the client I built out. ReqMarketDepth() is simply a one liner -> m_pClient->reqMktDepth()... //launch streaming of orderbook depth... m_reqMktDepthId += 1; m_sPtrIbc->ReqMarketDepth(m_reqMktDepthId, m_contract, 5, false, TagValueListSPtr());
|
API server failed to start
2
Can anyone help me please.. My paper trading account's API server fails to start. Every time i log into TWS, it says the API server failed to start since the specified port 7497 is already in use by another application. I don't have another TWS application running but it keeps on saying socket port in use. Tried reinstalling the TWS, changed the versions, even tried changing the socket port number but nothing is working.
|
TWS 10.30.1.e bug
8
Heads up. New TWS 10.30.1.e from July 1, appears to have a problem. If you just receive data / history for the market.. its OK. If you place an order, then the return order status, the message text, is prefixed with an extra byte. This makes the header 5 bytes long, and then disaster follows trying to decode it. All message sent from here on, have a 5 byte header. (msg header is supposed to be 4 bytes). Even closing your app and restating it, the TWS API keeps the 5 byte header bug. Only a TWS restart will clear the bug, until the next order. Enjoy
|
how to buy call option at the certain delta?
Hello, I try to write a program to buy SPY 0DTE call option at 70 delta during the day. It seems complicated to me. I am thinking: 1. get all the strike prices. 2. use reqMktData() for those 20 strike call contracts below the stock market price. 3. scan to find the contract whose delta is closest to 0.7. 4. send the order to buy. Is there a better way? Thanks.
|
81 - 100 з 12923