Files
Chan/chan/indicators/attach.py
T
PorterandCursor 2c1232555e refactor: 缠论引擎迁入 chan/ 分层解耦,指标外置
将核心结构、指标与分析拆到 chan/{core,indicators,analysis,pipeline};
根目录保留兼容 shim;strategies 改为从 chan 包导入;买卖点经 bsp_macd 与 MACD 接合。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 14:47:13 +08:00

21 lines
647 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""过渡期:把 IndicatorStore 挂到 KLU 属性上,兼容旧代码读取 klu.ema52 等。"""
from __future__ import annotations
from typing import Iterable
from .store import IndicatorStore
def attach_indicators_for_compat(klu_list: Iterable, store: IndicatorStore) -> None:
"""将指标写入 KLUdeprecated:新代码应通过 store.get(idx, name) 查询)。"""
for klu in klu_list:
idx = getattr(klu, "idx", None)
if idx is None:
continue
row = store.row(idx)
if row is None:
continue
if hasattr(klu, "set_indicators"):
klu.set_indicators(row)