Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Starting and stopping market data using ticker object
Hi all,
First thanks for resurrecting the forum following Ewald's sad passing. He was very kind and helpful to me when i was getting my head around Insync.
?
My problem now though is that I need to both start streaming a ticker, and also to stop it later.
?
I can start it no problem:
?
? ? stock_symbols = ['SPY', 'AAPL'],
? ? stocks = [Stock(symbol, 'SMART', 'USD') for symbol in stock_symbols]
? ? for stock in stocks:
? ? ? ? ib.qualifyContracts(*stocks)
? ? ? ? ticker = ib.reqMktData(stock, '', False, False)
?
..but have been unable to selectively cancel a ticker, ie cancel AAPL and keep SPY streaming. This seems to be because there is no reqID fround to identify the tickers.
?
Any help would be much appreciated.
Thanks
Dan |
Dan, I use this. I don't know 100% if it works as I didn't bother to test since it was not mission critical for my use case: def req_market_data_initial_contracts(previous_options_contracts=None): And then when I need to cancel any of these: ? ? ? for contract_item in previous_options_contrs: On Wed, Aug 21, 2024 at 12:30?PM Daniel Stewart via <danieljstewart=hotmail.com@groups.io> wrote:
|
to navigate to use esc to dismiss