Been stuck on this for a while. All future market data permissions are enabled on our account, however when I try request historical bar data for the current futures contract for MES I get Market Data Service error message:No market data permissions for GLOBEX FUT
.
contract = Contract()
contract.m_symbol = "MES"
contract.m_secType = "FUT"
contract.m_exchange = "GLOBEX"
contract.m_currency = "USD"
contract.m_expiry = "20200918"
contract.m_includeExpired = True
contract.m_multiplier = "5"
tws.reqMarketDataType(3)
tws.reqMktData(897,contract,"",False)
Result (works fine):
<tickPrice tickerId=897, field=67, price=3083.5, canAutoExecute=-1> <tickPrice tickerId=897, field=68, price=3083.25, canAutoExecute=0> <tickPrice tickerId=897, field=72, price=3096.75, canAutoExecute=0> <tickPrice tickerId=897, field=73, price=3027.5, canAutoExecute=0> <tickPrice tickerId=897, field=75, price=3059.5, canAutoExecute=0> <tickPrice tickerId=897, field=76, price=3043.0, canAutoExecute=0>
However when I try for historical data with the same contract:
contract = Contract()
contract.m_symbol = "MES"
contract.m_secType = "FUT"
contract.m_exchange = "GLOBEX"
contract.m_currency = "USD"
contract.m_expiry = "20200918"
contract.m_includeExpired = True
contract.m_multiplier = "5"
tws.reqMarketDataType(3)
tws.reqHistoricalData(50, contract=contract, endDateTime=strftime("%Y%m%d %H:%M:%S"), durationStr ="30 D", barSizeSetting = "1 day", whatToShow="TRADES", formatDate=1, useRTH= "1")
I get the message from IB:
Historical Market Data Service error message:No market data permissions for GLOBEX FUT
Am I doing anything clearly wrong? I'm using IBPY2