I am trying IB very the first time. I am trying to fetch historical data of $EUR but I am getting an error:
Error 162, reqId 3: Historical Market Data Service error message:No historical market data for EUR/CASH@FXSUBPIP Last 1800, contract: Contract(secType='CASH', symbol='EUR', exchange='IDEALPRO', currency='USD')
Below is my code:
import datetime
from ib_insync import *
if __name__ == '__main__':
ib = IB()
r = ib.connect('127.0.0.1', port=7497, clientId=1)
contract = Contract()
contract.symbol = "EUR"
contract.secType = "CASH"
contract.currency = "USD"
contract.exchange = "IDEALPRO"
data = ib.reqHistoricalData(
contract=contract,
endDateTime='',
durationStr='100 D',
barSizeSetting='30 mins',
useRTH=True,
whatToShow='ADJUSTED_LAST'
)