Hello,
I am trying to download historical data for a universe of US stocks and ETFs.
I have code that creates a new contract and downloads the historical data. When I set the "contract.Exchange" variable to "SMART" everything runs fine. The issue is that I am trying to download data only from the primary exchange each stock is listed on (for a variety of reasons). This *also* works just fine for stocks listed on NYSE. But for stocks listed on NASDAQ (i.e., setting contract.Exchange = "NASDAQ") I receive an "ERROR 1 200 No security definition has been found for the request".?
Could someone suggest why this might be happening? Is "NASDAQ" not the correct string for this exchange??
I'm primarily working in ib_insync API, but I've also written a demo in the native Python IBKR API that also reproduces the issue on my system:?
[MODERATOR: Code reduced to essential lines for the issue]
toggle quoted message
Show quoted text
#Create contract object
contract = Contract()
contract.symbol = 'AMD' #'KAR' #'AAPL'
contract.secType = 'STK'
contract.exchange = 'NASDAQ'# 'SMART' # 'NASDAQ'# 'SMART'
contract.currency = 'USD'
?
#Request historical candles
app.reqHistoricalData(1, contract, '', '10 D', '1 day', 'BID', 0, 2, False, [])
?
?