开云体育

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Is there generic method to format contract for reqContractDetails

 

Actually, I was wrong, yes, ConId is enough.?
It didn't work for SPY because that was the only security I defined manually, so it didn't have ConId.


Re: Is there generic method to format contract for reqContractDetails

 

I wish that was true but it is not.?
Just double checked, having only ConID doesn't work for SPY stock, other security types work fine.?
Error validating request.-'bI' : cause - The symbol or the local-symbol or the security id must be entered


The difference between realtimebar vs reqHistoricalData with barSizeSetting = "5S" and keepUpToDate = True

 

Hi All,
?
do you guys know what is the difference between realtimebar vs reqHistoricalData with barSizeSetting = "5S" and keepUpToDate = True?
?
Thanks?
?
xb


Re: Is there generic method to format contract for reqContractDetails

 

The ConId by itself uniquely identifies the Contract. If you already have a ConId (as you said from orders, positions, or similar objects), SecType and LocalSymbol are not required to retrieve the corresponding ContractDetails object.

闯ü谤驳别苍

?

?

On Mon, Dec 2, 2024 at 12:38 AM, Andy Sanders wrote:

Thank you for the explanation.?
After mentioning that contract can be "overspecified", I tried? to simplify definition instead of complicating it.?
Appeared to be that specifying only 3 fields is enough to specify the contract.?
?
  • ConId
  • SecType
  • LocalSymbol
This information is returned for all open orders and positions. Technically, ConId is not required, but without ConId, reqContractDetails can't find some contracts within 5 seconds, specifically those with options expiring daily, which is not acceptable. Final version cut down to 3 fields only, works fine for stocks, options, forex, futures, futures options.?


Re: Is there generic method to format contract for reqContractDetails

 

Thank you for the explanation.?
After mentioning that contract can be "overspecified", I tried? to simplify definition instead of complicating it.?
Appeared to be that specifying only 3 fields is enough to specify the contract.?
?
  • ConId
  • SecType
  • LocalSymbol
This information is returned for all open orders and positions. Technically, ConId is not required, but without ConId, reqContractDetails can't find some contracts within 5 seconds, specifically those with options expiring daily, which is not acceptable. Final version cut down to 3 fields only, works fine for stocks, options, forex, futures, futures options.?
?
public static Contract GetContract(InstrumentModel instrument)
{
? var basis = instrument.Basis;
? var derivative = instrument.Derivative;
? var contract = new Contract
? {
? ? //Symbol = basis?.Name,
? ? LocalSymbol = instrument.Name,
? ? //Multiplier = $"{instrument.Leverage}",
? ? //Exchange = instrument.Exchange ?? "SMART",
? ? SecType = GetInstrumentType(instrument.Type),
? ? ConId = int.TryParse(instrument.Id, out var id) ? id : 0,
? ? //Currency = instrument.Currency?.Name ?? nameof(CurrencyEnum.USD)
? };
? //if (derivative is not null)
? //{
? // ?contract.Strike = derivative.Strike ?? 0;
? // ?contract.LastTradeDateOrContractMonth = $"{derivative.Expiration:yyyyMMdd}";
? // ?switch (derivative.Side)
? // ?{
? // ? ?case OptionSideEnum.Put: contract.Right = "P"; break;
? // ? ?case OptionSideEnum.Call: contract.Right = "C"; break;
? // ?}
? //}
? return contract;
}


Re: Is there generic method to format contract for reqContractDetails

 

The Contract object contains a lot of information about an instrument, but the various API request calls thatt take Contract object parameters transmit only a subset of those to TWS/IBGW. Which those are is not defined by the API specification, so the best practice is to always use complete Contract objects that you receive from IBKR through reqContractDetails calls. I understand that many code samples give you a different impression (e.g. they make contract objects up on the fly) but "home made" Contract objects do not result in reliable results over long periods of time.

