feat: Enhance trading system with new permanent subscription features and order book management
Changes: - Added a new API endpoint for managing permanent subscriptions, allowing users to enable or disable subscriptions dynamically. - Implemented a function to fill candle data from Kiwoom, ensuring that only relevant data is inserted into the database. - Introduced a mechanism to handle master subscription states, improving the management of subscription statuses. - Updated the database schema to include new fields for managing subscription states and order book filtering. Impact: - These enhancements improve the flexibility and reliability of the trading system, allowing for better management of subscriptions and order book data, while reducing the risk of data inconsistencies. 히스토리 align 제거 븅신같은 초기설계 아예 제거 진입모드에 구멍메움 호가진입을 켜도 호가가 안들어올때 호가 안보고 그냥 사버림
This commit is contained in:
@@ -21,9 +21,8 @@ v2 변경점 (다중 조건식 지원):
|
||||
* 같은 조건식을 여러 전략이 공유해도 OK (seq 가 같으면 REST 1번만 호출)
|
||||
* 전략별 get_universe_for / get_candidates_for 제공
|
||||
* **변동(ENTER/EXIT) 감지 tick 마다** ``target_candidates_history`` 에
|
||||
초단위 ``event_time`` (YYYY-MM-DD HH:MM:SS) 으로 풀 스냅샷을 INSERT.
|
||||
(strategy_id 컬럼은 ``TradeDBExt.insert_condition_universe_snapshot``
|
||||
이 자동 마이그레이션.) 백테스트는 ``TradeDBExt.get_universe_by_candle_time()``
|
||||
마이크로초 ``event_time`` (YYYY-MM-DD HH:MM:SS.ffffff) 으로 풀 스냅샷 INSERT만.
|
||||
같은 초 DELETE 바꿔치기 없음. 백테스트는 ``TradeDBExt.get_universe_by_candle_time()``
|
||||
으로 "그 1분봉 시점에 봇이 보던 유니버스" 를 재현.
|
||||
|
||||
사용 (권장 — multi):
|
||||
@@ -297,7 +296,7 @@ class ConditionSearchManager:
|
||||
|
||||
기본(``CONDITION_EXIT_GRACE_SEC=0``): raw 변동을 즉시 push/pop.
|
||||
grace>0: EXIT 를 N초 지연(sticky). history 는 반드시 effective 목록을
|
||||
저장해야 슬롯정합이 안 깨짐 — 부모 ``_save_snapshot`` / LS override 경로 동일.
|
||||
저장해야 백테 history 재생이 실매 RAM 과 맞음 — 부모 ``_save_snapshot`` / LS override 경로 동일.
|
||||
"""
|
||||
raw_order: List[str] = []
|
||||
raw_seen: Set[str] = set()
|
||||
@@ -428,7 +427,7 @@ class ConditionSearchManager:
|
||||
return
|
||||
# 유니버스가 비어있어도 "비었다" 는 사실을 기록해야 백테스트에서 재현 가능.
|
||||
# 단, 한 번도 결과를 못 받은 상태(첫 호출 실패 등)는 저장 X.
|
||||
event_time = dt.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
event_time = dt.now().strftime("%Y-%m-%d %H:%M:%S.%f")
|
||||
items = [
|
||||
{"code": c, "name": names.get(c, c)}
|
||||
for c in codes_ordered
|
||||
|
||||
Reference in New Issue
Block a user