refactor: enhance Optuna backtesting framework, optimize orderbook filtering, and update database management utilities.
This commit is contained in:
@@ -50,7 +50,7 @@ def breakout_tpe_axis_keys() -> List[str]:
|
||||
def suggest_breakout_params_tpe(trial: optuna.Trial) -> Dict[str, Any]:
|
||||
combo: Dict[str, Any] = {}
|
||||
combo["max_daily_chg"] = r1(trial.suggest_float("max_daily_chg", 20.0, 55.0, step=1.0))
|
||||
combo["vol_mult"] = r2(trial.suggest_float("vol_mult", 1.5, 4.0, step=0.1))
|
||||
combo["vol_mult"] = r2(trial.suggest_float("vol_mult", 1.0, 5.0, step=0.1)) # 확장: 1.5→1.0, 4.0→5.0
|
||||
combo["vol_window"] = trial.suggest_int("vol_window", 1, 15)
|
||||
combo["min_turnover_1m_pct"] = r2(
|
||||
trial.suggest_float("min_turnover_1m_pct", 0.05, 0.5, step=0.05),
|
||||
@@ -61,12 +61,12 @@ def suggest_breakout_params_tpe(trial: optuna.Trial) -> Dict[str, Any]:
|
||||
raise optuna.TrialPruned("prev_chg invalid")
|
||||
|
||||
combo["min_price"] = trial.suggest_int("min_price", 1000, 5000, step=500)
|
||||
combo["tp_pct"] = r2(trial.suggest_float("tp_pct", 2.0, 18.0, step=0.5))
|
||||
combo["sl_pct"] = r2(trial.suggest_float("sl_pct", 2.0, 6.0, step=0.1))
|
||||
combo["tp_pct"] = r2(trial.suggest_float("tp_pct", 1.0, 25.0, step=0.5)) # 확장: 2.0→1.0, 18.0→25.0
|
||||
combo["sl_pct"] = r2(trial.suggest_float("sl_pct", 1.0, 8.0, step=0.1)) # 확장: 2.0→1.0, 6.0→8.0
|
||||
combo["sl_mode"] = trial.suggest_categorical("sl_mode", _SL_MODE_CHOICES)
|
||||
combo["atr_sl_mult"] = r2(trial.suggest_float("atr_sl_mult", 1.5, 3.5, step=0.1))
|
||||
combo["trail_pct"] = r2(trial.suggest_float("trail_pct", 1.0, 4.0, step=0.1))
|
||||
combo["trail_arm_pct"] = r2(trial.suggest_float("trail_arm_pct", 1.0, 4.0, step=0.1))
|
||||
combo["trail_pct"] = r2(trial.suggest_float("trail_pct", 0.0, 6.0, step=0.1)) # 확장: 1.0→0.0, 4.0→6.0
|
||||
combo["trail_arm_pct"] = r2(trial.suggest_float("trail_arm_pct", 0.0, 6.0, step=0.1)) # 확장: 1.0→0.0, 4.0→6.0
|
||||
combo["shoulder_min_high_pct"] = r2(
|
||||
trial.suggest_float("shoulder_min_high_pct", 1.0, 6.0, step=0.1),
|
||||
)
|
||||
@@ -92,5 +92,6 @@ def suggest_breakout_params_tpe(trial: optuna.Trial) -> Dict[str, Any]:
|
||||
)
|
||||
combo["body_min_pct"] = r2(trial.suggest_float("body_min_pct", 0.0, 0.5, step=0.1))
|
||||
combo["max_hold_bars"] = trial.suggest_int("max_hold_bars", 0, 180, step=10)
|
||||
|
||||
combo["skip_hts_scan_dupes"] = False
|
||||
return combo
|
||||
|
||||
Reference in New Issue
Block a user