Think about reqContractDetails as a database query. Depending on what you want to see, you provide more or less attributes to the query:

  • If you try to get the contracts for all ES futures that IBKR currently knows about, for example, you'd specify in the contract you provide to reqContractDetails as little as ES:FUT:CME and you might set the includeExpired flag to true. Similar you could ask, as another example, for a list with one Contract for each exchange a stock is listed on.
  • But on the other side, if you are just interested in ESZ4, you'd set localName to ESZ4 or the specify the future's expiration through lastTradeDateOrContractMonth (just like you did for the stock option)
  • And if you simply want to get the Contract for what IBKR currently considers the ES front month future, simply make a reqContractDetails for ES:CONTFUT:CME.

But you would generally not call reqContractDetails with a complete Contract object you have received from IBKR. Chances are that those contracts over-specify the instrument which can indeed result in a "No security definition was found" error.

One convenient way to design your reqContractDetails queries (you'd do that once) is ?Richard King's Another path are the complete TWS API client applications that ship with TWS API (such as the pre-compiled Java and C# apps). They also have screens where you quickly can experiment with reqContractDetails. But Richard's tool is more purpose built and might get you results quicker.

Many of our members call reqContractDetails for the instruments they are interested in when their client applications start, or at least once per session, and use the resulting Contract object for all requests. The returned ContractDetails object(s) do not just contain the Contract you are looking for, but also the actual trading hours for the next few days. This is very helpful to detect short notice changes (emergencies, local events) and the exact trading hours around public holidays.

You can also search our message archive, since there are several topics about how to specify contract queries for various instrument types.

Hope this helps as a direction for a reliable approach.

闯ü谤驳别苍

PS. When you request market data with a contract that specifies just ES:IND:CME:USD you get very likely data for the ES Index and not the ES Future. If you want to request data for the ES Future with a "home made" contract, specify the fields I mentioned above: type such as type FUT plus localName or lastTradeDateOrContractMonth or type CONTFUT.

?

?
On Sun, Dec 1, 2024 at 05:01 PM, Andy Sanders wrote:

To get stock contract, it requires only 4 fields.?
?
Name = "SPY"
Exchange = "SMART"
SecType = "STK"
Currency = "USD"
?
For stock options, the 4 fields above + 3 more?
?
Right = "C"
Strike = 650
LastTradeDateOrContractMonth = "20241231"
?
When it comes to futures and futures options, it gets messy. For example, after reading couple of posts in this group, this is the contract definition that I used to subscribe to live data feed for ES futures. Of course, "SecType" = "FUT" and "Exchange" = "SMART" would be more appropriate but here we go.??
?
Name = "ES"
Exchange = "CME"
SecType = "IND"
Currency = "USD"
?
I have no idea why it has to be "IND" instead of "FUT" but somehow it worked for "reqMktData". Meanwhile, when I try to pass this to "reqContractDetails", I get "No security definition was found for the request".?The same happens when I try to request contract details for futures options.
The funny part is that I don't populate these parameters manually, I just request all open orders and positions, copy contract object from there and use it in reContractDetails but IB API returns "No security found" error for it. In other words, IB API returns INCORRECT data that can't be used to make other requests.?
?
Hence the question, Is there a map or table that clearly defines which security type and exchange need to be used with specific securities, e.g. if I have these assets, how do I create method that correctly populates properties for them, so I could use their contract definitions in other API calls, like reqMktData?
?
  • SPY
  • SPY call option
  • ES futures
  • ES futures call option?
  • EURUSD


Is there generic method to format contract for reqContractDetails

 

To get stock contract, it requires only 4 fields.?
?
Name = "SPY"
Exchange = "SMART"
SecType = "STK"
Currency = "USD"
?
For stock options, the 4 fields above + 3 more?
?
Right = "C"
Strike = 650
LastTradeDateOrContractMonth = "20241231"
?
When it comes to futures and futures options, it gets messy. For example, after reading couple of posts in this group, this is the contract definition that I used to subscribe to live data feed for ES futures. Of course, "SecType" = "FUT" and "Exchange" = "SMART" would be more appropriate but here we go.??
?
Name = "ES"
Exchange = "CME"
SecType = "IND"
Currency = "USD"
?
I have no idea why it has to be "IND" instead of "FUT" but somehow it worked for "reqMktData". Meanwhile, when I try to pass this to "reqContractDetails", I get "No security definition was found for the request".?The same happens when I try to request contract details for futures options.
The funny part is that I don't populate these parameters manually, I just request all open orders and positions, copy contract object from there and use it in reContractDetails but IB API returns "No security found" error for it. In other words, IB API returns INCORRECT data that can't be used to make other requests.?
?
Hence the question, Is there a map or table that clearly defines which security type and exchange need to be used with specific securities, e.g. if I have these assets, how do I create method that correctly populates properties for them, so I could use their contract definitions in other API calls, like reqMktData?
?
  • SPY
  • SPY call option
  • ES futures
  • ES futures call option?
  • EURUSD


Re: How to get position info in "points"

 

For the future readers.
Using average open price and the current price, you can get PnL in points.?
?
?

Average?

 double average_op = (op1 * lot1 + op2 * lot2 + opN * lotN) / (lot1 + lot2 + lotN);

Profit in points:

 double profit = Bid - average_op;
What I was expected to receive from IB API is an ability to see the PnL in points and dollars separately.?
Appeared that IB returns only average cost in dollars and only for one unit, so there is no need to divide it by number of contracts but it needs to be divided by multiplier.?
?
Examples?
?
What "reqOpenPositions" returns
  • 2 contracts of ESZ4 (ES futures) => 300540
  • 1 contract of E1AZ4 C6020 (ES call option) => 901.42
  • 1 contract of SPY (ETF stock) => 597.94
  • 1 contract of SPY 241203C00600000 (SPY call option) => 155
After dividing by multiplier I can get average open price?
  • ESZ4 => 300540 / 50 => 6010.80
  • E1AZ4 C6020 (ES call option) => 901.42 / 50 => 18.03
  • SPY (ETF stock) => 597.94 / 1 => 597.94
  • SPY 241203C00600000 (SPY call option) => 155 / 100 => 1.55
I know average cost in dollars that IB returns.?
  • to get PnL in points I can subtract average open price from the current price from "reqMktData"
  • to get PnL in dollars I can either make a call to "getPnl" or multiple PnL in points by tick value received from "reqMktData"
In other words, there are always 2 calls.?
  • reqPositions
  • reqMktData or reqPnl?


Re: TWS API Stopped accepting incoming connections sometimes

 

Please see the other thread: ?/g/twsapi/topic/107684402
The same issue is being mentioned there.


TWS API Stopped accepting incoming connections sometimes

 

TWS sometimes suddenly cannot connect, and it must be re-verified and logged in again to fix it.
?
Belows are gateway logs happened before my connection failure today
?
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-ushmdsServicePingS9-286] - Farm ushmds/NATIVE: Closing dormant connection type:HISTORICAL_DATA
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-ushmdsServicePingS9-286] - Disconnecting cdc1.ibllc.com:4000 [disconnectDetails=DisconnectDetails[sessionID=9,endPoint=cdc1.ibllc.com:4000,reason=DISCONNECT_ON_INACTIVITY,cause=null,systemMessage=null,keepSocketOpen=false]]...
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-ushmdsServicePingS9-286] - Socket closed.
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-ushmdsServicePingS9-286] - SocketTracker[name=name=ushmds(cdc1.ibllc.com:4000),usesCcpConMan=false,lastReadTimestamp=1732869470298,lastReadDateTime=2024-11-29T08:37:50.298,lastFixSendTime=].
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-ushmdsServicePingS9-286] - Interrupting dispatcher [sessionID=9]...
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-ushmdsServicePingS9-286] - Interrupting listener [sessionID=9,disconnectSocket=true]...
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-ushmdsServicePingS9-286] - AuthTimeoutMonitor-ushmds: deactivate
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-ushmdsDispatcherS9-282S9-283] - Dispatcher thread terminating [sessionID=9,interrupted=true]...
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-ushmdsListenerS9-281] - Socket or stream for connection cdc1.ibllc.com:4000 was closed by another thread.
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-ushmdsServicePingS9-286] - Terminating ping thread
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-ushmdsListenerS9-281] - Listener thread terminating [sessionID=9] [seen=36342294,totalShifted=36342294,moreAvailable=0]
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-DisconnectedS9-551] - Farm ushmds/NATIVE: Lost active connection with disconnect status DISCONNECT_ON_INACTIVITY
2024-11-29 08:37:59.254 [EY] INFO ?[JTS-DisconnectedS9-551] - Farm ushmds/NATIVE: Not resetting
2024-11-29 08:37:59.255 [EY] INFO ?[JTS-AsyncNonLocked-33] - [50:176:176:1:0:4:2:DET] Sending error.
2024-11-29 08:37:59.255 [EY] INFO ?[JTS-AsyncNonLocked-33] - [50:176:176:1:0:4:2:DET] [4;2;-1;2107;HMDS data farm connection is inactive but should be available upon demand.ushmds;]
2024-11-29 08:37:59.255 [EY] INFO ?[JTS-AsyncNonLocked-33] - [50:176:176:1:0:4:2:DET] Error sent.
2024-11-29 08:38:31.130 [EY] INFO ?[JTS-CCPPingS2-28] - Resetting long time mode
2024-11-29 08:39:32.134 [EY] INFO ?[JTS-CCPPingS2-28] - Resetting long time mode
2024-11-29 08:40:11.939 [EY] INFO ?[JTS-DeadlockMonitor-2] - Memory:total=786,432KB free=277,852KB HeapUsage: Max=786,432KB used=506,764KB committed=786,432KB NonHeapUsage: Max=0KB used=172,722KB committed=176,432KB
2024-11-29 08:40:12.940 [EY] INFO ?[JTS-DeadlockMonitor-2] - CPU:cur=12.52% avg=0.38% 30 min avg=4.46% 10 min avg=12.51% 5 min avg=12.50% 1 min avg=12.52%
GC:called=953 times CPU used=0.03%
Finalizer:cur=0.00% avg=0.00% 30 min avg=0.00% 10 min avg=0.00% 5 min avg=0.00% 1 min avg=0.00%
Threads Count:curr live=72 curr daemon=33
2024-11-29 08:40:33.139 [EY] INFO ?[JTS-CCPPingS2-28] - Resetting long time mode
2024-11-29 08:41:34.144 [EY] INFO ?[JTS-CCPPingS2-28] - Resetting long time mode
2024-11-29 08:42:35.148 [EY] INFO ?[JTS-CCPPingS2-28] - Resetting long time mode
2024-11-29 08:43:36.153 [EY] INFO ?[JTS-CCPPingS2-28] - Resetting long time mode
2024-11-29 08:44:37.158 [EY] INFO ?[JTS-CCPPingS2-28] - Resetting long time mode
2024-11-29 08:45:11.944 [EY] INFO ?[JTS-DeadlockMonitor-2] - Memory:total=786,432KB free=273,763KB HeapUsage: Max=786,432KB used=510,860KB committed=786,432KB NonHeapUsage: Max=0KB used=172,732KB committed=176,432KB
2024-11-29 08:45:12.945 [EY] INFO ?[JTS-DeadlockMonitor-2] - CPU:cur=12.52% avg=0.49% 30 min avg=6.54% 10 min avg=12.51% 5 min avg=12.51% 1 min avg=12.52%
GC:called=953 times CPU used=0.03%
Finalizer:cur=0.00% avg=0.00% 30 min avg=0.00% 10 min avg=0.00% 5 min avg=0.00% 1 min avg=0.00%
Threads Count:curr live=72 curr daemon=33
2024-11-29 08:45:38.162 [EY] INFO ?[JTS-CCPPingS2-28] - Resetting long time mode
2024-11-29 08:46:39.167 [EY] INFO ?[JTS-CCPPingS2-28] - Resetting long time mode
2024-11-29 08:47:40.171 [EY] INFO ?[JTS-CCPPingS2-28] - Resetting long time mode
2024-11-29 08:49:00.405 [EY] INFO ?[JTS-EServerSocket-546] - [112501:187:187:1:0:0:0:ERR] Socket connection for client{112501} has closed. Reason: Connection terminated
2024-11-29 08:49:00.405 [EY] INFO ?[JTS-EServerSocket-546] - [112501:187:187:1:0:0:0:INFO] Stopped processing incoming messages for client{112501}.
?
?
Does anyone encounter this issue and know why is it happending? Appreciate if you can provide some insights.
?
Thanks?
xb
?


