feat: Enhance Optuna integration and logging for backtesting framework
Changes: - Added new API endpoints for continuing and confirming Optuna jobs, allowing for better management of ongoing studies. - Introduced detailed logging for tick feed tracking and order book processing, improving traceability of vendor performance during backtests. - Updated database schema to include new fields for managing Optuna study results, enhancing the ability to track study progress and outcomes. - Refactored existing functions to utilize the new logging and tracking features, ensuring consistency across the backtesting framework. Impact: - These enhancements improve the robustness and transparency of the Optuna backtesting process, facilitating better analysis and optimization of trading strategies.
This commit is contained in:
@@ -13,6 +13,7 @@ from kis_trader.engine.feed_fallback import (
|
||||
live_feed_fallback_max_age_sec,
|
||||
orderbook_row_lag_seconds,
|
||||
)
|
||||
from kis_trader.utils.env import get_env_bool, get_env_from_db
|
||||
from kis_trader.ws.orderbook_cache import OrderbookSnapshot, orderbook_snapshot_from_storage
|
||||
from kis_trader.ws.program_cache import ProgramSnapshot, program_snapshot_from_storage
|
||||
from kis_trader.ws.trigger_eval_recorder import FILTER_EVAL_SOURCE
|
||||
@@ -661,6 +662,13 @@ def load_trigger_snapshots_by_code(
|
||||
meta["log_verdict_rows"] = sum(
|
||||
len(lst) for cm in log_verdict.values() for lst in cm.values()
|
||||
)
|
||||
# 옵투나/백테: 호가 스냅 벤더 비율 (kiwoom_0d / ls_uh1 / log_backfill …)
|
||||
try:
|
||||
from kis_trader.backtest.optuna_feed_trace import log_bt_orderbook_feed_trace
|
||||
|
||||
log_bt_orderbook_feed_trace(ob_by_code, meta, context="호가로드")
|
||||
except Exception as e:
|
||||
logger.debug("호가 피드추적 로그 스킵: %s", e)
|
||||
return ob_by_code, pg_by_code, meta
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user