fix: defensive playbook missing BUY conditions causes zero trades on US market #145

Closed
opened 2026-02-18 22:20:56 +09:00 by agentson · 0 comments
Collaborator

문제

미국 시장에서 거래가 한 번도 실행되지 않는 문제.

근본 원인

  1. gemini-2.5-flash 무료 티어 일일 쿼터(20 RPD) 초과 → generate_playbook() 실패
  2. 실패 시 _defensive_playbook() 호출 → SELL 조건(price_change_pct_below: -3.0)만 있고 BUY 조건이 없음
  3. 스캐너가 RSI 모멘텀/거래량 폭증 후보를 찾아도 BUY 조건이 없어 ScenarioEngine이 항상 HOLD 반환

DB 증거

2026-02-17: CHOW|HOLD|0|No scenario conditions met (volume_ratio=13.64, RSI=100)
2026-02-17: SIF|HOLD|0|No scenario conditions met (volume_ratio=9.025, RSI=100)
2026-02-17: YCBD|HOLD|0|No scenarios defined for YCBD

플레이북 DB: token_count=0, gemini_model='' → Gemini 미호출, defensive fallback 사용

수정 방법

Gemini 실패 시 _defensive_playbook() 대신 스캐너 신호를 활용한 _smart_fallback_playbook() 사용:

  • signal=momentumvolume_ratio_above=VOL_MULTIPLIER 조건의 BUY 시나리오 추가
  • signal=oversoldrsi_below=RSI_OVERSOLD_THRESHOLD 조건의 BUY 시나리오 추가
  • 기존 stop-loss SELL 시나리오 유지
## 문제 미국 시장에서 거래가 한 번도 실행되지 않는 문제. ### 근본 원인 1. `gemini-2.5-flash` 무료 티어 일일 쿼터(20 RPD) 초과 → `generate_playbook()` 실패 2. 실패 시 `_defensive_playbook()` 호출 → SELL 조건(`price_change_pct_below: -3.0`)만 있고 **BUY 조건이 없음** 3. 스캐너가 RSI 모멘텀/거래량 폭증 후보를 찾아도 BUY 조건이 없어 ScenarioEngine이 항상 HOLD 반환 ### DB 증거 ``` 2026-02-17: CHOW|HOLD|0|No scenario conditions met (volume_ratio=13.64, RSI=100) 2026-02-17: SIF|HOLD|0|No scenario conditions met (volume_ratio=9.025, RSI=100) 2026-02-17: YCBD|HOLD|0|No scenarios defined for YCBD ``` 플레이북 DB: `token_count=0, gemini_model=''` → Gemini 미호출, defensive fallback 사용 ### 수정 방법 Gemini 실패 시 `_defensive_playbook()` 대신 스캐너 신호를 활용한 `_smart_fallback_playbook()` 사용: - `signal=momentum` → `volume_ratio_above=VOL_MULTIPLIER` 조건의 BUY 시나리오 추가 - `signal=oversold` → `rsi_below=RSI_OVERSOLD_THRESHOLD` 조건의 BUY 시나리오 추가 - 기존 stop-loss SELL 시나리오 유지
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#145