fix(trade-monitor): sell_climax holdings_intel 정합
BE 회신(holdings_intel.py:109-118)에 맞춰 반전 기준을 price<day_open → price<day_high×climax_close_pct(윗꼬리)로 변경. - kis_client.get_quote에 day_high(stck_hgpr) 추가 - monitor._build_ctx가 day_high를 ctx로 전달 - climax_vol_x·climax_close_pct를 monitor-set exit_params에서 읽기 (fallback: TM_CLIMAX_VOL_MULT/0.97) - 테스트 36/36 (climax exit_params 2건 추가) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N83vbXEA8h83GMXQcg8fxD
This commit is contained in:
@@ -59,7 +59,6 @@ def evaluate_sell(ctx: dict, params: dict) -> list[dict]:
|
||||
stop = params.get("stop_pct", 0.08)
|
||||
take = params.get("take_pct", 0.25)
|
||||
trail = params.get("trailing_pct", 0.10)
|
||||
climax_mult = ctx.get("climax_vol_mult", 3.0)
|
||||
firing: list[dict] = []
|
||||
|
||||
if avg:
|
||||
@@ -84,12 +83,17 @@ def evaluate_sell(ctx: dict, params: dict) -> list[dict]:
|
||||
"ma200": round(ma200, 1) if ma200 else None,
|
||||
"severity": severity}))
|
||||
|
||||
# sell_climax — 휴리스틱(추후 holdings_intel 정합): 거래량 급증 + 반전 캔들
|
||||
# sell_climax — holdings_intel 정합(stock/app/holdings_intel.py:109-118):
|
||||
# 거래량 ≥ 20일평균 × climax_vol_x AND 종가 < 당일고가 × climax_close_pct (윗꼬리)
|
||||
# 실시간이므로 day_high = 당일 세션 누적 고가(최신 1분봉 고가 아님).
|
||||
climax_vol_x = params.get("climax_vol_x", ctx.get("climax_vol_mult", 3.0))
|
||||
climax_close_pct = params.get("climax_close_pct", 0.97)
|
||||
avg_vol20 = sma(vols, 20)
|
||||
if avg_vol20 and ctx["today_volume"] >= climax_mult * avg_vol20 \
|
||||
and price < ctx["day_open"]:
|
||||
day_high = ctx.get("day_high")
|
||||
if avg_vol20 and day_high and ctx["today_volume"] >= climax_vol_x * avg_vol20 \
|
||||
and price < day_high * climax_close_pct:
|
||||
firing.append(_fire(ctx, "sell", "sell_climax", price, {
|
||||
"vol_mult": round(ctx["today_volume"] / avg_vol20, 2),
|
||||
"day_open": ctx["day_open"]})) # TODO: holdings_intel 대조
|
||||
"day_high": day_high, "climax_close_pct": climax_close_pct}))
|
||||
|
||||
return firing
|
||||
|
||||
Reference in New Issue
Block a user