[2026-05-22] 일일 리포트 — 14건 승7패7 -127,406원 / TimeoutError 로그 버그 수정

- reports/daily/2026-05-22.md 생성
- main.py: except 블록에 type(e).__name__ 추가 (빈 에러 메시지 방지)
- kis_client._request: asyncio.TimeoutError 명시적 catch → RuntimeError re-raise
This commit is contained in:
2026-05-22 15:34:28 +09:00
parent 2aeb024c4c
commit 4b18db1152
3 changed files with 71 additions and 9 deletions
+10 -7
View File
@@ -182,13 +182,16 @@ class KISClient:
self._req_times.append(time.monotonic()) self._req_times.append(time.monotonic())
_timeout = aiohttp.ClientTimeout(total=10) _timeout = aiohttp.ClientTimeout(total=10)
async with aiohttp.ClientSession(timeout=_timeout) as session: try:
if method == "GET": async with aiohttp.ClientSession(timeout=_timeout) as session:
async with session.get(url, headers=headers, params=params) as r: if method == "GET":
data = await r.json() async with session.get(url, headers=headers, params=params) as r:
else: data = await r.json()
async with session.post(url, headers=headers, json=body) as r: else:
data = await r.json() async with session.post(url, headers=headers, json=body) as r:
data = await r.json()
except asyncio.TimeoutError:
raise RuntimeError(f"KIS API 타임아웃 [{tr_id}]")
# 응답 코드 체크 # 응답 코드 체크
rt_cd = data.get("rt_cd", "") rt_cd = data.get("rt_cd", "")
+2 -2
View File
@@ -447,7 +447,7 @@ class StockBot:
) )
except Exception as e: except Exception as e:
logger.error(f"진입 체크 오류 {ticker}: {e}") logger.error(f"진입 체크 오류 {ticker}: {type(e).__name__}: {e}")
# ───────────────────────────────────────── # ─────────────────────────────────────────
# 청산 체크 # 청산 체크
@@ -487,7 +487,7 @@ class StockBot:
await asyncio.sleep(1.1) await asyncio.sleep(1.1)
except Exception as e: except Exception as e:
logger.error(f"청산 체크 오류 {ticker}: {e}") logger.error(f"청산 체크 오류 {ticker}: {type(e).__name__}: {e}")
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):
+59
View File
@@ -0,0 +1,59 @@
# [2026-05-22] 일일 리포트
## 매매 결과
- 총 매매: 14회 / 승 7 패 7 (승률 50.0%)
- 순손익: -127,406원
- 수수료: 33,320원
## 매매 상세
| 종목 | 진입 | 청산 | 사유 | 손익 |
|------|------|------|------|------|
| 대원전선 | 09:05 | 09:11 | SL | -37,052원 |
| 이노인스트루먼트 | 09:05 | 09:06 | SL | -35,792원 |
| 피노 | 09:06 | 09:08 | TP1 | +13,433원 |
| MDS테크 | 09:10 | 09:14 | SL | -34,526원 |
| 원텍 | 09:11 | 09:15 | SL | -21,394원 |
| LG디스플레이 | 09:15 | 09:23 | TP1 | +9,512원 |
| 한화생명 | 09:15 | 09:24 | TP1 | +5,885원 |
| 코스모로보틱스 | 09:25 | 09:38 | TP1 | +18,999원 |
| 아주IB투자 | 09:28 | 09:48 | SL | -34,590원 |
| 피노 (재진입) | 09:49 | 11:14 | SL | -22,309원 |
| LG디스플레이 | 10:12 | 10:20 | TP1 | +10,226원 |
| 한화생명 (재진입) | 11:21 | 12:36 | SL | -11,176원 |
| LG디스플레이 | 12:12 | 14:12 | TIME | +4,494원 |
| PS일렉트로닉스 | 12:36 | 14:22 | TP1 | +6,882원 |
## 분석 및 피드백
### 1. 개장 초반 손절 집중 (09:05~09:15)
5거래 중 4손절, 1익절 — 이 구간에서 -128,764원 발생.
변동성 돌파 신호가 개장 5~15분간 노이즈에 취약하다는 패턴이 반복됨.
그러나 피노(09:06 TP1)는 성공해 개장 직후 전면 금지 결론은 시기상조. 추가 거래일 관찰 필요.
### 2. 구조적 손익비 문제 (핵심)
- 손절 평균: **-28,120원** (100% 청산, SL=-1.5%)
- 익절 평균: **+9,919원** (TP1 50% 청산, +2%)
- 실제 손익비: **0.35** → 50% 승률에서도 손실 필연
TP1에서 절반(50%)만 청산하는 구조상, 나머지 50% 포지션이 TP2(+3%)까지 못 가고 손절/타임청산되면 익절 건의 전체 수익이 대폭 줄어듦. 4거래일 누적 -375,418원의 핵심 원인.
**→ TP2 도달률 집계 필요. 나머지 50% 포지션 처리가 손익비 개선 여부를 결정함.**
### 3. 오후 청산 체크 오류 버그 (수정 완료)
12:51~14:11 사이 `청산 체크 오류 {ticker}: ` (빈 메시지) 반복.
원인: `asyncio.TimeoutError``str()` = `""`로 에러 내용이 숨겨짐.
수정: `main.py` except 블록에 `type(e).__name__` 추가, `kis_client._request`에서 `TimeoutError` 명시적 catch 후 `RuntimeError`로 re-raise.
### 4. AI 부스트 없음
전체 14건 모두 `ai_boosted=0`. morning 컨텍스트가 유니버스 필터링에 반영되지 않는 상태.
## 파라미터 변경
없음 (단일 거래일 데이터로 판단 보류. TP2 도달률 추가 관찰 후 재검토)
## 실전 전환 조건
| 조건 | 기준 | 현재 | 통과 |
|------|------|------|------|
| 누적 운영 | 30거래일 | 4일 | ✗ |
| 승률 | >48% | 45.5% | ✗ |
| MDD | <-10% | -3.8% | ✓ |
| 샤프지수 | >1.0 | -29.01 | ✗ |
| L3 월 2회 이하 | ≤2회 | 0회 | ✓ |