set trading code history data to config(策略执行时使用配置数量的历史数据)
This commit is contained in:
@@ -708,7 +708,7 @@ class TradingExecutor:
|
|||||||
# 2. 检查是否需要更新K线(每个K线周期更新一次,从API拉取)
|
# 2. 检查是否需要更新K线(每个K线周期更新一次,从API拉取)
|
||||||
# ============================================
|
# ============================================
|
||||||
if current_time - last_kline_update_time >= kline_update_interval:
|
if current_time - last_kline_update_time >= kline_update_interval:
|
||||||
klines = self._fetch_latest_kline(symbol, timeframe, limit=500)
|
klines = self._fetch_latest_kline(symbol, timeframe, limit=history_limit)
|
||||||
if klines and len(klines) >= 2:
|
if klines and len(klines) >= 2:
|
||||||
df = self._klines_to_dataframe(klines)
|
df = self._klines_to_dataframe(klines)
|
||||||
if len(df) > 0:
|
if len(df) > 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user