Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Question on Match symbol function
Hello to all.
Guys I am writing this my first message to ask for information. With the new version of TWS released today. I noticed that the Match Symbol button (function? reqMatchingSymbols) to be able to search for a symbolo / stock no longer works. I attach image of the test app (vers. 9.72) connected with TWS stable?where the function is ok and with the results. and image of the test app 9.80 with TWS 9.812 released today where it finds no results. Thanks |
Re: Cancel Triggered Stop Orders
Alex Rozenbaum
I wonder if you are sending cancel requests for all three orders. I believe if they are in one OCA group you can cancel one of them. On Tue, Nov 10, 2020 at 5:07 PM Mohammad Shahraeeni via <shahraeeni=[email protected]> wrote: I have a group of three orders (two Stop limit and one limit order). In some cases, when I send a signal to cancel all three orders, one of the stop limit orders is not canceled and I get this error message: |
Cancel Triggered Stop Orders
I have a group of three orders (two Stop limit and one limit order). In some cases, when I send a signal to cancel all three orders, one of the stop limit orders is not canceled and I get this error message:
'Error 201, reqId #######: Order rejected - reason:Stop price revision is disallowed after order has triggered' Is it normal? If yes, is there a standard way to handle these cases? In the Trade Workstation, I can cancel any order (triggered or not) with no problem. Why can't I do it in my code?? Thanks? |
Re: Latency of reqTickByTickData
Nick
¿ªÔÆÌåÓýIt's a rather complicated eeries of events from the time a tick arrives at IB to the time it arrives in your program. You don't have control of anything on IB's end. You have some control of how your app handles the socket on your
end but it's not likely to achieve each tick in its own packet.
Not to mention that performance could actually go down when
attempting to achieve 1 tick per packet. On 11/10/2020 5:01 AM, Smoothie Kate
via groups.io wrote:
Can IB deliver ticks individually instead of bundling multiple into a single "packet"/"package"? Like once a tick is realized, send it to a user subscribed to the tickbytick stream. |
Error 202 for request 3179: Order Canceled - reason:
Hi Guys,?
I have an algo written in IB API PYTHON, and I place limit orders with a expiry time at candle close. The algo itself is following the rules perfectly. However, when the order is not filled and gets expired/cancelled at candle close then sometimes I get the following error (as shown in the tiltle): "Error 202 for request 3179: Order Canceled - reason:"? The error doesn't occur all the time, however when it occurs the algo simply hangs at the error without moving forward. My question is how can I make the algo to continue with the "main" function. In other words, when the error 202 occurs how can I handle it? Thanks. |
Re: Need reconnect strategy (getting a little desparate)
Perhaps? ? is worth reading.
This ruby code handles the reconnection feature ``` # Handy method to ensure that a connection is established and active. # # The connection is resetted on the IB-side at least once a day. Then the # IB-Ruby-Connection has to be reestablished, too. # # check_connection reconnects if necessary and returns false if the connection is lost. # # It delays the process by 6 ms (150 MBit Cable connection) # #? a =? Time.now; G.check_connection; b= Time.now ;b-a #?? => 0.00066005 # ?? ?def check_connection ?? ???? ??? ??? answer = nil; count=0 ?? ???? ??? ??? z= tws.subscribe( :CurrentTime ) { answer = true } ?? ???? ??? ??? while (answer.nil?) ?? ???? ??? ??? ??? begin ?? ???? ??? ??? ??? ??? tws.send_message(:RequestCurrentTime)??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? # 10 ms? ## ?? ???? ??? ??? ??? ??? i=0; loop{ break if answer || i > 40; i+=1; sleep 0.0001} ?? ???? ??? ??? ??? rescue IOError, Errno::ECONNREFUSED?? # connection lost ?? ???? ??? ??? ??? ??? count = 6 ?? ???? ??? ??? ??? rescue IB::Error # not connected ?? ???? ??? ??? ??? ??? reconnect ?? ???? ??? ??? ??? ??? count +=1 ?? ???? ??? ??? ??? ??? sleep 1 ?? ???? ??? ??? ??? ??? retry if count <= 5 ?? ???? ??? ??? ??? end ?? ???? ??? ??? ??? count +=1 ?? ???? ??? ??? ??? break if count > 5 ?? ???? ??? ??? end ?? ???? ??? ??? tws.unsubscribe z ?? ???? ??? count < 5? && answer #? return value ?? ?end ``` You might translate this to your favorite language. |
GetMarketData: Meaning of SnapshotPermissions
If :RequestMarketData is fired with the :Snapshot-Flag? set (regultarory snapshot: false), I expect a set of market prices in return.
If I understood correctly, setting the :MarkettDataType to 'frozen' or 'frozen_delayed' data are even returned, if the exchange is closed. This works perfectly with us stocks on a demo account. However, A MarketDataRequest of a Bag with 3 Contracts triggered a :TickRequestParameter response, informing of a lack of SnapshotPermissions. No TickData were returned. Surprisingly,? requesting Snapshot-MarketData for? a ZN-Future, TickData were returned. The request triggert a similar :TickRequestParameter response ( SnapshotPermissions: 0) Same result requesting Snapshot-Marktedata for european stocks and stocks trading at the SGX. Now I am confused. How to interpret the TickRequestParameter response? Thanks Hartmut |
What transaction types are included in the options native daily volume? (see link for all transactions types from IB)
I am trying to filter daily ticks for options so that when I add the size I get exactly the native volume displayed in TWS.?
|
Re: request margin without whatif
As you can see on the CME website there is a 50% credit on ZC-ZW spread,https://www.cmegroup.com/clearing/margins/inters.html#exchange=CBT§or=AGRICULTURE&pageNumber=1
IB takes this into account when computing margin impact, so that opening a naked ZC position, or opening a ZC position in an account with a ZW opposite position already opened gives different after-before margins, even if the order is the same. It has nothing to do with absolute value of anything. I am totally sure about this, you can check yourself , using the API or the check margin impact option in TWS. What-if results depends on the already opened positions as I said, so the only way to get the naked margin, is to use whatif on an empty account, using the paper account for example, but there should a simpler way, since this information is available in TWS. |
Re: "BEST queries are not supported for this contract¡± when requesting historical trade bars
I was getting that error a lot and also came up empty searching for what it meant. I did eventually realize that it was happening when I was requesting historical data from before the IPO date of a stock. When I changed from blindly requesting the last 30 days to doing a reqHeadTimestamp and asking from max(Head, 30 days ago), most of my BEST queries not supported errors went away. I realize that doesn't solve your issue, but may give a clue, or help others.
|
Re: Need reconnect strategy (getting a little desparate)
Hi,Gregory Smith,
toggle quoted message
Show quoted text
Sounds great.Can you explain more about how to do it? I am confused about this in python,Many thanks. On Thu, Apr 20, 2006 at 12:04 PM, Gregory Smith <gregs_net@...> wrote: I start the TWS and my "API" handler in separate threads but from the same parent. If the API handler detects a disconnect, or if it fails to receive updates on particular exchanges (i.e. futures, equities or fx) or if there are other internal failures (db or trading strategy) then I set an error status and the parent thread shutsdown and restarts the processes (TWS, API...). ? -- ------ Forex trader David Liao |
"BEST queries are not supported for this contract¡± when requesting historical trade bars
I¡¯ve only encountered this particular error with a single stock contract (AAL@NASDAQ) out of several hundred so far, when trying to do EClient.reqHeadTimestamp()?to get the earliest available historical trade bars for this contract, and am wondering what it means.?
The full error message below: Error 162, reqId X: Historical Market Data Service error message: BEST queries are not supported for this contract, contract: Contract(secType='STK', conId=139673266, symbol='AAL', exchange='SMART', primaryExchange='NASDAQ', currency='USD', localSymbol='AAL', tradingClass='NMS')
|
Re: How to add a data delay control function in the main() of IB API
Hi,btw,
It works perfect now.as below: t = threading.Thread(target = app.ifDataDelay)
t.start()
app.run()
I canceled the redundancy' () ' of the previous first line:t=threading.Thread(target=app.ifDataDelay()) to?t=threading.Thread(target=app.ifDataDelay) use t, start() and no t.join() Thanks for your guidance. -- ------ Forex trader David Liao |