Closed dsoong1 closed 5 years ago
error retrieving FX cash historical data (i.e. EUR.USD). Interactive Brokers does not disseminate TRADES data for cash FX. You need to use a different value for whatToShow than the default.
solution:
def requestHistoricalData(...): self.ibConn.reqHistoricalData( tickerId = tickerId, contract = contract, endDateTime = end_datetime, durationStr = lookback, barSizeSetting = resolution, whatToShow = data, <<<<< useRTH = int(rth), formatDate = int(format_date) )
if contract.m_secType in ['CASH', 'CFD'], then override whatToShow=="MIDPOINT" or "BID" or "ASK", instead of "TRADES"
The parameter data is changeable... Just use:
data
ibConn.requestHistoricalData(..., data='MIDPOINT')
That being said, I've updated the method to default to MIDPOINT when requesting data for CASH/CFD.
error retrieving FX cash historical data (i.e. EUR.USD). Interactive Brokers does not disseminate TRADES data for cash FX. You need to use a different value for whatToShow than the default.
solution:
if contract.m_secType in ['CASH', 'CFD'], then override whatToShow=="MIDPOINT" or "BID" or "ASK", instead of "TRADES"