ib_insync icon indicating copy to clipboard operation
ib_insync copied to clipboard

Stream Live News

Open NimaMPH opened this issue 2 years ago • 0 comments

I am trying to start streaming live news but it seems that there is no genericTickList that provides it. I got f"mdoff,292:{provider_codes}" from IBKR API document but it does not work and the ticker does not have news data:

Get live news data for each symbol

for contract in settings.contracts_list: symbol = contract.symbol

# Request live news data for each contract
ticker_live_news = ib_obj.reqMktData(
                                   contract           = contract,
                                   genericTickList    = f"mdoff,292:{provider_codes}",
                                   snapshot           = False,
                                   regulatorySnapshot = False
                                   )

# Confirm live news data is streaming for the symbol
print(f"{symbol} Live News Data Streaming Started!")
print(ticker_live_news)

# Call on_live_news_data_update_func if there is new data
ticker_live_news.updateEvent += on_live_news_data_update_func

NimaMPH avatar Feb 21 '24 19:02 NimaMPH