fix: 로그 WARNING 2종 수정 - scanner 오해 메시지 및 홀딩 종목 rsi 누락 (#267)
Some checks failed
CI / test (pull_request) Has been cancelled

1. WARNING → DEBUG: fallback_stocks 없어도 overseas ranking API로 scanner
   정상 동작하므로 오해를 주는 WARNING 레벨을 DEBUG로 낮춤 (2곳)

2. 홀딩 종목 market_data 보강: scanner를 통하지 않은 종목(NVDA 등)에
   price_change_pct 기반 implied_rsi와 volume_ratio=1.0 기본값 설정,
   scenario_engine 조건 평가 완전화

3. test_main.py: 새로운 동작에 맞게 관련 테스트 2개 업데이트

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
agentson
2026-02-26 01:39:45 +09:00
parent b1b728f62e
commit ccb00ee77d
2 changed files with 18 additions and 10 deletions

View File

@@ -581,6 +581,11 @@ async def trading_cycle(
if candidate:
market_data["rsi"] = candidate.rsi
market_data["volume_ratio"] = candidate.volume_ratio
else:
# Holding stocks not in scanner: derive implied RSI from price change,
# volume_ratio defaults to 1.0 (no surge data available).
market_data["rsi"] = max(0.0, min(100.0, 50.0 + price_change_pct * 2.0))
market_data["volume_ratio"] = 1.0
# Enrich market_data with holding info for SELL/HOLD scenario conditions
open_pos = get_open_position(db_conn, stock_code, market.code)
@@ -1499,8 +1504,9 @@ async def run_daily_session(
active_stocks={},
)
if not fallback_stocks:
logger.warning(
"No dynamic overseas symbol universe for %s; scanner cannot run",
logger.debug(
"No dynamic overseas symbol universe for %s;"
" scanner will use overseas ranking API",
market.code,
)
try:
@@ -2812,9 +2818,9 @@ async def run(settings: Settings) -> None:
active_stocks=active_stocks,
)
if not fallback_stocks:
logger.warning(
logger.debug(
"No dynamic overseas symbol universe for %s;"
" scanner cannot run",
" scanner will use overseas ranking API",
market.code,
)