Re: No real-time data after IB nightly server reset

 

I have an open ticket with IBKR about a very similar (even identical?) topic since a couple of weeks. I have experienced the same problems where on some days Gateway would not recover after a daily reset. In all cases was a disconnect from ushmds involved. Initially I did not respond to the opening post of this thread because I am not using Docker.
?
In recent weeks the problem has disappeared. I used to download once per day quite some historical data for a list of US stock tickers (5 years daily data for 230 tickers). Every now and then (once, twice per week?) ushmds would disconnect after I had submitted the data requests, and before I received the results. Immediately after this disconnect Gateway would disconnect all clients and not allow any new clients to connect! Forcing me to kill Gateway and restart it. Four weeks ago I changed my software: now I am downloading a lot less data every day, and merge that with data I already have. Since then has the problem disappeared. What I suspect, but don't have confirmation of, is that somehow I exceeded the "soft limits" IBKR has in place on historical data downloads. In the open ticket I'm having with IBKR I am hoping to get a confirmation that this was indeed the case. I must emphasize though that I never received a warning that I was downloading too much data, or that I had crossed the soft limit.


Re: How to get position info in "points"

 

If you are not collecting order executions through the API as Juergen suggested, the other way to approach this is to collect and aggregate IBKR's trade reports or custom designed flex reports from email.


