전략 파라미터 조정 — SL 완화·TP 구간 축소·재진입 쿨다운 연장

- SL: -1.5% → -2.0% (개장 노이즈 손절 방지)
- TP1: +2.0% → +1.5%, 매도 비율 50% → 70% (확정 빈도 향상)
- TP2: +3.0% → +2.5% (달성률 개선)
- 재진입 쿨다운: 30분 → 60분 (동일 종목 반복 손절 차단)
- main.py: 청산 체크 오류 시 5초 대기 추가 (API 과부하 방지)
- volatility_breakout.py: TP2 qty 버그 수정 (tp1_done=False 시 전량 청산)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-22 18:09:48 +09:00
parent 4b18db1152
commit f40856c25a
3 changed files with 10 additions and 8 deletions
+5 -4
View File
@@ -8,11 +8,12 @@ STRATEGY_K = 0.5
ENTRY_START = "09:05" ENTRY_START = "09:05"
ENTRY_END = "14:30" ENTRY_END = "14:30"
FORCE_EXIT = "14:50" # 절대 변경 불가 FORCE_EXIT = "14:50" # 절대 변경 불가
TP1_PCT = 0.02 # 1차 익절 +2% → 50% 매도 TP1_PCT = 0.015 # 1차 익절 +1.5% → 70% 매도
TP2_PCT = 0.03 # 2차 익절 +3% → 전량 TP2_PCT = 0.025 # 2차 익절 +2.5% → 전량
SL_PCT = 0.015 # 손절 -1.5% TP1_RATIO = 0.70 # TP1 시 매도 비율
SL_PCT = 0.020 # 손절 -2.0%
MAX_HOLD_MIN = 120 MAX_HOLD_MIN = 120
TICKER_REENTRY_COOLDOWN_MIN = 30 # 동일 종목 재진입 금지 시간(분) TICKER_REENTRY_COOLDOWN_MIN = 60 # 동일 종목 재진입 금지 시간(분)
# ── 리스크 ── # ── 리스크 ──
POS_SIZE_PCT = 0.20 POS_SIZE_PCT = 0.20
+1
View File
@@ -488,6 +488,7 @@ class StockBot:
except Exception as e: except Exception as e:
logger.error(f"청산 체크 오류 {ticker}: {type(e).__name__}: {e}") logger.error(f"청산 체크 오류 {ticker}: {type(e).__name__}: {e}")
await asyncio.sleep(5)
async def _do_exit(self, ticker: str, pos: dict, async def _do_exit(self, ticker: str, pos: dict,
current: float, qty: int, reason: str): current: float, qty: int, reason: str):
+4 -4
View File
@@ -8,7 +8,7 @@ import logging
import os import os
from datetime import datetime from datetime import datetime
from app.config import ( from app.config import (
STRATEGY_K, TP1_PCT, TP2_PCT, STRATEGY_K, TP1_PCT, TP2_PCT, TP1_RATIO,
ENTRY_START, ENTRY_END, ENTRY_START, ENTRY_END,
AI_CONTEXT_PATH, AI_MIN_SCORE, AI_CONTEXT_PATH, AI_MIN_SCORE,
AI_BOOST_MULTI, MIN_TRADE_AMOUNT, AI_BOOST_MULTI, MIN_TRADE_AMOUNT,
@@ -209,12 +209,12 @@ class VolatilityBreakout:
}) })
return result return result
# 2차 익절 # 2차 익절 — 잔여 전량 청산
if current_price >= tp2_price: if current_price >= tp2_price:
result.update({ result.update({
"signal": True, "signal": True,
"reason": "TP2", "reason": "TP2",
"qty" : qty - (qty // 2 if not tp1_done else 0), "qty" : qty,
"price" : tp2_price, "price" : tp2_price,
}) })
return result return result
@@ -224,7 +224,7 @@ class VolatilityBreakout:
result.update({ result.update({
"signal": True, "signal": True,
"reason": "TP1", "reason": "TP1",
"qty" : qty // 2, "qty" : max(1, int(qty * TP1_RATIO)),
"price" : tp1_price, "price" : tp1_price,
}) })
return result return result