请问下怎么判断主力合约到期,如何移仓?
首先主力合约是我们自己定义的,可以先订阅主连,再获取主连的quote里的underlying_symbol字段。
第二个办法是用query函数:https://doc.shinnytech.com/tqsdk/latest/reference/tqsdk.api.html?highlight=query#tqsdk.TqApi.query_cont_quotes
移仓换月函数没有的