Backtrader works fine with live data of IB (Interactive Brokers) through TWS, but when I want to trade on gold commodity (XAUUSD), it cannot receive the data. the python code is:
data = store.getdata(dataname='XAUUSD', sectype='CMDTY', exchange='SMART', timeframe=bt.TimeFrame.Minutes)
Spot Gold (symbol XAUUSD) is a commodities product offered by IB to trade gold in the OTC London metals market.
Most probably you want to trade CFD with the same symbol. In this case use sectype='CFD'
and exchange='IBCFD'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.