Files
kis_trader/scratch/check_ls_7.py

33 lines
954 B
Python

import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
from database import TradeDB
db = TradeDB()
try:
print("[LS in target_candidates today]")
ls_tc = db.conn.execute("""
SELECT count(*) as c FROM target_candidates
""").fetchone()
print("Total target_candidates:", dict(ls_tc))
ls_tc_mkt = db.conn.execute("""
SELECT count(*) as c FROM target_candidates WHERE market = 'LS'
""").fetchone()
print("target_candidates with market='LS':", dict(ls_tc_mkt))
print("\n[ls_candidates_history ALL]")
lch = db.conn.execute("""
SELECT count(*) as c FROM ls_candidates_history
""").fetchone()
print("Total ls_candidates_history:", dict(lch))
print("\n[kis_ws_orderbook ALL]")
kob = db.conn.execute("""
SELECT count(*) as c FROM kis_ws_orderbook
""").fetchone()
print("Total kis_ws_orderbook:", dict(kob))
finally:
db.close()