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:
Your Name
2026-08-15 23:01:14 +09:00
parent 4a18ce2697
commit 36a3e2b4a1
94 changed files with 6368 additions and 1639 deletions

View File

@@ -25,6 +25,7 @@
- 3. 사용자가 요청한 기존 로직과 100% 동일한 기능을 수행하는가?
- 만약 하나라도 빠졌다면 코드를 출력하기 전에 스스로 수정하세요.
- 4. rest는 최대한 사용하지 않도록 하세요. 대신 websocket을 사용하세요. 대체할 수 있는 경우는 최대한 사용하지 않도록 하세요.
- 4-1. **호가필터 TTL 분리** (`docs/호가.md`): 판정=`WS_ORDERBOOK_FILTER_MAX_AGE_SEC`(기본 0=마지막 RAM), 저장=`WS_ORDERBOOK_TICK_MAX_AGE_SEC`. 만료로 `None` 만들어 필터 ON인데 통과시키지 말 것. 한 번도 스냅 없는 경우만 스킵.
- 5. 실매매 기준으로 백테, 파라미터서치 코드를 맞춘다. 백테, 파라미터서치 코드는 실매매 코드와 100% 동일해야 한다.
- 6. 새로 추가한 코드 기본값은 항상 db에 추가하세요. 웹 페이지 인풋 값이랑 일치해야 된다.
- 7. 코드 수정 시 실매매 웹 백테스트 파라미터서치의 결과 값이 동일해야 하고 검증을 꼭 거쳐야 한다.
@@ -101,6 +102,7 @@
- **OHLC 폴백으로 숫자 변조 절대 금지.** 틱 청산/진입 ON 이면 봉 OHLC(high/low)로 체결·`max_price`·PnL을 채우지 마라.
EOD에 OHLC 폴백 강제·틱 전 봉 high 선반영 = 실매와 다른 엔진. Optuna/파람/웹백테는 `*_TICK_FALLBACK_OHLC` **강제 OFF**.
UI에 남은 폴백 체크는 **빨간 위험 표시**일 뿐, 켜서 정합 “맞추기” 금지. (상세: `no-ohlc-fallback-parity.mdc`)
- **호가필터 나이를 저장 TTL과 다시 합치지 말 것.** `WS_ORDERBOOK_FILTER_MAX_AGE_SEC`(기본 0)를 `TICK_MAX_AGE`로 되돌리면 만료=`None`=필터 ON 통과 구멍. 상세 `docs/호가.md`.
## 1. 🚨 하드코딩 절대 금지 (NO HARDCODING)
- 어떠한 경우에도 코드 내부에 임계값, 비율, 점수, 시간 등의 수치를 직접 하드코딩하지 마라.