refactor: enhance Optuna backtesting framework, optimize orderbook filtering, and update database management utilities.
This commit is contained in:
22
scratch/check_ws_price_validation_2.py
Normal file
22
scratch/check_ws_price_validation_2.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from database import TradeDB
|
||||
db = TradeDB()
|
||||
try:
|
||||
sql = """
|
||||
SELECT
|
||||
COUNT(*) as total_rows,
|
||||
AVG(kis_age_ms) as avg_kis_age,
|
||||
AVG(kiwoom_age_ms) as avg_kiwoom_age,
|
||||
SUM(CASE WHEN kis_age_ms < kiwoom_age_ms THEN 1 ELSE 0 END) as kis_faster_cnt,
|
||||
SUM(CASE WHEN kiwoom_age_ms < kis_age_ms THEN 1 ELSE 0 END) as kiwoom_faster_cnt,
|
||||
AVG(diff_pct) as avg_diff_pct
|
||||
FROM ws_price_validation
|
||||
WHERE DATE(ts) = '2026-08-10'
|
||||
"""
|
||||
row = db.conn.execute(sql).fetchone()
|
||||
|
||||
import json
|
||||
print("\n--- ws_price_validation Today ---")
|
||||
print(json.dumps(dict(row), indent=2))
|
||||
|
||||
finally:
|
||||
db.close()
|
||||
Reference in New Issue
Block a user