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:
@@ -213,7 +213,7 @@ class ScalpingStrategy(BaseStrategy):
|
||||
reject, msg, sig = se.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
|
||||
@@ -224,7 +224,7 @@ class ScalpingStrategy(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 시 T봉 첫 틱(RAM) → 없으면 시가. 폴백만 WS 현재가
|
||||
@@ -262,7 +262,8 @@ class ScalpingStrategy(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,
|
||||
)
|
||||
@@ -290,7 +291,7 @@ class ScalpingStrategy(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)
|
||||
|
||||
Reference in New Issue
Block a user