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
By
Jürgen Reinold
·
#53570
·
|
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
By
Andy Sanders
·
#53569
·
|
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
By
Jürgen Reinold
·
#53568
·
|
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 =
By
Andy Sanders
·
#53567
·
|
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.
https://www.mql5.com/ru/forum/37666#comment_1179929
Average opening price: (
By
Andy Sanders
·
#53566
·
|
Re: TWS API Stopped accepting incoming connections sometimes
Please see the other thread: ?/g/twsapi/topic/107684402
The same issue is being mentioned there.
By
J G
·
#53565
·
|
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
By
xb
·
#53564
·
|
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
By
J G
·
#53563
·
|
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
By
ds-avatar
·
#53562
·
|
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
By
Jürgen Reinold
·
#53561
·
|
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
By
Jürgen Reinold
·
#53560
·
|
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
-
By
Andy Sanders
·
#53559
·
|
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
By
bespalex
·
#53558
·
|
Re: No real-time data after IB nightly server reset
Hi Jürgen,
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:
By
xb
·
#53557
·
|
Re: No real-time data after IB nightly server reset
Hi Jürgen ,
T he 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
By
xb
·
#53556
·
|
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
By
Jürgen Reinold
·
#53555
·
|
Re: No real-time data after IB nightly server reset
Hi Jürgen ,
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
By
xb
·
#53554
·
|
Re: Best practice for cancelmktdata
I think that given the large number of market data streams you have running, this might just be caused by your application not keeping up with the market data events. If you’re processing several
By
Richard L King
·
#53552
·
|
Re: Best practice for cancelmktdata
interesting, In my case I need the cancelmktdata in case I run to Error 300, too many instruments subscribed. My experience is that in lag between cancelmktdata and IBKR cancelling the mktdata is that
By
H Liu
·
#53551
·
|
Re: Best practice for cancelmktdata
I think JG is correct. You are likely bumping at the 50 requests/sec API limit when you cancel 300 market data feeds.
Traditionally, TWS/IBGW did reject requests at rates of more them 50/sec with an
By
Jürgen Reinold
·
#53550
·
|