diff --git a/agents/stock/workspace/scripts/behive_web.py b/agents/stock/workspace/scripts/behive_web.py index ba31514..af6a01f 100644 --- a/agents/stock/workspace/scripts/behive_web.py +++ b/agents/stock/workspace/scripts/behive_web.py @@ -3722,9 +3722,12 @@ def _render_net_worth_chart(series: list[tuple[str, int]], current_net: int | No svg_parts.append( f'' ) - # 전고점 dot — 그려진 라인(plot_values) 의 max 시점에 노란 마커. 마지막 포인트와 같으면 last_dot 으로 충분해 생략. + # 고/저점 dot — 장중가(마지막 점)가 극값일 때도 표시. last_dot 위에 색 점이 덮인다. peak_i = max(range(len(plot_values)), key=lambda i: plot_values[i]) - if peak_i != n - 1: + low_i = min(range(len(plot_values)), key=lambda i: plot_values[i]) + _is_ath = n >= 2 and plot_values[-1] > max(plot_values[:-1]) + # 고점 — 단, 마지막 점이 신고가(ATH)면 신고가 링/라벨이 대신하므로 '고' 생략. + if not (peak_i == n - 1 and _is_ath): peak_x, peak_y = pts[peak_i] svg_parts.append( f'' @@ -3732,9 +3735,8 @@ def _render_net_worth_chart(series: list[tuple[str, int]], current_net: int | No svg_parts.append( f'' ) - # 저점 dot — min 시점에 파란 마커 + '저' 라벨. 마지막/고점과 겹치면 생략. - low_i = min(range(len(plot_values)), key=lambda i: plot_values[i]) - if low_i != n - 1 and low_i != peak_i: + # 저점 — 고점과 다른 점일 때 (장중가가 저점이어도 표시). + if low_i != peak_i: low_x, low_y = pts[low_i] svg_parts.append( f'' @@ -3744,7 +3746,7 @@ def _render_net_worth_chart(series: list[tuple[str, int]], current_net: int | No ) # 신고가 마커 — 오늘(마지막) 그려진 값이 이전 모든 포인트를 strict 하게 초과하면 last dot 위에 금색 ring + 라벨. # per_period면 '역대 최고 기간 손익', 아니면 누적/순자산 신고가. - if n >= 2 and plot_values[-1] > max(plot_values[:-1]): + if _is_ath: svg_parts.append( f''