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:
@@ -9,7 +9,7 @@ multivariate TPE: 모든 축을 **먼저** suggest 한 뒤, 제약(ATR min/max·
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, List
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
import optuna
|
||||
|
||||
@@ -74,9 +74,21 @@ def tail_tpe_axis_keys() -> List[str]:
|
||||
return list(TAIL_TPE_AXIS_KEYS)
|
||||
|
||||
|
||||
def suggest_tail_params_tpe(trial: optuna.Trial) -> Dict[str, Any]:
|
||||
def normalize_tpe_tail_entry_mode(raw: Optional[Any] = None) -> str:
|
||||
"""TPE는 진입모드를 탐색하지 않고 스터디마다 고정. align | limit_atr."""
|
||||
s = str(raw or "").strip().lower()
|
||||
if s in ("limit_atr", "limit", "atr_limit"):
|
||||
return "limit_atr"
|
||||
return "align"
|
||||
|
||||
|
||||
def suggest_tail_params_tpe(
|
||||
trial: optuna.Trial,
|
||||
entry_mode: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
combo: Dict[str, Any] = {}
|
||||
combo["entry_mode"] = "align"
|
||||
# 한 스터디=한 모드. categorical 혼입 금지(웹 체크 2개면 잡 2개 순차).
|
||||
combo["entry_mode"] = normalize_tpe_tail_entry_mode(entry_mode)
|
||||
combo["cand_limit"] = trial.suggest_categorical("cand_limit", [0, 20])
|
||||
combo["max_daily_change"] = r1(
|
||||
trial.suggest_float("max_daily_change", 10.0, 60.0, step=1.0), # 확장: 20→10, 45→60
|
||||
|
||||
Reference in New Issue
Block a user