refactor: enhance Optuna backtesting framework, optimize orderbook filtering, and update database management utilities.
This commit is contained in:
@@ -85,7 +85,7 @@ def suggest_momentum_params_tpe(
|
||||
combo["mom_vol_win"] = trial.suggest_int("mom_vol_win", 3, 10)
|
||||
# HTS K: 전일종가 대비 최소등락(%) — 실매 앵커 0.2 포함 연속 텀 (step 0.1)
|
||||
combo["e_min_chg_pct"] = r1(
|
||||
trial.suggest_float("e_min_chg_pct", 0.0, 2.0, step=0.1),
|
||||
trial.suggest_float("e_min_chg_pct", 0.0, 3.0, step=0.1), # 확장: 2.0→3.0
|
||||
)
|
||||
|
||||
combo["tp_pct"] = r2(trial.suggest_float("tp_pct", 1.5, 15.0, step=0.1))
|
||||
@@ -93,7 +93,7 @@ def suggest_momentum_params_tpe(
|
||||
if combo["tp_max_pct"] + 1e-9 < combo["tp_pct"]:
|
||||
raise optuna.TrialPruned("tp_max < tp")
|
||||
|
||||
combo["sl_pct"] = r2(trial.suggest_float("sl_pct", 1.0, 6.0, step=0.1))
|
||||
combo["sl_pct"] = r2(trial.suggest_float("sl_pct", 0.5, 8.0, step=0.1)) # 확장: 1.0→0.5, 6.0→8.0
|
||||
|
||||
combo["shoulder_min_high"] = r2(
|
||||
trial.suggest_float("shoulder_min_high", 0.3, 5.0, step=0.1),
|
||||
@@ -106,7 +106,7 @@ def suggest_momentum_params_tpe(
|
||||
trial.suggest_float("trail_arm_pct", 0.0, 5.0, step=0.1),
|
||||
)
|
||||
|
||||
combo["max_hold_bars"] = trial.suggest_int("max_hold_bars", 0, 180, step=5)
|
||||
combo["max_hold_bars"] = trial.suggest_int("max_hold_bars", 0, 300, step=5) # 확장: 180→300
|
||||
combo["cooldown_min"] = r1(trial.suggest_float("cooldown_min", 0.0, 30.0, step=1.0))
|
||||
combo["max_daily"] = trial.suggest_int("max_daily", 5, 100, step=5)
|
||||
combo["max_daily_chg"] = r1(
|
||||
@@ -123,13 +123,13 @@ def suggest_momentum_params_tpe(
|
||||
trial.suggest_float("pullback_min_pct", 0.1, 1.0, step=0.1),
|
||||
)
|
||||
combo["pullback_max_pct"] = r2(
|
||||
trial.suggest_float("pullback_max_pct", 1.0, 6.0, step=0.1),
|
||||
trial.suggest_float("pullback_max_pct", 1.0, 10.0, step=0.1), # 확장: 6.0→10.0
|
||||
)
|
||||
if combo["pullback_min_pct"] >= combo["pullback_max_pct"]:
|
||||
raise optuna.TrialPruned("pullback min >= max")
|
||||
|
||||
combo["setup_vol_max_mult"] = r2(
|
||||
trial.suggest_float("setup_vol_max_mult", 0.3, 1.5, step=0.1),
|
||||
trial.suggest_float("setup_vol_max_mult", 0.5, 3.0, step=0.1),
|
||||
)
|
||||
combo["setup_bear_bars_min"] = trial.suggest_int("setup_bear_bars_min", 0, 3)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user