Fix Python 3.12 dependency and strategy imports

This commit is contained in:
chrisnov-it
2026-05-19 12:27:21 +08:00
parent e39d1e6a9d
commit dc668b0ba7
10 changed files with 304 additions and 26 deletions
+3 -3
View File
@@ -4,7 +4,7 @@
import math
import logging
import os
from core.strategies.strategy_map import STRATEGY_MAP
from core.strategies.strategy_map import resolve_strategy_class
logger = logging.getLogger(__name__)
# Set appropriate logging level
@@ -263,7 +263,7 @@ def run_enhanced_backtest(strategy_id, params, historical_data_df, symbol_name=N
)
# Get strategy
strategy_class = STRATEGY_MAP.get(strategy_id)
strategy_class = resolve_strategy_class(strategy_id)
if not strategy_class:
return {"error": "Strategy not found"}
@@ -486,4 +486,4 @@ def run_enhanced_backtest(strategy_id, params, historical_data_df, symbol_name=N
# Wrapper function for backward compatibility
def run_backtest(strategy_id, params, historical_data_df, symbol_name=None):
"""Backward compatible wrapper for enhanced backtesting"""
return run_enhanced_backtest(strategy_id, params, historical_data_df, symbol_name)
return run_enhanced_backtest(strategy_id, params, historical_data_df, symbol_name)