чт, 28 нояб. 2024?г., 18:04 闯ü谤驳别苍 Reinold via <TwsApiOnGroupsIo=Reinold.org@groups.io>:

It sounds like you are looking in the wrong corner.

At any point in time, a "Position" represents the cumulative effect of one or more Trades (Executions) that were caused by one or more Orders for the instrument in the "Position". The attributes you call "open time" and "open price" are actually attributes of the "Execution" not the "Position".

The "Position" only know about sums and averages.

Your client receives real-time order and execution callbacks as the position changes. You could collect and persist at least the executions if you need to know later, how the position changed over time.

闯ü谤驳别苍

?

?

On Thu, Nov 28, 2024 at 01:27 PM, Andy Sanders wrote:
What is the most efficient way to get information about position including the fields below.
?
- open time?
- open price
- unrealized PnL?
?
Request "reqPositions" and "reqPositionsMulti" return these?
?
- reqId
- account
- contract
- avgCost
?
1. Instead of average cost, how do I get price of the stock / option / future when position was opened??
2. How do I get time when it was open??
3. There is a separate request for PnL but even if I get PnL, there are some missing pieces, e.g. I can't calculate the range in points between open and current prices of the asset.??

?


--
Best,
DS


Re: How to get position info in "points"

 

It sounds like you are looking in the wrong corner.

