feat(ECR-009): Crypto Wyckoff Screener 独立页(D/W/M)
移植 A_Share_DP 引擎;本地缓存与 60s tip;月线由日线 UTC 聚合;不碰主站 analyze/缠论叠层。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
"""Signal Engine — timeframe-local status labels only (not tradability)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from crypto_wyckoff.domain_models import EngineResult, WyckoffEvent
|
||||
|
||||
|
||||
class SignalEngine:
|
||||
"""Maps local Event/Phase into a status label. Decision decides tradability."""
|
||||
|
||||
name = "Signal"
|
||||
version = "1.0.0"
|
||||
|
||||
def run(self, event: EngineResult, phase: EngineResult | None = None) -> EngineResult:
|
||||
current = event.payload.get("current_event", WyckoffEvent.NONE.value)
|
||||
conf = event.confidence
|
||||
label = current # status label mirrors event for V1
|
||||
reasons = [f"本地事件标签: {label}"]
|
||||
if phase and phase.payload.get("phase"):
|
||||
reasons.append(f"本地阶段: {phase.payload.get('phase')}")
|
||||
|
||||
return EngineResult(
|
||||
name=self.name,
|
||||
version=self.version,
|
||||
confidence=conf,
|
||||
score=event.score,
|
||||
reasons=reasons,
|
||||
payload={
|
||||
"signal_label": label,
|
||||
"current_event": current,
|
||||
"phase": (phase.payload.get("phase") if phase else None),
|
||||
"active_events": event.payload.get("active_events")
|
||||
or event.payload.get("recent_events", []),
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user