Commit Graph

7 Commits

Author SHA1 Message Date
kyu 3db047bade news-collector: process_raw 4-동시 병렬화로 처리 용량 2배
배치 200건이 직렬 처리로 30분 초과해 매시 1회로 후퇴, 일 4,800건 처리에 그쳐
일 신규 5,500건 유입을 못 따라잡고 백로그 16K가 정체 상태.
asyncio.Semaphore(4)로 병렬화(OLLAMA_NUM_PARALLEL=4와 매칭) → 한 배치 6분 20초,
스케줄러를 minute="*/30"으로 복원 (max_instances=1로 중첩 방지).
일 처리 용량 9,600건 → 백로그 자연 소화.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 00:48:39 +09:00
kyu 8d50a345a9 CLAUDE.md: Behavioral Guidelines 섹션 추가
LLM 공통 코딩 실수 감축 가이드 4섹션 (Think Before Coding /
Simplicity First / Surgical Changes / Goal-Driven Execution) 원문 영문 보존.
기존 한국어 "Claude 행동 원칙"과 보완 관계.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 23:19:30 +09:00
kyu 47e7a5fb66 감성평가 정확성 강화 (A+B+C+D+E)
score-engine/main.py:
  A) 시간감쇠: exp 3일 반감기 (3d→0.5, 7d→0.2)
  A) 유사뉴스 중복 보정: sqrt(similar_count) cap 2.5x
  C) catalyst 패턴 매칭: "영업이익 급증" 등 세분 라벨을 실적/수주/배당/리스크/
     M&A/신제품/규제/정책/모멘텀 9개 그룹으로 통합
  B) calc_sentiment_momentum: 최근 3일 vs 이전 4일 변화율 (-50~+50)
  D) calc_market_sentiment_baseline + per-stock sentiment_alpha
     (-100~+100, 시장 평균 대비 고유 edge)
  E) calc_news_surge_and_attention: 7d/28d 비율 + log 관심도(0~100)

  종합점수 통합:
   - news_score (0.18)는 A+C로 직접 정확도 향상
   - sentiment_momentum * 0.06 + sentiment_alpha * 0.03 → max ±5 보너스
   - surge≥3 AND news_score>10 → +2 (강한 호재 attention 가산)

stock_scores 스키마: 4컬럼 추가
  - sentiment_momentum, sentiment_alpha, attention_score, news_surge_ratio

dashboard-api:
  - /api/formulas/matrix: 5컬럼(news_score + 4신규) 추가 노출
  - index.html: 10공식 매트릭스에 뉴스/M/α/관심/× 5컬럼 추가

검증: 1464종목 재산출 완료. attention >0 종목 1294(88%), 모멘텀 변동 259종목.
추천 분포 안정 (강력매수 19 / 매수관심 104 / 관망 1249 / 매도관심 73 / 강력매도 22).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 22:54:17 +09:00
kyu 324c7a4b95 미증시 페어 베타·시그널 결과 표시 버그 수정
us-market/main.py:
  1) /signal/latest 라우트 순서 버그 수정
     - 기존: /signal/{kr_code} 가 먼저 선언되어 'latest'를 코드로 매칭 → 항상 []
     - 수정: /signal/latest 를 path-param 라우트보다 위로 이동
  2) pair beta 재계산이 stock_prices(7~10일치)에서 데이터 부족으로 32건 전부 skip
     - stock_ohlcv(81일치) 우선 조회, 폴백으로 stock_prices 유지
     - 결과: updated 0→32, 베타·상관 정상 산출

dashboard-api/index.html:
  - 미증시 시그널 카드 필드명 수정 (signal_score → total_adj/sector_adj/pair_adj)
  - 절대값 큰 순 정렬 + 섹터/페어 기여도 분해 표시

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 22:25:44 +09:00
kyu a02d23de8d 대시보드 4개 탭 추가: 10공식 매트릭스 / 백테스트 / 미증시 동조 / 매크로·섹터
dashboard-api/main.py:
  - SCORE_ENGINE_URL/US_MARKET_URL/AUX_SIGNAL_URL 환경변수
  - _proxy_get 헬퍼
  - 신규 8개 엔드포인트:
    /api/formulas/matrix  - 10공식 신호 매트릭스 (stock_scores 직접 조회)
    /api/weights          - 학습된 공식 가중치 proxy
    /api/backtest         - 추천 백테스트 proxy
    /api/sector-concentration - 섹터 집중도 + 30% 경고 proxy
    /api/usmarket/etfs    - 미국 섹터 ETF
    /api/usmarket/pairs   - KR↔US 페어 + 60일 회귀 베타
    /api/usmarket/signals - 동조 시그널
    /api/macro/ecos       - 한국 매크로 (USD/KRW, 국고채)

dashboard-api/index.html:
  - 탭 4개 추가 (formulas/backtest/usmarket/macro)
  - renderFormulas: 매트릭스 테이블 (한글 매수/매도 신호 색상 + 툴팁)
  - renderBacktest: 7d/30d 카드 + 등급별 표 + 기간 슬라이드
  - renderUsMarket: ETF + 페어 + 시그널 3패널
  - renderMacro: KOSPI/USD-KRW/국고채 카드 + 섹터 집중도 막대 + 가중치

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 22:09:32 +09:00
kyu 70de874ae1 Add README.md
프로젝트 개요·파이프라인·서비스 표·점수 산출 공식·빠른 시작·API 예시·
DB 핵심 테이블·디렉토리 구조 정리.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 21:53:56 +09:00
kyu 6d3b0bacc0 Initial commit: Korean stock value-investing AI pipeline
- 19개 마이크로서비스 (news-collector, score-engine, ta-engine, dart-collector,
  aux-signal, us-market, graph-engine, telegram-bot, dashboard-api, kis-api 등)
- 가치투자 스코어링 + 10공식 앙상블 보팅 (매직포뮬러/F-Score/Altman/PEG/
  모멘텀/Beneish/GP-A/G-Score/Amihud/BAB)
- 뉴스 수집→형태소→임베딩→중복제거→AI분석 파이프라인
- 기술적분석 + GAT 그래프신경망 + 미증시 동조 시그널

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 21:33:56 +09:00