diff --git a/vn.demo/ctpdemo/demoApi.py b/vn.demo/ctpdemo/demoApi.py index 032070a7..fddcfb52 100644 --- a/vn.demo/ctpdemo/demoApi.py +++ b/vn.demo/ctpdemo/demoApi.py @@ -477,12 +477,13 @@ class DemoTdApi(TdApi): #---------------------------------------------------------------------- def onRspQrySettlementInfo(self, data, error, n, last): """查询结算信息回报""" - event = Event(type_=EVENT_LOG) - log = u'结算信息查询完成' - event.dict_['log'] = log - self.__eventEngine.put(event) - - self.confirmSettlement() # 查询完成后立即确认结算信息 + if last: + event = Event(type_=EVENT_LOG) + log = u'结算信息查询完成' + event.dict_['log'] = log + self.__eventEngine.put(event) + + self.confirmSettlement() # 查询完成后立即确认结算信息 #---------------------------------------------------------------------- def onRspQryTransferBank(self, data, error, n, last): diff --git a/vn.strategy/strategydemo/demoApi.py b/vn.strategy/strategydemo/demoApi.py index 032070a7..fddcfb52 100644 --- a/vn.strategy/strategydemo/demoApi.py +++ b/vn.strategy/strategydemo/demoApi.py @@ -477,12 +477,13 @@ class DemoTdApi(TdApi): #---------------------------------------------------------------------- def onRspQrySettlementInfo(self, data, error, n, last): """查询结算信息回报""" - event = Event(type_=EVENT_LOG) - log = u'结算信息查询完成' - event.dict_['log'] = log - self.__eventEngine.put(event) - - self.confirmSettlement() # 查询完成后立即确认结算信息 + if last: + event = Event(type_=EVENT_LOG) + log = u'结算信息查询完成' + event.dict_['log'] = log + self.__eventEngine.put(event) + + self.confirmSettlement() # 查询完成后立即确认结算信息 #---------------------------------------------------------------------- def onRspQryTransferBank(self, data, error, n, last):