feat(stock): market_events (급변·거래량Z·외인순매도)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 22:02:10 +09:00
parent c756b20c77
commit 241c24943f
2 changed files with 63 additions and 0 deletions

View File

@@ -188,3 +188,18 @@ def test_technical_posture_empty_kospi_not_penalized():
scores = hi.technical_posture(ctx, ["005930"])
# ma_alignment+momentum만으로 정규화 → 상승추세면 충분히 높은 점수
assert scores["005930"] > 50.0
# ---- Phase 3 tests ----
DEFAULT_EVENT = {"move_pct": 7.0, "vol_z": 2.5}
def test_market_events_detects_move_and_volume():
closes = [1000]*30 + [1100] # 마지막날 +10%
vols = [1000]*30 + [10000] # 거래량 급증
df = _ticker_prices(closes, vols)
evts = hi.market_events("005930", df, None, DEFAULT_EVENT)
types = {e["type"] for e in evts}
assert "price_move" in types
assert "volume_surge" in types