取行情数据的时候设为“KQ.m@xxx.xx”的主连,请问能够直接下单吗?主连能否自动和当前主力合约直接建立映射关系?
使用主连时,使用underlying_symbol即可
参考文档:https://doc.shinnytech.com/pysdk/latest/reference/tqsdk.objs.html?highlight=quote#tqsdk.objs.Quote.underlying_symbol
quote = api.get_quote("主连") 主力合约 = quote.underlying_symbol