Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: Gateway disconnects multiple times daily at around 2pm, sometimes failing to reconnect
Interesting.
Yesterday (Tuesday 2pm Sydney time) the problem arose for me again. Gateway fails to reconnect to the IB Server when the IB Server restarts, forcing me to log in to Gateway again. My problem goes back a long way, is very intermittent, and I have an active ticket with IB on the matter. Today, Gateway reconnected, but just looking at my logs now, I see similar messages to yours at time 14:05:23.663. Anyway, I didn't have to log in again today, the reconnection and login was automatic. KH |
||||
Re: Gateway disconnects multiple times daily at around 2pm, sometimes failing to reconnect
Looks like during the first section of the log your IB Gateway is connected to the and the disconnects you describe take place right within the , which is 23:45 - 00:45 in US/Eastern or 13:45 - 14:45 in Australia/Sydney. You should expect various spurious disruptions during that window including brief complete disconnects (errors 1100 and 1102. We have seen (and expected) similar warnings and errors during last night's US maintenance window and I have attached a quick log, in case that helps. Code 2105 events are actually only warnings and should not cause permanent disconnects or authentication failures, though your clients should be prepared to handle them. 闯ü谤驳别苍 |
||||
Gateway disconnects multiple times daily at around 2pm, sometimes failing to reconnect
Hi all
Hoping for some guidance on this issue that has been plaguing me for months. Thanks in advance! As topic name, almost every trading day, the gateway will disconnect from the IBKR servers 3-4 times around 2:05pm every day. Since this first started occurring I have moved houses and put my software on AWS to no avail. For example today, whilst running on AWS Sydney, while it was able to reconnect each time, it disconnected 3 times and gave me error 2105 at (AEST/UTC+10): 14:03:33 14:04:17 14:05:23 and the respective logs: 2022-06-29 14:03:31.314 [BB] INFO? [JTS-EServerSocketNotifier-104] - [1:157:157:1:0:90:-1:INFO] Historical data update sent [requestId: 3]. 2022-06-29 14:03:33.122 [BB] INFO? [JTS-ushmdsListenerS7-109] - Socket for connection ndc1.ibllc.com:4000 was closed by peer. 2022-06-29 14:03:33.125 [BB] INFO? [JTS-ushmdsListenerS7-109] - Disconnecting ndc1.ibllc.com:4000 [disconnectDetails=DisconnectDetails[sessionID=7,endPoint=ndc1.ibllc.com:4000,reason=DISCONNECT_ON_BROKEN_SOCKET,cause=null,systemMessage=null,keepSocketOpen=false]]... 2022-06-29 14:03:33.125 [BB] INFO? [JTS-ushmdsListenerS7-109] - Socket closed. 2022-06-29 14:03:33.125 [BB] INFO? [JTS-ushmdsListenerS7-109] - Interrupting dispatcher [sessionID=7]... 2022-06-29 14:03:33.126 [BB] INFO? [JTS-ushmdsDispatcherS7-110S7-111] - Dispatcher thread terminating [sessionID=7,interrupted=true]... 2022-06-29 14:03:33.130 [BB] INFO? [JTS-ushmdsListenerS7-109] - Interrupting listener [sessionID=7,disconnectSocket=true]... 2022-06-29 14:03:33.130 [BB] INFO? [JTS-ushmdsListenerS7-109] - AuthTimeoutMonitor-ushmds: deactivate 2022-06-29 14:03:33.130 [BB] INFO? [JTS-ushmdsListenerS7-109] - Listener thread terminating [sessionID=7] [seen=62643,totalShifted=62643,moreAvailable=0] 2022-06-29 14:03:33.131 [BB] INFO? [JTS-DisconnectedS7-147] - Farm ushmds/NATIVE: Lost active connection with disconnect status DISCONNECT_ON_BROKEN_SOCKET 2022-06-29 14:03:33.132 [BB] INFO? [JTS-DisconnectedS7-147] - Farm ushmds/NATIVE: Resetting 2022-06-29 14:03:33.132 [BB] INFO? [JTS-DisconnectedS7-147] - CONN CALC: Last connection attempt time is cleared! 2022-06-29 14:03:33.132 [BB] INFO? [JTS-DisconnectedS7-147] - CONN CALC: Last connection set as now:14:03:33:132 2022-06-29 14:03:33.132 [BB] INFO? [JTS-DisconnectedS7-147] - HTBP Disconnected from live peer!::0 2022-06-29 14:03:33.132 [BB] INFO? [JTS-DisconnectedS7-147] - CONN CALC: Last disconnect time set as now:14:03:33:132 2022-06-29 14:03:33.132 [BB] INFO? [JTS-ushmdsServicePingS7-114] - Terminating ping thread 2022-06-29 14:03:33.137 [BB] INFO? [JTS-DisconnectedS7-147] - Starting fuse [name=ushmds-nativepause,timeout=0]... 2022-06-29 14:03:33.141 [BB] INFO? [JTS-Fuse-ushmds-nativepause-148] - Farm ushmds/DISCONNECTED: Connecting natively (ushmds)... 2022-06-29 14:03:33.143 [BB] INFO? [JTS-Fuse-ushmds-nativepause-148] - Reconnection time cleared: argClearBackoff=false base=0 range=5000 next=0 disconnected=0 2022-06-29 14:03:33.148 [BB] INFO? [JTS-AsyncNonLocked-44] - Keep-alive scheduled for:ushmds 2022-06-29 14:03:33.149 [BB] INFO? [JTS-AsyncNonLocked-44] - [1:157:157:1:0:4:2:DET] Sending error. 2022-06-29 14:03:33.149 [BB] INFO? [JTS-AsyncNonLocked-44] - [1:157:157:1:0:4:2:DET] [4;2;-1;2105;HMDS data farm connection is broken:ushmds] 2022-06-29 14:03:33.149 [BB] INFO? [JTS-AsyncNonLocked-44] - [1:157:157:1:0:4:2:DET] Error sent. 2022-06-29 14:03:33.149 [BB] INFO? [JTS-AsyncNonLocked-44] - cdebug: ROUTING | connTracker:ushmds@5cd4e9d | Disconnected | 1656475412135 | true 2022-06-29 14:03:33.146 [BB] INFO? [JTS-Fuse-ushmds-nativepause-148] - AsyncDisconnectNotifiers: 1 2022-06-29 14:03:33.157 [BB] INFO? [JTS-Fuse-ushmds-nativepause-148] - Connecting ndc1.ibllc.com:4000 timeout=0... 2022-06-29 14:03:33.159 [BB] INFO? [JTS-Fuse-ushmds-nativepause-148] - CONN CALC: Last connection set as now:14:03:33:159 -------------------------------------------------------------------------------------------------------------------- 2022-06-29 14:04:16.273 [BB] INFO? [JTS-EServerSocketNotifier-104] - [1:157:157:1:0:90:-1:INFO] Historical data update sent [requestId: 3]. 2022-06-29 14:04:16.518 [BB] INFO? [JTS-CCPDispatcherS3-49] - Setting time offset to -517 diff -252 2022-06-29 14:04:16.518 [BB] INFO? [JTS-CCPDispatcherS3-49] - CCP reported time: 2022-06-29 04:04:16.000 (GMT) [1656475456000], local time: 2022-06-29 04:04:16.518 (GMT), local time: 2022-06-29 14:04:16.518 (AEST), difference in seconds: -0.518, handling delta:1 [Msg1] 2022-06-29 14:04:16.537 [BB] INFO? [JTS-ushmdsNativeUpgrade-162] - Farm ushmds/CCP: Trying native connection, attempt 2022-06-29 14:04:16.539 [BB] INFO? [JTS-ushmdsNativeUpgrade-162] - Trying connecting ndc1.ibllc.com:4000 timeout=0... 2022-06-29 14:04:16.943 [BB] INFO? [JTS-ushmdsNativeUpgrade-162] - Farm ushmds/CCP: Trying native connection 2022-06-29 14:04:16.943 [BB] INFO? [JTS-ushmdsNativeUpgrade-162] - AsyncDisconnectNotifiers: 1 2022-06-29 14:04:16.943 [BB] INFO? [JTS-ushmdsNativeUpgrade-162] - Connecting ndc1.ibllc.com:4000 timeout=0... 2022-06-29 14:04:17.158 [BB] INFO? [JTS-ushmdsNativeUpgrade-162] - Connected to ndc1.ibllc.com:4000 on local port 0 socket local addrs:port /172.31.39.211:55610 2022-06-29 14:04:17.158 [BB] INFO? [JTS-ushmdsNativeUpgrade-162] - Farm ushmds/CCP: Connected, sending secure connect and/or auth 2022-06-29 14:04:17.159 [BB] INFO? [JTS-ushmdsNativeUpgrade-162] - InnerConnection.onConnected() [sessionID=14,secureConnectEnabled=true,logonReplySigned=true]. 2022-06-29 14:04:17.222 [BB] INFO? [JTS-ushmdsNativeUpgrade-162] - Not exhausted because ndc1.ibllc.com was connected 2022-06-29 14:04:17.222 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - Starting dispatcher thread [sessionID=14]... 2022-06-29 14:04:17.222 [BB] INFO? [JTS-ushmdsListenerS14-163] - Starting listener thread [sessionID=14]... 2022-06-29 14:04:17.223 [BB] INFO? [JTS-ushmdsListenerS14-163] - Initial listener buffer size is 131072. 2022-06-29 14:04:17.223 [BB] INFO? [JTS-ushmdsListenerS14-163] - Capping listener buffer size at 65536. 2022-06-29 14:04:17.449 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - cert #0 subject:CN=tws.ibllc.com,OU=tws.ibllc.com,O=IBLLC,C=US??? issuer:CN=prod.ckg.ibllc.com,O=Interactive Brokers LLC,L=Greenwich,ST=Connecticut,C=US??? notBefore:20220628-13:36:17 Europe/London (1656419777000)??? notAfter:20220630-21:36:17 Europe/London (1656621377000) 2022-06-29 14:04:17.449 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - cert #1 subject:CN=prod.ckg.ibllc.com,O=Interactive Brokers LLC,L=Greenwich,ST=Connecticut,C=US??? issuer:CN=DigiCert SHA2 High Assurance Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US??? notBefore:20200812-01:00:00 Europe/London (1597190400000)??? notAfter:20220817-13:00:00 Europe/London (1660737600000) 2022-06-29 14:04:17.450 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - cert #2 subject:CN=DigiCert SHA2 High Assurance Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US??? issuer:CN=DigiCert High Assurance EV Root CA,OU=www.digicert.com,O=DigiCert Inc,C=US??? notBefore:20131022-13:00:00 Europe/London (1382443200000)??? notAfter:20281022-13:00:00 Europe/London (1855828800000) 2022-06-29 14:04:17.455 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - Current time is: 20220629-05:04:17 Europe/London 2022-06-29 14:04:17.459 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - CipherContext initialization successed. 2022-06-29 14:04:17.459 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - Cipher context created: CipherContext[id=19,encrypt=true]. 2022-06-29 14:04:17.459 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - Cipher context created: CipherContext[id=20,encrypt=false]. 2022-06-29 14:04:17.459 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - set nsMsgVersion / cryptors: farm=HISTORICAL_DATA-ushmds; nsMsgVersion=44; encryptor=true; decryptor=true 2022-06-29 14:04:17.459 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - AuthTimeoutMonitor-ushmds: deactivate 2022-06-29 14:04:17.459 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - AuthTimeoutMonitor-ushmds: timeout=20000 2022-06-29 14:04:17.459 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - AuthTimeoutMonitor-ushmds: activate 2022-06-29 14:04:17.544 [BB] INFO? [JTS-ushmdsDispatcherS14-164S14-165] - Start ping with 5000 for JTS-ushmdsServicePreAuthPingS14-167 2022-06-29 14:04:17.544 [BB] INFO? [JTS-AuthTimeoutMonitorThread-ushmds-166] - Starting auth timeout monitor thread for ushmds 2022-06-29 14:04:17.562 [BB] INFO? [JTS-ushmdsServicePreAuthPingS14-167] - Starting ping thread ------------------------------------------------------------------------ 2022-06-29 14:05:23.418 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Received MD auth msg classid = 1 2022-06-29 14:05:23.419 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Receiver: 772 2022-06-29 14:05:23.419 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Received Result 2022-06-29 14:05:23.419 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Passed session token authentication. 2022-06-29 14:05:23.662 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Logon reply received [signed=true]. 2022-06-29 14:05:23.662 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Reconnection time cleared: argClearBackoff=true base=0 range=5000 next=0 disconnected=0 2022-06-29 14:05:23.662 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - AuthTimeoutMonitor-ushmds: deactivate 2022-06-29 14:05:23.663 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Farm ushmds/CCP: Upgrading to native connection 2022-06-29 14:05:23.663 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Disconnecting hdc1.ibllc.com:4000 [disconnectDetails=DisconnectDetails[sessionID=12,endPoint=hdc1.ibllc.com:4000,reason=DISCONNECT_NATIVE_CONNECTION_RESTORED,cause=null,systemMessage=null,keepSocketOpen=false]]... 2022-06-29 14:05:23.663 [BB] INFO? [JTS-ushmdsListenerS12-156] - Socket or stream for connection hdc1.ibllc.com:4000 was closed by another thread. 2022-06-29 14:05:23.663 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Socket closed. 2022-06-29 14:05:23.663 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Interrupting dispatcher [sessionID=12]... 2022-06-29 14:05:23.663 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Interrupting listener [sessionID=12,disconnectSocket=true]... 2022-06-29 14:05:23.663 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - AuthTimeoutMonitor-ushmds: deactivate 2022-06-29 14:05:23.664 [BB] INFO? [JTS-ushmdsListenerS12-156] - Listener thread terminating [sessionID=12] [seen=6881,totalShifted=6881,moreAvailable=0] 2022-06-29 14:05:23.664 [BB] INFO? [JTS-ushmdsDispatcherS18-176S18-177] - Start ping with 60000 for JTS-ushmdsServicePingS18-181 2022-06-29 14:05:23.665 [BB] INFO? [JTS-DisconnectedS12-180] - Farm ushmds/NATIVE: Old CCP connection hdc1.ibllc.com:4000 UNCONNECTED was disconnected after native upgrade 2022-06-29 14:05:23.665 [BB] INFO? [JTS-AsyncNonLocked-44] - Keep-alive scheduled for:ushmds 2022-06-29 14:05:23.665 [BB] INFO? [JTS-AsyncNonLocked-44] - [1:157:157:1:0:4:2:DET] Sending error. 2022-06-29 14:05:23.665 [BB] INFO? [JTS-AsyncNonLocked-44] - [1:157:157:1:0:4:2:DET] [4;2;-1;2105;HMDS data farm connection is broken:ushmds] 2022-06-29 14:05:23.665 [BB] INFO? [JTS-AsyncNonLocked-44] - [1:157:157:1:0:4:2:DET] Error sent. 2022-06-29 14:05:23.666 [BB] INFO? [JTS-AsyncNonLocked-44] - cdebug: ROUTING | connTracker:ushmds@5cd4e9d | Disconnected | 1656475522897 | true 2022-06-29 14:05:23.666 [BB] INFO? [JTS-AsyncNonLocked-44] - [1:157:157:1:0:4:2:DET] Sending error. 2022-06-29 14:05:23.666 [BB] INFO? [JTS-AsyncNonLocked-44] - [1:157:157:1:0:4:2:DET] [4;2;-1;2106;HMDS data farm connection is OK:ushmds] 2022-06-29 14:05:23.666 [BB] INFO? [JTS-AsyncNonLocked-44] - [1:157:157:1:0:4:2:DET] Error sent. 2022-06-29 14:05:23.666 [BB] INFO? [JTS-AsyncNonLocked-44] - Keep-alive applied to:ushmds 2022-06-29 14:05:23.666 [BB] INFO? [JTS-AsyncNonLocked-44] - cdebug: ROUTING | connTracker:ushmds@5cd4e9d | Connected | 1656475522897 2022-06-29 14:05:23.666 [BB] INFO? [JTS-ushmdsNativeUpgrade-162] - Farm ushmds/NATIVE: Terminating native background upgrade 2022-06-29 14:05:23.666 [BB] INFO? [JTS-ushmdsServicePreAuthPingS18-179] - Terminating ping thread 2022-06-29 14:05:23.666 [BB] INFO? [JTS-ushmdsDispatcherS12-157S12-158] - Dispatcher thread terminating [sessionID=12,interrupted=true]... 2022-06-29 14:05:23.667 [BB] INFO? [JTS-ushmdsServicePingS12-161] - Terminating ping thread 2022-06-29 14:05:23.667 [BB] INFO? [JTS-AuthTimeoutMonitorThread-ushmds-178] - Terminating auth timeout monitor thread for ushmds 2022-06-29 14:05:23.673 [BB] INFO? [JTS-ushmdsServicePingS18-181] - Starting ping thread |
||||
Moderated
Re: Fundamentals Explorer
开云体育Hey hey, Thanks so much, thanks for the links, will give it a go again.
On 24/06/2022 05:24 pm, 闯ü谤驳别苍 Reinold
via groups.io wrote:
|
||||
Moderated
Re: Fundamentals Explorer
I guess if finviz provides what you are looking for, maybe that's the way to go. Richard and? hymagik have pointed you in the direction you'd have to go with the IBKR API. Let me only add a few links to the API documentation where you can find the TWS API requests for all API implementations that deal with the kind of data you are looking for.. Feel free and ignore if you have studied this documentation by now:
I have put the topic on moderation for now to avoid unnecessary noise. Substantive contributions and specific questions about API requests or concrete issues are obviously always welcome. |
||||
Moderated
Re: Fundamentals Explorer
开云体育Actually, this is a sample of what I am looking for, however I got this from finviz. statements?????????????? Dividend -
On 21/06/2022 12:05 am, Colin B Maharaj
via groups.io wrote:
|
||||
Re: IB Routinely Misses Stops and Hidden LMTs
@jcopp
You can only set the trigger method for simulated orders, in live trading it is up to the exchange and i suppose they are using the default method.
|
||||
Good Till Date order rejected outside RTH?
I'm receiving the following error when my algo places a futures trade outside RTH with the Good till Date set to expire the order after 10 mins: |
||||
How to request historical data from a specific date?
Hi,?
I would like to know if there is a way to request historical market data using the "/api/iserver/marketdata/history" endpoint from a specific date or time? Currently, I am able to obtain data from this endpoint, but all data returned is till the present. So would anybody know please, is it possible to specify a start/end parameter to return historical data via the endpoint? If not, is there any alternative that can be used to meet this objective? Thanks [Moderator edit] This relates to the |
||||
Restoration of historical data after interruption by competing session
Hi, it's easy to learn from experience that API data streams are restored without the need for resending requests after a connection is completely broken between API software and IBKR servers, but?I wonder if anyone in the group has a firm grasp of historical data behavior when datafarm access is interrupted by a competing session (i.e. TWS vs IBGW, or mobile vs desktop etc). This pertains to errors 10187 and possibly 10197 I believe.
Do API data request states get automatically restored together with connection to respective datafarms as well? How long is the time-out to restore the datafarm availability after the competing session terminates? |
||||
Re: IB Routinely Misses Stops and Hidden LMTs
Correct. You set OutsideRth to true on every order object in the bracket. But at least on STOP orders. Order presets defined within TWS have no impact on your TWS API client. As a matter of practice, we set OutsideRth true on all orders in the bracket for ES trades, but apparently only the StopLoss STOP order really needs it set for triggers to work. In fact we get Error 2109 warnings on all other orders: 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed. In the example below OutsideRth was set to true for all four orders in the bracket
闯ü谤驳别苍 On Thu, Jun 23, 2022 at 04:42 PM, Jenzi wrote: That's a very interesting thought, because the exits were made in the second the us markets did open. |
||||
How does ExecutionCondition work? (Pair Trade)
I'm testing out making pair trades where one half of the trade is executed before the second and the second's execution is conditional on the first (ex: buy AAPL and short MSFT, but you only short MSFT once the AAPL trade has been executed). It seems like ExecutionCondition should fit this, but the documentation isn't really clear about what it actually does and I was wondering if anyone could clarify.
ib_insync docs:?? ibkr docs:?? |
||||
Re: IB Routinely Misses Stops and Hidden LMTs
One factor to consider is which trigger to use: Bid, Ask, or Last. That obviously plays a role, including vulnerability when bored institutional traders run the Stops. On Thu, Jun 23, 2022 at 2:42 PM Jenzi <jzip@...> wrote: That's a very interesting thought, because the exits were made in the second the us markets did open. |
||||
Re: IB Routinely Misses Stops and Hidden LMTs
That's a very interesting thought, because the exits were made in the second the us markets did open.
Otherwise, i have made many other trades during the day where it worked (same instrument, exits on taget limit or stop). In the TWS 'Global Configuration' - 'Presets' for Futures the checkmark is set. You mean to set the option for every bracket order when creating/sending an order? I'll give that a try.
|
||||
Re: IB Routinely Misses Stops and Hidden LMTs
开云体育Did you set the stop-loss orders to execute outside regular trading hours? It’s not enough just to set that for the parent order. ? ? ? From: [email protected] <[email protected]> On Behalf Of Jenzi
Sent: 23 June 2022 20:16 To: [email protected] Subject: Re: [TWS API] IB Routinely Misses Stops and Hidden LMTs ? It's ES before the US open, during European markets. |
||||
Re: IB Routinely Misses Stops and Hidden LMTs
How liquid are the contracts you're trading? Even if the stop gets triggered you still need some liquidity for the trade to execute On Thu, Jun 23, 2022 at 11:52 AM Jenzi <jzip@...> wrote: These aren't Stop Limits 'STP LMT', but Stop Orders 'STP', that should exit via a market order, when according to IB doc "the user-specified stop trigger price is attained or penetrated". |
||||
Re: IB Routinely Misses Stops and Hidden LMTs
These aren't Stop Limits 'STP LMT', but Stop Orders 'STP', that should exit via a market order, when according to IB doc "the user-specified stop trigger price is attained or penetrated".
This is happened live. And i've seen this with Trailing Stops too. I've checked the ES trades, take a look at the 2min chart, i've marked the two candles with the short entries, it wasn't even a volatile market and i doubt anything got jumped. The exits were made more than four hours later. |