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:
@@ -192,7 +192,7 @@ class TailCatchStrategy(BaseStrategy):
|
||||
return None
|
||||
# 대형 주도주 등 하락매수 제외 종목 차단 (DIP_BUY_EXCLUDE_CODES 비면 무효)
|
||||
if self.is_dip_buy_excluded(code):
|
||||
self.logger.info("🔍 [탈락-대형주제외] %s %s: DIP_BUY_EXCLUDE_CODES", name, code)
|
||||
self._scan_log("info", code, "🔍 [탈락-대형주제외] %s %s: DIP_BUY_EXCLUDE_CODES", name, code)
|
||||
return None
|
||||
_cb = self._cb_prof_start(code)
|
||||
try:
|
||||
@@ -254,7 +254,7 @@ class TailCatchStrategy(BaseStrategy):
|
||||
reject, msg, sig = te.check_buy_signal_live(candles, params, state)
|
||||
self._cb_prof_mark(_cb, "engine")
|
||||
if reject:
|
||||
self.logger.info("🔍 [%s] %s %s: %s", reject, name, code, msg or "")
|
||||
self._scan_log("info", code, "🔍 [%s] %s %s: %s", reject, name, code, msg or "")
|
||||
return None
|
||||
if not sig:
|
||||
return None
|
||||
@@ -338,7 +338,7 @@ class TailCatchStrategy(BaseStrategy):
|
||||
)
|
||||
self._cb_prof_mark(_cb, "mid_enroll")
|
||||
if _defer:
|
||||
self.logger.info("🔍 [%s] %s(%s)", _defer, name, code)
|
||||
self._scan_log("info", code, "🔍 [%s] %s(%s)", _defer, name, code)
|
||||
return None
|
||||
if align_on and entry_open > 0:
|
||||
from kis_trader.engine.tail_tick_replay import live_align_entry_price
|
||||
@@ -421,7 +421,7 @@ class TailCatchStrategy(BaseStrategy):
|
||||
},
|
||||
}
|
||||
except Exception as e:
|
||||
self.logger.info("🔍 [탈락-예외] %s %s: %s", name, code, e)
|
||||
self._scan_log("info", code, "🔍 [탈락-예외] %s %s: %s", name, code, e)
|
||||
return None
|
||||
finally:
|
||||
self._cb_prof_finish(_cb)
|
||||
|
||||
Reference in New Issue
Block a user