from tqsdk import TqApi, TqAccount, TqSim
api = TqApi(TqSim())
symbol = “DCE.i2009” # 合约代码
position = api.get_position(symbol) # 持仓信息
print(“多开均价: %.2f” % (position.open_price_long))
AttributeError: ‘Entity’ object has no attribute ‘open_price_long’
https://doc.shinnytech.com/pysdk/latest/reference/tqsdk.objs.html?highlight=position%20open_price_long#tqsdk.objs.Position.open_price_long
west 已回答的问题 2020年5月14日