refactor: enhance Optuna backtesting framework, optimize orderbook filtering, and update database management utilities.

This commit is contained in:
Your Name
2026-08-12 10:19:19 +09:00
parent cb7e5037a0
commit c6bd62a25f
218 changed files with 31613 additions and 759 deletions

View File

@@ -0,0 +1,20 @@
import sys
import json
sys.path.insert(0, '/home/hoon/kis_bot')
from database import TradeDB
db = TradeDB()
try:
res = db.conn.execute("SELECT code, name, strategy, env_snapshot FROM active_trades WHERE env_snapshot IS NOT NULL ORDER BY updated_at DESC LIMIT 5").fetchall()
if not res:
print("현재 active_trades에 env_snapshot이 저장된 거래가 없습니다.")
else:
print(f"env_snapshot 저장 내역 {len(res)}건 확인:")
for r in res:
r_dict = dict(r)
snap = r_dict['env_snapshot']
snap_len = len(snap) if snap else 0
print(f"- {r_dict['name']}({r_dict['code']}) [{r_dict['strategy']}] | 스냅샷 길이: {snap_len} bytes")
except Exception as e:
print(f"조회 실패: {e}")
db.close()