完成预下单优化

This commit is contained in:
2025-11-19 10:29:58 +08:00
parent d5fef7c0c1
commit 0262bfc71b
3 changed files with 58 additions and 44 deletions
-3
View File
@@ -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: