self.trade.insertOrder(instrumentId, "SELL", "CLOSE", position.pos,quote. bid_price1 - quote.price_tick * 5) if position.pos == 0 and orderNum != 0: order = self.trade.insertOrder(instrumentId, "SELL", "OPEN", orderNum, quote.bid_price1 - quote.price_tick * 5)
我先平仓,再开仓,下单之前要检测,是否平掉。但是因为是异步,所以无法在请求平仓之后,立即获取到持仓信息。我该如何阻塞,一直等到持仓为0.