At any point in time, a "Position" represents the cumulative effect of one or more Trades (Executions) that were caused by one or more Orders for the instrument in the "Position". The attributes you call "open time" and "open price" are actually attributes of the "Execution" not the "Position".

The "Position" only know about sums and averages.

Your client receives real-time order and execution callbacks as the position changes. You could collect and persist at least the executions if you need to know later, how the position changed over time.

闯ü谤驳别苍

?

?

On Thu, Nov 28, 2024 at 01:27 PM, Andy Sanders wrote:

What is the most efficient way to get information about position including the fields below.
?
- open time?
- open price
- unrealized PnL?
?
Request "reqPositions" and "reqPositionsMulti" return these?
?
- reqId
- account
- contract
- avgCost
?
1. Instead of average cost, how do I get price of the stock / option / future when position was opened??
2. How do I get time when it was open??
3. There is a separate request for PnL but even if I get PnL, there are some missing pieces, e.g. I can't calculate the range in points between open and current prices of the asset.??

?


Re: No real-time data after IB nightly server reset

 

From the logs is sounds like the intention was to "disconnectAndReconnect due to routing change for ushmds" but the reconnect part never materialized. You'd probably have to reach out to IBKR to understand why the reconnect never happened and what can be done about it.

Before disconnect, your TWS/IBGW was connected to the US Central/Chicago HMDS located at cdc1.ibllc.com. Do you have a decent network connection between your system and cdc1? As in decent packet loss?

