diff --git a/backend_api_python/app/services/trading_executor.py b/backend_api_python/app/services/trading_executor.py index 1acbc1f..a663c39 100644 --- a/backend_api_python/app/services/trading_executor.py +++ b/backend_api_python/app/services/trading_executor.py @@ -591,7 +591,7 @@ class TradingExecutor: # 初始化阶段:获取历史K线并计算指标 # ============================================ # logger.info(f"策略 {strategy_id} 初始化:获取历史K线数据...") - history_limit = os.getenv('K_LINE_HISTORY_GET_NUMBER', 500) + history_limit = int(os.getenv('K_LINE_HISTORY_GET_NUMBER', 500)) klines = self._fetch_latest_kline(symbol, timeframe, limit=history_limit) if not klines or len(klines) < 2: logger.error(f"Strategy {strategy_id} failed to fetch K-lines")