完善日志系统
This commit is contained in:
+6
-5
@@ -94,7 +94,7 @@ class QmtV(XtQuantTraderCallback):
|
||||
|
||||
def dailyUpStop(self, stock_code:str):
|
||||
cacheStock = self.cacheStockDetail(stock_code)
|
||||
PrintLog(LogLevel.INFO, f'- [成功]获取股票详情: {stock_code} {cacheStock["InstrumentName"]} {cacheStock['UpStopPrice']}')
|
||||
PrintLog(LogLevel.INFO, f'- [成功]获取股票详情: {stock_code} {cacheStock["InstrumentName"]} {cacheStock["UpStopPrice"]}')
|
||||
return cacheStock['UpStopPrice']
|
||||
|
||||
def dailyDownStop(self, stock_code:str):
|
||||
@@ -134,10 +134,11 @@ class QmtV(XtQuantTraderCallback):
|
||||
tmpMarketStatus = self.isMarketActive
|
||||
PrintLog(LogLevel.INFO, f'- [市场状态变更] {self.isMarketActive}')
|
||||
eBus.event_bus.publish(eBus.EventMarketActiveSwitch, self.isMarketActive)
|
||||
if tmpMarketStatus and self.isMarketActive:
|
||||
if tmpTime - self.lastMarketDataUpdateTimestamp > 10: # 上次更新市场状态已经超过10秒
|
||||
self.isMarketActive = False
|
||||
PrintLog(LogLevel.INFO, f'- [市场状态] {self.isMarketActive}') # 市场已 inactive
|
||||
if tmpMarketStatus and self.isMarketActive and tmpTime - self.lastMarketDataUpdateTimestamp > 10: # 上次更新市场状态已经超过10秒
|
||||
self.isMarketActive = False
|
||||
PrintLog(LogLevel.INFO, f'- [市场状态变更] {self.isMarketActive}')
|
||||
|
||||
PrintLog(LogLevel.DEBUG, f'- [市场状态] {self.isMarketActive}') # 市场已 inactive
|
||||
|
||||
|
||||
# ====== 市场回调方法 -- 以下方法由XtQuantTrader调用 ======
|
||||
|
||||
Reference in New Issue
Block a user