Revert: BSP独立跟踪confirmed[-1],不与中枢监控耦合
B1/B2依赖中枢存在,不能等中枢更新才查BSP。 保持独立bi_id跟踪confirmed[-1]变化,分型确认时即查BSP。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
63787b173a
commit
a84a80cb62
+6
-6
@@ -52,7 +52,7 @@ def _bi_id(bi) -> Optional[tuple]:
|
|||||||
class SymbolState:
|
class SymbolState:
|
||||||
symbol: str
|
symbol: str
|
||||||
pivot_monitor: ChanPivotMonitor = field(default_factory=ChanPivotMonitor)
|
pivot_monitor: ChanPivotMonitor = field(default_factory=ChanPivotMonitor)
|
||||||
last_bi_id: Optional[tuple] = None # 上次检查过的最后一笔 ID
|
last_bi_id: Optional[tuple] = None # 上次检查过的最后一笔确认 ID
|
||||||
last_df_ts: object = None # 最新已处理的 K 线时间戳
|
last_df_ts: object = None # 最新已处理的 K 线时间戳
|
||||||
first_run: bool = True
|
first_run: bool = True
|
||||||
|
|
||||||
@@ -145,11 +145,11 @@ class BSPMonitor:
|
|||||||
# 7. 检查刚被分型确认这笔的终点是否为 BSP
|
# 7. 检查刚被分型确认这笔的终点是否为 BSP
|
||||||
bsp = engine.get_bsp_for_bi(last_confirmed)
|
bsp = engine.get_bsp_for_bi(last_confirmed)
|
||||||
if bsp:
|
if bsp:
|
||||||
key = f"{symbol}_{bsp.type}_{bsp.klc.end_time}"
|
key = f"{symbol}_{bsp.type}_{bsp.klc.end_time}"
|
||||||
msg = engine.format_bsp_detail(bsp, symbol)
|
msg = engine.format_bsp_detail(bsp, symbol)
|
||||||
msg = _escape_html(msg)
|
msg = _escape_html(msg)
|
||||||
if send_bsp_alert(msg, bsp_key=key):
|
if send_bsp_alert(msg, bsp_key=key):
|
||||||
logger.info(f"[{name}] ✅ BSP: {key}")
|
logger.info(f"[{name}] ✅ BSP: {key}")
|
||||||
|
|
||||||
# 8. 中枢特征更新
|
# 8. 中枢特征更新
|
||||||
pivot_state = st.pivot_monitor.update(engine.bi_zs_list)
|
pivot_state = st.pivot_monitor.update(engine.bi_zs_list)
|
||||||
|
|||||||
Reference in New Issue
Block a user