OUTSTANDING thank you so much ´³¨¹°ù²µ±ð²Ô.
The error callbacks you have encountered over time is something
that will save me a lot of time.? The data started flowing again
this morning of it's own volition BUT it DID motivate me
to go back and harden my approach. Before I was just HOPING that
all would go well :-) sheer laziness on my part. One of the
excellent things about julia is the modularity that is built into
it. I have NO excuses.
Thank you for the guidance as to contract object construction, I
like that approach and will adopt it. I completely forgot that IB
returns so much in that exchange, VERY useful in the times ahead
in 2023.
I get auto updates on the TWS api because I use a laptop with TWS
desktop running. I do this to keep an eye on the markets and make
sure I track the DATA flow. I also have a raspberry pi tracking
the isp just in case of problems.? This takes care of the packing
issues as I am on 10.20.
I've had my own version of a data monitor running using arrays
which populate dataframes. 2023 will allow me to create a realtime
Pluto notebook which gives me control over the data representation
using tufte concepts.
This whole issue was caused by my laziness and sheer luck. I've
already got logging working ( took 10 minutes) and your error list
has stimulated me to create an error handling function so I can
standardize all levels of problem.
Thanks again for 2022 and you have done an EXCELLENT job on the
forum. Happy holidays to you and all your clan.
dent
On 12/22/22 12:31, ´³¨¹°ù²µ±ð²Ô Reinold via
groups.io wrote:
toggle quoted message
Show quoted text
The approach you describe sounds reasonable and seems to have
worked for you for a while. But there are a few details that
come to mind that make the process more robust and tolerant of
changes by IBKR. Not sure whether any of these fix your problem,
but I am sure they will prevent issues in the future.
We have a data monitor that subscribes to all available
reqMktData ticks for about 80 instruments plus 15 TickByTick
streams (TickByTickLast, TickByTickBidAsk, and TickByTickMid
each for five instruments) plus three Level II market book
streams and is rock stable.
During startup, we use
to retrieve a contract object for each instrument instead of
making our own contract objects. This way you get the most
up-to-date instrument details and a contract object that has all
fields initialized. You also get the trading hours for the next
few days including short-notice changes caused by holidays or
issues at the exchange. And any contract related errors (such as
de-listed instruments, exchange changes, expired futures
contracts, ...) are flagged well before you subscribe to market
data.
The loop that runs the reqMktData subscription calls needs to
make sure that it does not cause API packing violations (more
than 50 requests per second). Pacing violations will cause
disconnects by TWS/IBGW.
For TWS/IBGW versions before V10 you have two options:
- Manage appropriate delays between back-to-back reqMktData
calls
- Set the "+PACEAPI" connection option so that TWS/IBGW handle
pacing for you
TWS/IBGW V10 have "+PACEAPI" enabled by default so this is less
of an issue, but make sure the API global configuration "Reject
messages above maximum allowed message rate" in TWS/IBGW is not
selected.
And finally, make sure you catch all error callbacks and, at a
minimum, log them to aid in troubleshooting. Errors our monitor
has encountered while subscribing to the various market data
streams include:
- 309??? Max number (3) of market depth requests has been
reached
- 321??? Error validating request.-'bX' : cause - Incorrect
generic tick list ...
- 354??? Requested market data is not subscribed.Delayed
market data is available.
- 2117??? Requested top market data is not subscribed.
- 10090??? Part of requested market data is not subscribed.
Subscription-independent ticks are still active.
- 10168??? Requested market data is not subscribed. Delayed
market data is not enabled
- 10189??? Failed to request tick-by-tick data:No market data
permissions for ...
- 10190??? Max number of tick-by-tick requests has been
reached
- 10197??? No market data during competing live session
- 10225??? Bust event occurred, current subscription is
deactivated. Please resubscribe real-time bars immediately.
There is a lot that can change without notice or go wrong.
Hope this helps,
´³¨¹°ù²µ±ð²Ô