From f25b2ebbe37105b91870ea23fba63e150dfa9624 Mon Sep 17 00:00:00 2001 From: guopengfa Date: Fri, 16 Jan 2026 13:28:26 +0800 Subject: [PATCH] =?UTF-8?q?add=20config:=20get=20strategy=20history=20limi?= =?UTF-8?q?t.=EF=BC=88=E7=AD=96=E7=95=A5=E4=B8=AD=E7=9A=84=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E8=8E=B7=E5=8F=96ticket=E6=95=B0=E9=87=8F=E5=8F=AF?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=BD=93=E7=AD=96=E7=95=A5=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E4=BA=8E=E5=88=86=E9=92=9F=E7=BA=BF=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99500=E6=9D=A1=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=98=AF=E4=B8=8D=E5=A4=9F=E7=9A=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend_api_python/app/services/trading_executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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")