[2026-05-27] 포맷 후 복구 설치 스크립트 추가
This commit is contained in:
@@ -15,6 +15,7 @@ import math
|
||||
import os
|
||||
import sqlite3
|
||||
import sys
|
||||
from collections import Counter
|
||||
from datetime import datetime, timedelta
|
||||
from pathlib import Path
|
||||
|
||||
@@ -184,6 +185,8 @@ def main(print_mode: bool = False):
|
||||
wins = [t for t in closed if (t["pnl"] or 0) > 0]
|
||||
losses = [t for t in closed if (t["pnl"] or 0) <= 0]
|
||||
net_pnl = sum(t["pnl"] or 0 for t in closed)
|
||||
exit_reason_counts = Counter(t.get("exit_reason") or "UNKNOWN" for t in closed)
|
||||
forced_count = exit_reason_counts.get("FORCE", 0)
|
||||
|
||||
summary = {
|
||||
"date": TODAY,
|
||||
@@ -193,6 +196,8 @@ def main(print_mode: bool = False):
|
||||
"losses": len(losses),
|
||||
"win_rate": round(len(wins) / len(closed) * 100, 1) if closed else 0,
|
||||
"net_pnl": round(net_pnl),
|
||||
"exit_reason_counts": dict(exit_reason_counts),
|
||||
"force_exit_ratio": round(forced_count / len(closed) * 100, 1) if closed else 0,
|
||||
"trades": trades,
|
||||
},
|
||||
"last_30_days": {
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ async def get_status():
|
||||
|
||||
if open_rows:
|
||||
kis = KISClient()
|
||||
await kis.ensure_token()
|
||||
await kis.get_access_token()
|
||||
for ticker, name, entry_price, qty in open_rows:
|
||||
try:
|
||||
info = await kis.get_price(ticker)
|
||||
|
||||
Reference in New Issue
Block a user