¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Historical Market Data Service error


 

def get_historical_data(contract):
ib = IB()
ib.connect('127.0.0.1', 4002, clientId=1)

bars = ib.reqHistoricalData(
contract,
endDateTime='',
durationStr='30 D',
barSizeSetting='1 min',
whatToShow='TRADES',
useRTH=False,
formatDate=1
)

nq_contract = Contract(
symbol="NQ",
secType="FUT",
exchange="CME",
currency="USD",
lastTradeDateOrContractMonth="20230915"
)

Error 162, reqId 3: Historical Market Data Service error message:No market data permissions for CME FUT, contract: Contract(secType='FUT', symbol='NQ', lastTradeDateOrContractMonth='20230915', exchange='CME', currency='USD')

when i run the code i get this error although i am subscribed to "
CME Futures Level 1 for Display on Trading Platform. Examples - ES, NQ and HE"

not sure what is causing the issue, any help would be much appreciated!

Join [email protected] to automatically receive all group messages.