from tqsdk import TqApi, TqAuth

api = TqApi(auth=TqAuth("emanresu", "dfgvfgdfgg"))

# au 品种指数合约
ls = api.query_quotes(ins_class="INDEX", product_id="au")
print(ls)

# au 品种主连合约
ls = api.query_quotes(ins_class="CONT", product_id="au")
print(ls)

quote = api.get_quote("KQ.m@SHFE.rb")
# 打印现在螺纹钢主连的标的合约
print(quote.underlying_symbol)

# 关闭api,释放相应资源
api.close()