이번에 들어간 내용

한투 호가 = 2번째 앱키 전용
키 없거나 start 실패 시 메인에 H0STASP0 안 붙임. 운영설정 WS_ORDERBOOK_SAVE_KIS 빨간 danger.

LS RAM 합집합
후보∪보유∪영구∪grace. sync_targets와 split reconcile 둘 다. 틱 DB 영구 게이트는 그대로.

분봉 쓰레기 → 다음 소스 봉 통째
그 분 틱 0건이거나 전부 봉끝 대비 LIVE_FEED_FALLBACK_MAX_AGE_SEC 초과면 구멍. 메인 WS → 2차 → LS → REST → rollup. CANDLE_GARBAGE_FALLBACK 기본 true.

파일: feed_fallback.py(신규), ws_manager.py, kis_ws.py, candle_series.py, bt_candle_source.py, live_config_schema.py, database.py, 스모크, MD 2개.

같은 ws_manager/database/kis_ws/live_config에는 직전 커밋 이후 쌓여 있던 시세 폴백·ENV 키 정리도 같이 들어갔습니다. 파일 단위로 나눌 수 없어서입니다.
This commit is contained in:
Your Name
2026-08-19 22:11:31 +09:00
parent d1dc274f0e
commit 0ecac7cb95
229 changed files with 8487 additions and 1647 deletions

View File

@@ -152,10 +152,10 @@ class UpdownFeed:
# ------------------------------------------------------------------
# 조회 인터페이스 (전략 엔진이 사용)
# ------------------------------------------------------------------
def get_price(self, code: str, max_age_sec: float = 10.0) -> Optional[Dict[str, Any]]:
def get_price(self, code: str, max_age_sec: Optional[float] = None) -> Optional[Dict[str, Any]]:
"""현재가 dict (KIS inquire_price 호환). 모드에 따라 ws 캐시 / rest 캐시 사용.
max_age_sec 초 초과로 오래된 캐시는 None (재진입·청산 오판 방지).
max_age_sec is None 이면 나이 무시(마지막 RAM). 체결·폴러 공백 ≠ 가격 삭제.
"""
code = str(code).strip()
if self._mode == "ws":
@@ -168,10 +168,13 @@ class UpdownFeed:
ent = self._cache.get(code)
if not ent:
return None
if (time.time() - ent["ts"]) > max_age_sec:
if max_age_sec is not None and (time.time() - ent["ts"]) > max_age_sec:
return None
return ent["data"]
def get_price_last(self, code: str) -> Optional[Dict[str, Any]]:
return self.get_price(code, max_age_sec=None)
def get_candles(self, code: str, tf: int, n: int = 50) -> list:
"""15분 등 확정봉 — 모드 무관 ws_manager 에 위임(WS 집계 또는 REST 폴백)."""
try: