fix: take_profit_pct defined in schema but never enforced in trading loop #163

Closed
opened 2026-02-20 02:58:32 +09:00 by agentson · 0 comments
Collaborator

문제

StockScenario에 take_profit_pct 필드가 정의되어 있지만, main.py의 HOLD 평가 블록에서 익절 조건을 전혀 체크하지 않는다.

현재 코드 (main.py:383-408):

  • HOLD 판정 후 보유 포지션 확인
  • stop_loss_pct 초과 시 SELL 오버라이드
  • take_profit_pct 도달 시 SELL 오버라이드 (없음)

영향

AI가 take_profit_pct: 5.0을 생성해도 시스템이 완전히 무시한다.
익절 타이밍 없이 손절만 있는 비대칭 구조.

개선

HOLD 블록에 take_profit 체크 추가:

if loss_pct >= take_profit_threshold:
    decision = TradeDecision(action='SELL', confidence=90, rationale='Take-profit triggered ...')

테스트

  • take_profit 초과 시 SELL 오버라이드 동작 검증
  • stop_loss와 take_profit 동시 조건 처리 검증
## 문제 StockScenario에 take_profit_pct 필드가 정의되어 있지만, main.py의 HOLD 평가 블록에서 익절 조건을 전혀 체크하지 않는다. 현재 코드 (main.py:383-408): - HOLD 판정 후 보유 포지션 확인 - stop_loss_pct 초과 시 SELL 오버라이드 ✅ - take_profit_pct 도달 시 SELL 오버라이드 ❌ (없음) ## 영향 AI가 take_profit_pct: 5.0을 생성해도 시스템이 완전히 무시한다. 익절 타이밍 없이 손절만 있는 비대칭 구조. ## 개선 HOLD 블록에 take_profit 체크 추가: ```python if loss_pct >= take_profit_threshold: decision = TradeDecision(action='SELL', confidence=90, rationale='Take-profit triggered ...') ``` ## 테스트 - take_profit 초과 시 SELL 오버라이드 동작 검증 - stop_loss와 take_profit 동시 조건 처리 검증
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#163