feat(Core/UI): 백테스트 전역 엔진 선택 버튼 추가 및 스캘핑 Rust 방어로직 포팅 1차 완료
This commit is contained in:
30
scratch/explain_kis_kiwoom.py
Normal file
30
scratch/explain_kis_kiwoom.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import sys
|
||||
import json
|
||||
sys.path.insert(0, '/home/hoon/kis_bot')
|
||||
from database import TradeDB
|
||||
|
||||
db = TradeDB()
|
||||
today = '20260813'
|
||||
|
||||
queries = [
|
||||
# 1. feed_collect_stats - TEMP 테이블 생성 시
|
||||
f"EXPLAIN SELECT id, code, tick_time, tick_time_raw, source, recv_ts FROM ws_ticks WHERE tick_time >= '{today}000000' AND tick_time <= '{today}235959'",
|
||||
f"EXPLAIN SELECT id, code, snap_time, source, recv_ts, reject_code, strategy FROM ws_orderbook WHERE snap_time >= '{today}000000' AND snap_time <= '{today}235959'",
|
||||
|
||||
# 2. 통계 등에서 GROUP BY를 하거나 STR_TO_DATE를 쓰는 경우 (가정)
|
||||
f"EXPLAIN SELECT source, COUNT(*) n FROM ws_ticks WHERE tick_time LIKE '{today}%' GROUP BY source",
|
||||
|
||||
# 3. 백테스트/옵투나에서 종목+시간으로 조회하는 경우
|
||||
f"EXPLAIN SELECT * FROM ws_ticks WHERE tick_time >= '{today}090000' AND tick_time <= '{today}153000' AND code='005930'"
|
||||
]
|
||||
|
||||
for q in queries:
|
||||
print(f"\n--- Query: {q} ---")
|
||||
try:
|
||||
rows = db.conn.execute(q).fetchall()
|
||||
for r in rows:
|
||||
print(dict(r))
|
||||
except Exception as e:
|
||||
print("Error:", e)
|
||||
|
||||
db.close()
|
||||
Reference in New Issue
Block a user