diff --git a/src/simulation/simulation_trader.py b/src/simulation/simulation_trader.py index a7c0482..738ddbb 100644 --- a/src/simulation/simulation_trader.py +++ b/src/simulation/simulation_trader.py @@ -184,3 +184,7 @@ class SimulationTrader(BaseTrader): "strategy_name": order_info.strategy_name, } return None + + def is_trading_time(self): + return True + diff --git a/src/trade_server.py b/src/trade_server.py index 5f294d4..529d745 100644 --- a/src/trade_server.py +++ b/src/trade_server.py @@ -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}" )