Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
tickeByTickData or Depth Level 2 does not work when using ISIN instead of conID or symbol
Hi,
?
Trying to subscribe to market data using following format (from samples) and including these fields but get error. Which fields are needed for stock and forex when using ISIN? Logically, currency shouldn't even be needed but sample has it so I included it.
?
Code: 321, Msg: Error validating request.-'b0' : cause - The symbol or the local-symbol or the security id must be entered
?
---------------------------------------------------------------------------
---------------------------------------------------------------------------
-Bruce |
Re: SLOW connection times
Thanks--we've checked our network pretty thoroughly, although we'll continue to check anything else we can think of, like making sure there's no excess traffic we've forgotten to take into account.?
To further stump me, today about half of my scripts connected in less than a second--less than .1 in some cases--and the other half took >30 seconds.? improvement, but still mystifying!? My best guess is still that _something_ happened on the IB side, but if no one else is having similar problems... |
Re: OptContract Lookup
Thank you, I was feeling a bit ... - receiving just the xml dump:)
then I tried edge, same like chrome - well edge is chrome code? these days. I didnt know there is still the internet explorer on my actual win 10. and it works like a charm - cool feature to install an app like this. it is just sad microsoft tends to be so inconsistent in the long run. now I have a great tool. many thanks Alex |
Re: Can't modify bracket order - ONLY stop loss quantity won't update
Thanks for your reply.
I actually am trying to change the quantity of all orders of the bracket order, including the parent, as in the example code I posted. If i set transmit to True on the parent order, the updates of the take profit and stop loss are then successful. The problem is that in that case, if the new buy limit order gets filled immediately, the take profit order of the original version can get filled before it gets edited. I tested it myself and it is happening. How can one modify a bracket order then, including the quantity of shares? Seems like a basic endeavour, especially when the quantity is the same between orders of the bracket order |
Re: OptContract Lookup
¿ªÔÆÌåÓýThe page I linked to contains an install link: 'To install Contract Inspector¡'. For your convenience, here's the link again: ? ? I should have stated that this is Windows only. It's a 'ClickOnce' app, which means once it's installed it will automatically fetch updates. (I'm not actively updating it at present, though there are many improvements I have in mind when I have the time.) ? Also please note that depending on your version of Windows (and perhaps some other factors that I'm not fully aware of), you may find that this link simply downloads a large lump of XML if you use Edge, Firefox, Chrome etc. ? If that's the case, then use Internet Explorer instead ¨C just enter 'Internet Explorer' via the search facility on the taskbar and click the link, then navigate to the above link. ? Richard ? ? From: [email protected] <[email protected]> On Behalf Of pressl.alex@...
Sent: 03 March 2021 10:52 To: [email protected] Subject: Re: [TWS API] OptContract Lookup ? Hello Richard, |
Re: OptContract Lookup
¿ªÔÆÌåÓýThere is no strike 119 for that expiry. 115 or 120 are the nearest strikes. ? It took me about a minute to find this out using my Contract Inspector program, which you can get from Github at: ? ? See attached screenshot. ? Richard ? ? From: [email protected] <[email protected]> On Behalf Of Crow
Sent: 03 March 2021 05:53 To: [email protected] Subject: [TWS API] OptContract Lookup ? I am trying to lookup contract details (socket.reqContractDetails()) of the following option contract (com.ib.client.Contract.OptContract): ? conid 0 symbol XLY secType OPT lastTradeDateOrContractMonth 20210416 strike 119.0 right C exchange SMART currency USD ? I get error code 200:?No security definition has been found for the request ? Anyone know what is wrong with my request? ? ? |
Re: OptContract Lookup
¿ªÔÆÌåÓý
Strike 119.0 does not exist, try a multiple of 5. You do not need you specify the exchange.
|
Re: SLOW connection times
Then you have your troubleshoot mapped already. It's not your program. 1- Change TWS version on remote side (less likely to be the issue) 2- Check your network (connect directly to modem and disconnect ALL other wired and wireless devices. 3- Check remote side network and servers (like step 2) 4- Check IP Transit (ping, traceroute, etc / most likely not your problem) On Tue, Mar 2, 2021, 9:11 PM ExStock <exstock@...> wrote: Already done, and it connects no problem to that, although it's a more updated version--978, whereas I think the server's version is 976. |
OptContract Lookup
¿ªÔÆÌåÓý
I am trying to lookup contract details (socket.reqContractDetails()) of the following option contract (com.ib.client.Contract.OptContract):
conid 0
symbol XLY
secType OPT
lastTradeDateOrContractMonth 20210416
strike 119.0
right C
exchange SMART
currency USD
I get error code 200:?No security definition has been found for the request
Anyone know what is wrong with my request?
|
reqTickers on paper account - bid/ask stay still for long times
When I request current ticker with reqTickers in succession, bid/ask stay unchanged for long time like minutes order of magnitude while ¡°last¡± is updated consistently every time. This is on paper account. I use reqMarketDataType(3).
Anyone saw this anomaly? I observed with both Stock and Forex contracts and both outside and within RTH. Yesterday and today, for example. Is my understanding of the delayed data wrong or I shouldn¡¯t expect consistent data in paper trading? Thanks in advance, Alex |
Re: SLOW connection times
Download TWS on same PC as you have your program and connect locally to 127.0.0.1 to rule out any network and IP Transit issues. - Bruce On Tue, Mar 2, 2021, 4:55 PM ExStock <exstock@...> wrote: I always connect to IB through the TWS python API. We run TWS itself on a server; the python code runs locally on my PC.? Until recently, establishing a connection to IB this way took <2 seconds, and was usually almost instantaneous.? For the past couple of weeks, though, the time required to establish a connection has ranged between ~30 seconds and a whopping ~4 minutes.? The TWS running on the server has also started using about twice as many resources as it used to.? |
Re: avgFillPrice returning zero
¿ªÔÆÌåÓýIf you're using ib_insync, you should ask this question at /g/insync ? This group is for the APIs provided by IBKR only. ? Thanks ? Richard King TWSAPI Group Owner and Moderator ? ? ? From: [email protected] <[email protected]> On Behalf Of sunyc45@...
Sent: 02 March 2021 21:39 To: [email protected] Subject: Re: [TWS API] avgFillPrice returning zero ? Some more details: I'm using ib_insync to get a list of all trades from the current session, then getting the data for each trade. Not tracking orderID or anything since I'm relatively new and haven't gotten that to work for me yet. It seems like all the other trade data pulls up fine, so I'm not sure why avgFillPrice doesn't. Relevant code:
|
Can't modify bracket order - ONLY stop loss quantity won't update
Hello,
When I try to modify a placed bracket order by resubmitting it with different parameters, all of my changes go through (as verified in TWS), EXCEPT for the "quantity" for the stop loss order, which remains unchanged. At first I passed the new share amount to totalQuantity of the parent order only, but since it didn't work, I tried as well passing it to all of them. # placing original bracket order shares = 26 limit_price_buy = 25 limit_price_take_profit = 28 aux_price = 20 order = ib.bracketOrder('BUY', shares, limit_price_buy, limit_price_take_profit, aux_price, outsideRth=True, tif='GTC', usePriceMgmtAlgo=True) contract = Stock('CCIV', 'SMART', 'USD') order_results = [] for o in order: order_results.append(ib.placeOrder(contract, o)) # modifying and placing previous bracket order contract = Stock('CCIV', 'SMART', 'USD') order.parent.update(totalQuantity=20, lmtPrice=25, transmit = False) order.takeProfit.update(totalQuantity=20, lmtPrice=27, transmit = False) order.stopLoss.update(totalQuantity=20, auxPrice=19, transmit = True) order_results = [] for o in order: order_results.append(ib.placeOrder(contract, o)) Any ideas on what could be happening? |
SLOW connection times
I always connect to IB through the TWS python API. We run TWS itself on a server; the python code runs locally on my PC.? Until recently, establishing a connection to IB this way took <2 seconds, and was usually almost instantaneous.? For the past couple of weeks, though, the time required to establish a connection has ranged between ~30 seconds and a whopping ~4 minutes.? The TWS running on the server has also started using about twice as many resources as it used to.?
Nothing has changed on our end, apart from the recent dramatic cold snap, which hit extra hard here in TX.?We've checked and rechecked our system and code, and found nothing. We've also scaled back the amount of data we're requesting from IB, with no improvement resulting.? (I already had several measures in place to make sure I wasn't hitting IB with too many requests at a time.) Is anyone else suffering slow connection times?? Is my crazy idea that some parts of IB's infrastructure (or key employees) were affected by the cold snap as crazy as it sounds to me?? Or is it something simple like needing to update my TWS?? (I can't easily check my version right now, but it's ~6 months old.? We like finding a nice stable version and sticking with it for a while, which is why we haven't tried that yet as part of our troubleshooting.) |