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:
Your Name
2026-08-21 19:05:23 +09:00
parent 0ecac7cb95
commit 0780b2cdd0
76 changed files with 4648 additions and 516 deletions

View File

@@ -151,7 +151,7 @@ class MomentumStrategy(BaseStrategy):
return None
if reject == "탈락-봉부족":
return None
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
@@ -164,7 +164,7 @@ class MomentumStrategy(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
align_on = get_env_bool("MOMENTUM_LIVE_BACKTEST_ALIGN", True)
@@ -206,7 +206,8 @@ class MomentumStrategy(BaseStrategy):
)
self._cb_prof_mark(_cb, "qty")
if rej:
self.logger.info(
self._scan_log(
"info", code,
"🔍 [탈락-%s] %s(%s) price=%.0f",
rej, name, code, curr_price,
)
@@ -233,7 +234,7 @@ class MomentumStrategy(BaseStrategy):
"entry_features": {"rsi": sig.get("rsi", 0)},
}
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)