Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
gateway version dependent error 10089
Dear all,
I hope someone can direct me in the right direction to solve this error: Error 10089, reqId 8: Requested market data requires additional subscription for API. See link in 'Market Data Connections' dialog for more details.Delayed market data is available.SPY ARCA/TOP/ALL, contract: Stock(symbol='SPY', exchange='SMART', currency='USD') Contract = Stock('SPY','SMART','USD') ? Data = ib.reqMktData(Contract) |
Re: buy order at open if market open between a minimum and maximum
¿ªÔÆÌåÓýA minimum indicates a sufficiently strong follow on move (from previous day), a maximum prohibits excessively outsized moves. The trading system does significantly better with both a minimum and a maximum price limit when entering at the open.? Though of course, yes, one option is to take the hit, use only a maximum, and just work with a more reliable LOO order. ? I¡¯ve come up with three workarounds, which approximate the required order behaviour.? Each of them is fine, even with their inherent faults, for an EOD trading system (which shouldn¡¯t be so fragile as to require trade entry prices to be at exactly the open price); but they compromise/approximate in different ways, and the differences are just techncially interesting (how does IB really handle price/time conditions in these scenarios). ? The three options I see are: ?
?
? order = Order() order.action = "BUY" price_condition.isConjunctionConnection = False time_condition = Create(OrderCondition.Time) time_condition.isMore = True order.conditions.append(time_condition) # Conditions do not apply outside RTH, and any condition being met will cancel the order ?
? # [Indicative code, untested] order = Order() order.action = "BUY" order.tif = "GTD" order.goodTillDate = datetime.strftime(end_datetime, '%Y%m%d %H:%M:%S ')? # end_datetime = n seconds after the 9:30 order.totalQuantity = quantity price_condition = Create(OrderCondition.Price) order.conditions.append(price_condition) # Conditions do not apply outside RTH ? Unfortunately IB won¡¯t allow conditions to be added to LOO type orders ¨C otherwise that would be a great way to remove the timing aspect of it. ? ? The three options are all a bit rough, and each may be trying too hard! ?I am testing #2 at the moment. ??The system trades infrequently (once or twice a week), so it takes a while to build up a dataset. ? But are there better ways of doing it?? Would love to get others thoughts. ? ? Dave ? ? From: [email protected] <[email protected]> On Behalf Of Hilmar via groups.io
Sent: Friday, July 14, 2023 7:59 AM To: [email protected] Subject: Re: [TWS API] buy order at open if market open between a minimum and maximum ? Why care about a minimum? Your limit-on-open will fill if the current price is below the limit.It's effectively a market order with a maximum. |
Re: Intermittent IBGW connection problems 10.19.2a
That's impressive ´³¨¹°ù²µ±ð²Ô. That's good to know for tick by tick data, what about lvl 1 reqMktData? same stats? Would be interested to know your thoughts on orders and positions tracking please, as neither work reliably in my humble experience: - Positions can go wrong all of a sudden requiring a re-subscription or a full restart altogether, so I just end up proactively cancelling and re-subscribing at regular intervals, which I find dirty. - Order executions are difficult to track given they can be partially filled or the "Filled" status can not be triggered. So I essentially track the execution of the order using a "done" Event and a timeout (the order validity end time), and then check if order.filled has something in it, which I also find convoluted. Thanks. class Order_: def orderStatus(...): def execution(self, order: Order_, timeout: int): |
Re: Sent multiple bracket orders (open, takeprofit, stoploss, exit at time), but 1 of them only took (open and exit at time)
I hope your client properly captures and records error callbacks (there are three different I.callbacks) as well as the update callbacks you receive after placing orders. You need to go back to those logs and determine:
Without that kind of detail, a discussion would be based on guess work. Please provide error/order status detail or, in case you don't record them, improve your client to do so in the future. In TWS you could also go to Account -> Audit Trail and get a detailed view of you order and trade activity, but I am not sure whether orders that were rejected with an error code appear in the audit report. ´³¨¹°ù²µ±ð²Ô |
Sent multiple bracket orders (open, takeprofit, stoploss, exit at time), but 1 of them only took (open and exit at time)
I send multiple orders to ib gateway everyday, for the last week I have been using the following bracket order. Open -> long or short an equity Take profit -> price above long entry or below short entry stop loss -> price below long entry or above short entry exit before market close -> price at time. I sent this bracket order for 3-7 stocks everyday for the last week and it ran fine. Today, for one of the orders, the take profit and stop loss portion of it was missing. I have no idea why, I called the IB trade desk and they say that portion of the order is missing for this order. I'm sure that this order also had all 4 of the legs above. Any ideas on what could have gone wrong??? |
Meaning of Message 1102 (2104, 2106)
¿ªÔÆÌåÓýThanks to all for the valuable informations responding to my last
blog post. W.r.t. the connectivity topics I ask myself what the following
API log entry says: The entry is close to the end of the logfile because RTD transfer
ceases, then, and nothing more happened. The API Manual explains Msg 1102: I would think, if EUHMDS is *not* (re-)connected (and no further
EUREX RTD arrives) message 1102 is not appropriate, because not
*all* IB servers are reconnected and Yes, I see another question: Why is EUREX RTD delivered by EUHMDS
and not EUFARM? I have no answer, but it is rather evident from
the logfile, that it is so. Maybe I'm wrong and I appreciate to be enlightened.
|
Re: Intermittent IBGW connection problems 10.19.2a
If your server has enough memory, running multiple TWS/IBGW simultaneously works just fine. And sharing the same market data subscription between a TWS/IBGW real and paper account is no problem either. But you might want to take a quick look at this article: Real-time tick-by-tick data feeds and subscriptions are very reliable and completely unaffected by occasional historical market data farm disconnects. We have never experienced any gaps in tick-by-tick data feeds as long as our clients were behaving correctly. You can find several posts related to tick-by-tick data in the group archive, some of them even with performance details (such as this one). Your questions made me curios and I ran some additional stats on our 2023 tick-by-tick real-time data feeds:
So here the fun part. Year-to-date 2023 we received:
In my book that qualifies for rock-stable, considering the monthly data charge is negligible. If you do experience any tick-by-tick data interruptions, I'd suggest the following next steps: This is my interpretation of what Gordon called in a different post "Respect the basic API concepts":
´³¨¹°ù²µ±ð²Ô |
Re: ReqHistoricalData for Stock Giving API Version Error After Forced Upgrade to 10.19.2
I guess it is time to upgrade to TWS API version 10.19 (stable) or 10.22 (latest), Adam. Just like IBKR support suggests. The Decimal data type and fractional sizes (API level 163) were introduced two years ago with API versions 10.10.x and have become pretty fundamental for the most recent versions of TWS/IBGW. This was no a sudden change in TWS/IBGW 10.19.2 and you can find a good number of posts about this in our archive. You may be able to continue using your current client and API version until you finish the upgrade as long as you exclusively work with quantities in multiples of full shares, .But when TWS/IBGW needs to send you a non-integer size value (real-time or historical market data, order updates, commission and execution details), they will truncate the value and issue the warning. We ran some legacy V9.85 Java clients with V10 TWS/IBGW for a while until we switched entirely over to all V10 clients earlier in the year. Those legacy clients worked just fine but occasionally received these warnings (and value truncation) for real-time market data updates outside of regular trading hours. But that did not interfere with the operation of those clients. But your mileage will vary and you should start upgrading now. ´³¨¹°ù²µ±ð²Ô |
ReqHistoricalData for Stock Giving API Version Error After Forced Upgrade to 10.19.2
Has anyone else encountered this and found a solution??
Now when I call ReqHistoricalData on a stock it says "Your API version does not support fractional share size rules. Please upgrade to a minimum version 163. Trimmed value 372.68 to 372".? I've tried turning on forex compatibility mode but that doesn't help, probably because I'm requesting stock data.? Everything worked fine before the forced upgrade and unfortunately I'm using the old IbPy API implementation in python 2.7, so using IBKR's official python 3 API would require rewriting a lot of code and be a giant headache.? ?IBKR support is no help and simply tells me to upgrade. Any ideas? |
Updating ibapi on Mac
Hi, I've got a new Mac and was trying to install ibapi.?I'm running python 3.11.4, miniconda and spyder 5.3.4.
I downloaded the IB API 10.22 and run "python setup.py install" and got a message warning me not to run setup.py directly. (that worked fine before) i run "pip install ibapi", but an old version is installed.? What's the best way to upgrade the ibapi to the latest version? |
Re: Intermittent IBGW connection problems 10.19.2a
Thanks for all informations which I carefully collect.
Some further questions came up which I found no answer for: 1) Is it harmful to operate the Real account and Paper account simultaneously with RTD supply (on different or same assets) with 2 IBGW/TWS operating? 2) The IB support told me, that European exchange data (Market or History) are always delivered from Switzerland server, independent where my account is hosted at. ???? When I request EUREX realtime tick-by-tick data (and nothing else) the IBGW GUI tells me ??? ??? Market Data Farm????? ON:usfarm ??? ??? Historical Data Farm? ON:ushmds, ON:euhmds? or ON:ushmds, OFF:euhmds when disconnected ??? So it seems to me, that realtime tick-by-tick data is delivered by EUHMDS (I guess Switzerland) and not 'EUFARM' Then, according to Gordon's mail I have to keep (EU)HMDS alive, albeit I do not need historical data. 3) A good idea to test if the TWS API provides a more stable tick-by-tick data supply. The time-and-sales list would be fragmentary, otherwise. |
Re: Intermittent IBGW connection problems 10.19.2a
I maybe wrong,but from what I see and practice: |
Re: Intermittent IBGW connection problems 10.19.2a
¿ªÔÆÌåÓýWell, a trading algorithm based on realtime tick-by-tick data can
have a problem if the time series has gaps or even ceases. On 08.07.2023 21:33, Gordon Eldest via
groups.io wrote:
|
Re: Intermittent IBGW connection problems 10.19.2a
You saw this but did impact your code ? Otherwise said did you try to make a request anyway ? Also HDMS are for quering Data, this should not impact your trading capabilities |