闯ü谤驳别苍

?

?

On Thu, Nov 28, 2024 at 03:26 AM, xb wrote:


2024-11-27 12:17:38.170 [UO] INFO ?[JTS-AsyncNonLocked-33] - disconnectAndReconnect due to routing change for ushmds state:NATIVE default:ccp dataType:NONE points:[useccphost] nativeViaCcp:null
2024-11-27 12:17:38.170 [UO] INFO ?[JTS-AsyncNonLocked-33] - SocketTracker[name=name=ushmds(cdc1.ibllc.com:4000),usesCcpConMan=false,lastReadTimestamp=1732709856527,lastReadDateTime=2024-11-27T12:17:36.527,lastFixSendTime=].
?


How to get position info in "points"

 

What is the most efficient way to get information about position including the fields below.
?
- open time?
- open price
- unrealized PnL?
?
Request "reqPositions" and "reqPositionsMulti" return these?
?
- reqId
- account
- contract
- avgCost
?
1. Instead of average cost, how do I get price of the stock / option / future when position was opened??
2. How do I get time when it was open??
3. There is a separate request for PnL but even if I get PnL, there are some missing pieces, e.g. I can't calculate the range in points between open and current prices of the asset.??


Re: No real-time data after IB nightly server reset

 

I have posted about more or less the same experience not long ago: /g/twsapi/message/53498
I've come to a solution that I will perform a fresh reconnection after nightly reset as well as I usually do after daily TWS auto restart.
Seems to be working better for me, but I want to monitor for a few more days to be sure if the loss of data subscriptions still happens.
?


Re: No real-time data after IB nightly server reset

 

