ls증권 히스토리 구독 넣음

This commit is contained in:
Your Name
2026-07-30 18:05:07 +09:00
parent 61bec4bd1d
commit 67eab24603
1593 changed files with 135733 additions and 1232 deletions

View File

@@ -88,7 +88,7 @@ def backup_all(db: TradeDB, out_dir: Path) -> Dict[str, Any]:
meta["env_config_rows"] = len(full_rows)
for tbl in (
"config_scalp", "config_short", "config_momentum", "config_breakout",
"config_scalp", "config_short", "config_momentum", "config_us_momentum", "config_breakout",
"config_range_break", "config_updow", "config_dbband", "env_config_ext",
):
try:

View File

@@ -77,10 +77,21 @@ def _extract_snapshot(balance: Dict[str, Any], client: KISClient) -> Dict[str, A
dnca = _parse_amt(out2.get("dnca_tot_amt"))
d2 = _parse_amt(out2.get("prvs_rcdl_excc_amt"))
ord_psbl = _pick_first_positive(
out2,
["ord_psbl_cash", "ord_psbl_amt", "ord_psbl", "buy_psbl_cash", "buy_psbl_amt"],
)
# 잔고 API 에는 주문가능현금 없음 → 매수가능조회(inquire-psbl-order)
ord_psbl = 0.0
try:
psbl = client.inquire_psbl_order("005930", price=0, ord_dvsn="01") or {}
ord_psbl = _pick_first_positive(
psbl,
["ord_psbl_cash", "nrcvb_buy_amt", "max_buy_amt"],
)
except Exception:
ord_psbl = 0.0
if ord_psbl <= 0:
ord_psbl = _pick_first_positive(
out2,
["ord_psbl_cash", "ord_psbl_amt", "ord_psbl", "buy_psbl_cash", "buy_psbl_amt"],
)
total_asset = _parse_amt(out2.get("tot_evlu_amt"))
if total_asset <= 0:
holding_eval = 0.0