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:
@@ -173,21 +173,15 @@ def load_scalp_candles_by_code(
|
||||
)
|
||||
return candles_by_code, total_candles
|
||||
|
||||
from kis_trader.backtest.bt_candle_source import (
|
||||
fetch_ws_candles_for_code,
|
||||
list_ws_candle_codes,
|
||||
from kis_trader.backtest.bt_candle_source import fetch_ws_candles_by_code_bulk
|
||||
|
||||
loaded = fetch_ws_candles_by_code_bulk(
|
||||
db, 1, start_key, end_key,
|
||||
confirmed_only=True,
|
||||
)
|
||||
|
||||
codes = list_ws_candle_codes(db, 1, start_key, end_key)
|
||||
|
||||
candles_by_code: Dict[str, List[Dict]] = {}
|
||||
total_candles = 0
|
||||
|
||||
for code in codes:
|
||||
rows = fetch_ws_candles_for_code(
|
||||
db, code, 1, start_key, end_key,
|
||||
confirmed_only=True,
|
||||
)
|
||||
for code, rows in loaded.items():
|
||||
if len(rows) < min_bars:
|
||||
continue
|
||||
candles_by_code[code] = rows
|
||||
|
||||
Reference in New Issue
Block a user