quantrocket-llc/ibpythonic

CAN NOT GET CFD historicalData

Opened this issue · 0 comments

#!/usr/bin/env python

-- coding:utf-8 --

from ibpythonic import ibConnection, message
from ibapi.contract import Contract
from datetime import datetime , timedelta

! [cfdcontract]

contract = Contract()
contract.symbol = "IBDE30"
contract.secType = "CFD"
contract.currency = "EUR"
contract.exchange = "SMART"

! [cfdcontract]

def processHistoricalData(msg):
print(msg)
conn = ibConnection(port=4002, clientId=0)
conn.register(processHistoricalData, message.historicalData)
conn.connect()
conn.reqContractDetails(1, contract)
queryTime = datetime.today().strftime("%Y%m%d %H:%M:%S")
conn.reqHistoricalData(4101, contract, queryTime,"1 M", "1 day", "TRADES", 1, 1, False, [])

conn.disconnect()

==================================================
it says:
No historical market data for IBDE30/CFD@UKBBO Last 1d-

but the same contract use the offical api, it gets well.
can anyone help me?