Hi 闯ü谤驳别苍,
?
I think the ushmds might be the cause,?
?
BTW Here's my gateway logs for ushmds part around that time
?
2024-11-27 12:15:57.522 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - cdebug: QUERY | cf312@6322834f | Done | cf312;;BQ@SMART Trades;;1;;true;;0;;I | 0
2024-11-27 12:15:57.523 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - cdebug: QUERY | adjustments311@2e87e5ab | Done | adjustments311;;BQ@SMART Trades;;1;;true;;0;;I | 0
2024-11-27 12:15:57.523 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - cdebug: QUERY | cf312@6322834f | Clear | 0
2024-11-27 12:15:57.523 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - cdebug: QUERY | indicativeData310@1c25bb71 | Done | indicativeData310;;BQ@SMART Trades;;1;;true;;0;;I | 0
2024-11-27 12:15:57.523 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - cdebug: QUERY | adjustments311@2e87e5ab | Clear | 0
2024-11-27 12:15:57.523 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - cdebug: QUERY | cf312@6322834f | Clear | 0
2024-11-27 12:15:57.523 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - cdebug: QUERY | agg309@1719520f | Done | agg309;;BQ@SMART Trades;;1;;true;;0;;I | 0
2024-11-27 12:15:57.523 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - cdebug: QUERY | indicativeData310@1c25bb71 | Clear | 0
2024-11-27 12:15:57.523 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - cdebug: QUERY | adjustments311@2e87e5ab | Clear | 0
2024-11-27 12:15:57.523 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - cdebug: QUERY | cf312@6322834f | Clear | 0
2024-11-27 12:15:57.526 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - HMDS query: 78;;BQ@SMART Trades;;1;;true;;0;;I has returned for series: BQ@SMART Trades
2024-11-27 12:15:57.527 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - cdebug: QUERY | qm@42f1f33f | all EOQ
2024-11-27 12:15:57.582 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - [50:176:176:1:0:17:3:INFO] Sending historical data for ticker = 78. 182489 items.
2024-11-27 12:15:59.217 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - Start writing to output data. Left to write: 12019494
2024-11-27 12:15:59.219 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - Writing to output data. Written: 0 Left: 12019494
2024-11-27 12:15:59.719 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - Finished writing to output data.
2024-11-27 12:16:01.844 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - [50:176:176:1:0:17:3:INFO] Historical data is sent for ticker = 78. 182489 items.
2024-11-27 12:17:38.170 [UO] INFO ?[JTS-AsyncNonLocked-33] - disconnectAndReconnect due to routing change for ushmds state:NATIVE default:ccp dataType:NONE points:[useccphost] nativeViaCcp:null
2024-11-27 12:17:38.170 [UO] INFO ?[JTS-AsyncNonLocked-33] - SocketTracker[name=name=ushmds(cdc1.ibllc.com:4000),usesCcpConMan=false,lastReadTimestamp=1732709856527,lastReadDateTime=2024-11-27T12:17:36.527,lastFixSendTime=].
2024-11-27 12:17:38.170 [UO] INFO ?[JTS-ushmdsServicePingS14-749] - Terminating ping thread
2024-11-27 12:17:38.170 [UO] INFO ?[JTS-AsyncNonLocked-33] - AuthTimeoutMonitor-ushmds: deactivate
2024-11-27 12:17:38.170 [UO] INFO ?[JTS-ushmdsListenerS14-744] - Socket or stream for connection cdc1.ibllc.com:4000 was closed by another thread.
2024-11-27 12:17:38.170 [UO] INFO ?[JTS-ushmdsDispatcherS14-745S14-746] - Dispatcher thread terminating [sessionID=14,interrupted=true]...
2024-11-27 12:17:38.170 [UO] INFO ?[JTS-ushmdsListenerS14-744] - Listener thread terminating [sessionID=14] [seen=15024770,totalShifted=15024770,moreAvailable=0]
2024-11-27 12:17:38.172 [UO] INFO ?[JTS-DisconnectedS14-941] - Farm ushmds/NATIVE: Lost active connection with disconnect status DISCONNECT_ON_BROKEN_SOCKET
2024-11-27 12:17:38.173 [UO] INFO ?[JTS-DisconnectedS14-941] - Farm ushmds/NATIVE: Resetting
2024-11-27 12:17:38.174 [UO] INFO ?[JTS-AsyncNonLocked-33] - Keep-alive scheduled for:ushmds
2024-11-27 12:17:38.174 [UO] INFO ?[JTS-AsyncNonLocked-33] - [50:176:176:1:0:4:2:DET] [4;2;-1;2105;HMDS data farm connection is broken:ushmds;]
2024-11-27 12:17:38.175 [UO] INFO ?[JTS-AsyncNonLocked-33] - [112501:187:187:1:0:4:2:DET] [4;2;-1;2105;HMDS data farm connection is broken:ushmds;]
2024-11-27 12:17:38.175 [UO] INFO ?[JTS-AsyncNonLocked-33] - cdebug: ROUTING | connTracker:ushmds@4785586b | Disconnected | 1732709857176 | true
?
罢丑补苍办蝉,
xb
?


Re: No real-time data after IB nightly server reset

 

Hi?闯ü谤驳别苍?,
?
The time in my machine e.g.12:17:38 is in UTC timezone. I was requesting realtime bars and historical data for US stocks only, do you think the failure was due to ushmds not reconnecting successfully at that time???
?
Thanks!
?


