perf: 6项性能与正确性优化
1. get_stock_name: 延迟批量保存缓存(60秒去抖),避免每次新缓存都写文件 2. get_stock_name: 优先从DB stock_realtime_price查name,未命中再调腾讯API 3. compute_comprehensive_score: 单股模式也使用_fund_flow_cache(30分钟TTL) 4. _get_kline_from_local_db: 移除conn.autocommit=True,避免污染连接池事务模式 5. deep_analyze: K线天数从180改为120,与实时检测统一 6. detect_all_signals: 已有指标列时跳过重复calc_all_indicators
This commit is contained in:
@@ -340,7 +340,9 @@ def detect_all_signals(df, lookback=5):
|
||||
if not np.issubdtype(df[col].dtype, np.floating):
|
||||
df[col] = pd.to_numeric(df[col], errors='coerce').fillna(0).astype(np.float64)
|
||||
|
||||
df = calc_all_indicators(df)
|
||||
# 若已有指标列则跳过重复计算(deep_analyze 等场景预计算过)
|
||||
if 'dif' not in df.columns or 'ma5' not in df.columns:
|
||||
df = calc_all_indicators(df)
|
||||
|
||||
all_signals = []
|
||||
all_signals.extend(detect_main_rising_wave(df, lookback))
|
||||
|
||||
Reference in New Issue
Block a user