current > MA20 → 진입가=max(MA20, 최근 저점), “눌림목(되돌림) 대기”.
강세(종합 ≥ 0.5) → timing 접두사 “강세 —”.
의존
선행: Phase 2 시그널 완료
후행: STK3-04
다이어그램
처리 흐름
sequenceDiagram
participant R as recommendation.py
R->>R: suggest_entry(signal)
alt current ≤ MA20
Note over R: entry_price = current
Note over R: timing = "즉시 분할 매수 고려"
else current > MA20
Note over R: entry_price = max(MA20, recent_low)
Note over R: timing = "눌림목(되돌림) 대기"
end
alt composite ≥ 0.5 (강세)
Note over R: timing = "강세 — " + timing
end
R-->>R: EntryProposal(entry_price, timing, basis)
클래스 의존
flowchart LR
subgraph Application["Application"]
main["main.py\n(라우터)"]
end
subgraph Domain["ML 도메인"]
rec["recommendation.py\nsuggest_entry()"]
rank["rank_recommendations()"]
end
main --> rank
main --> rec
테스트 케이스
current ≤ MA20이면 진입가가 현재가로 설정되고 “즉시 분할 매수 고려”가 반환된다.
current > MA20이면 진입가가 max(MA20, recent_low)로 설정되고 “눌림목(되돌림) 대기”가 반환된다.
composite ≥ 0.5이면 timing 앞에 “강세 — ” 접두사가 붙는다.
composite < 0.5이고 current > MA20이면 강세 접두사 없이 “눌림목(되돌림) 대기”만 반환된다.