Re: No real-time data after IB nightly server reset

 

Nothing jumps at me, except that ushmds disconnected at 12:17:38 and did not reconnect by the time TWS/IBGW had reestablished full connectivity with IBKR at 12:18:08. But that may be fine in case it was not needed any longer.

What kind of symbols were your reqRealTimeBars for? STK, FUT, OPT, ..., US, HK, Asia, ...?

What time zone are these timestamps in?

Have you taken a look at the TWS/IBKR logs? Just to see whether there are some errors related to market data.

闯ü谤驳别苍

?

?
?
On Thu, Nov 28, 2024 at 12:52 AM, <xiaobo.li@...> wrote:

Hi?闯ü谤驳别苍?,
?
I encountered the same issue and still no market data after the connection was restored.
?
Followings are my logs
?
2024-11-27 12:15:54.656112 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:15:55.257818 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:06.239496 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:12.080815 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:16.738522 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:21.150339 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:31.521287 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:42.307221 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:56.400287 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:17:12.772813 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:17:38.175326 ERROR 2105 HMDS data farm connection is broken:ushmds
2024-11-27 12:17:38.312416 ERROR 2106 HMDS data farm connection is OK:apachmds
2024-11-27 12:18:08.178669 ERROR 1102 Connectivity between IBKR and Trader Workstation has been restored - data maintained. The following farms are connected: hfarm; apachmds; secdefhk. The following farms are not connected: ushmds.
2024-11-27 15:30:47.702324 ERROR 2157 Sec-def data farm connection is broken:secdefhk
2024-11-27 15:30:48.190508 ERROR 2158 Sec-def data farm connection is OK:secdefhk
2024-11-27 15:45:17.419716 ERROR 2157 Sec-def data farm connection is broken:secdefhk
2024-11-27 15:45:21.453034 ERROR 2158 Sec-def data farm connection is OK:secdefhk
2024-11-27 19:23:05.387361 ERROR 2103 Market data farm connection is broken:hfarm
2024-11-27 19:23:06.315837 ERROR 2104 Market data farm connection is OK:hfarm
?
I was requesting reqRealTimeBars and no data received after Nov 27 12:17, I did not use docker or IBC and no disconnecting / cancel subscription logic.
?
Any thoughts?


Re: No real-time data after IB nightly server reset

 

Hi?闯ü谤驳别苍?,
?
I encountered the same issue and still no market data after the connection was restored.
?
Followings are my logs
?
2024-11-27 12:15:54.656112 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:15:55.257818 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:06.239496 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:12.080815 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:16.738522 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:21.150339 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:31.521287 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:42.307221 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:16:56.400287 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:17:12.772813 ERROR 1100 Connectivity between IBKR and Trader Workstation has been lost.
2024-11-27 12:17:38.175326 ERROR 2105 HMDS data farm connection is broken:ushmds
2024-11-27 12:17:38.312416 ERROR 2106 HMDS data farm connection is OK:apachmds
2024-11-27 12:18:08.178669 ERROR 1102 Connectivity between IBKR and Trader Workstation has been restored - data maintained. The following farms are connected: hfarm; apachmds; secdefhk. The following farms are not connected: ushmds.
2024-11-27 15:30:47.702324 ERROR 2157 Sec-def data farm connection is broken:secdefhk
2024-11-27 15:30:48.190508 ERROR 2158 Sec-def data farm connection is OK:secdefhk
2024-11-27 15:45:17.419716 ERROR 2157 Sec-def data farm connection is broken:secdefhk
2024-11-27 15:45:21.453034 ERROR 2158 Sec-def data farm connection is OK:secdefhk
2024-11-27 19:23:05.387361 ERROR 2103 Market data farm connection is broken:hfarm
2024-11-27 19:23:06.315837 ERROR 2104 Market data farm connection is OK:hfarm
?
I was requesting reqRealTimeBars and no data received after Nov 27 12:17, I did not use docker or IBC and no disconnecting / cancel subscription logic.
?
Any thoughts?