完成预下单优化
This commit is contained in:
@@ -119,19 +119,16 @@ class QmtV(XtQuantTraderCallback):
|
||||
# ====== 市场回调方法 -- 以下方法由XtQuantData调用 ======
|
||||
def onDataUpdate(self, data):
|
||||
# 收集所有市场数据用于市场监控
|
||||
PrintLog(LogLevel.INFO, f'- [市场数据更新] {len(data)}')
|
||||
eBus.event_bus.publish(eBus.MarketDataUpdate, data)
|
||||
now = time.time()
|
||||
if now - self.lastMarketDataUpdateTimestamp < 5:
|
||||
self.isMarketActive = True
|
||||
PrintLog(LogLevel.INFO, f'- [市场状态变更] 市场已 Active') # 市场已 inactive
|
||||
self.lastMarketDataUpdateTimestamp = now
|
||||
|
||||
def marketStatusNotifier(self):
|
||||
# 市场状态通知器
|
||||
tmpMarketStatus = False
|
||||
while True:
|
||||
PrintLog(LogLevel.INFO, f'- [市场状态检查器] {self.isMarketActive}')
|
||||
tmpTime = time.time()
|
||||
time.sleep(10)
|
||||
if tmpMarketStatus != self.isMarketActive and tmpTime - self.lastMarketDataUpdateTimestamp < 5:
|
||||
|
||||
Reference in New Issue
Block a user