简体   繁体   中英

Problem with backtrader live Gold (XAUUSD) data from IB (Interactive Brokers)

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)

I follow the instruction in: 在此处输入图像描述

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM