fix: no is_trading_hours in simulation trader

This commit is contained in:
zhiyong 2025-05-10 22:37:31 +08:00
parent e818699c13
commit 28de80a779
2 changed files with 5 additions and 1 deletions

View File

@ -184,3 +184,7 @@ class SimulationTrader(BaseTrader):
"strategy_name": order_info.strategy_name,
}
return None
def is_trading_time(self):
return True

View File

@ -134,7 +134,7 @@ def buy():
raise ValueError("Price and amount must be positive")
# 检查是否在交易时间内
if not get_trader().is_trading_hours():
if not get_trader().is_trading_time():
logger.warning(
f"交易失败 - 非交易时间不能交易 - 代码: {code}, 价格: {price}, 数量: {amount}"
)