refactor: enhance Optuna backtesting framework, optimize orderbook filtering, and update database management utilities.
This commit is contained in:
@@ -49,13 +49,13 @@ def suggest_scalp_params_tpe(trial: optuna.Trial) -> Dict[str, Any]:
|
||||
if combo["rsi_oversold"] >= combo["rsi_overbought"]:
|
||||
raise optuna.TrialPruned("rsi oversold >= overbought")
|
||||
|
||||
combo["sl_pct"] = r2(trial.suggest_float("sl_pct", 1.5, 4.5, step=0.1))
|
||||
combo["tp_pct"] = r2(trial.suggest_float("tp_pct", 1.5, 4.0, step=0.1))
|
||||
combo["tp_max_pct"] = r2(trial.suggest_float("tp_max_pct", 2.0, 8.0, step=0.5))
|
||||
combo["sl_pct"] = r2(trial.suggest_float("sl_pct", 1.0, 6.0, step=0.1)) # 확장: 1.5→1.0, 4.5→6.0
|
||||
combo["tp_pct"] = r2(trial.suggest_float("tp_pct", 0.5, 8.0, step=0.1)) # 확장: 1.5→0.5, 4.0→8.0
|
||||
combo["tp_max_pct"] = r2(trial.suggest_float("tp_max_pct", 1.0, 12.0, step=0.5)) # 확장: 2.0→1.0, 8.0→12.0
|
||||
if combo["tp_max_pct"] + 1e-9 < combo["tp_pct"]:
|
||||
raise optuna.TrialPruned("tp_max < tp")
|
||||
|
||||
combo["drop_rate"] = r2(trial.suggest_float("drop_rate", 1.0, 6.0, step=0.1))
|
||||
combo["drop_rate"] = r2(trial.suggest_float("drop_rate", 0.5, 10.0, step=0.1)) # 확장: 1.0→0.5, 6.0→10.0
|
||||
combo["shoulder_min_high"] = r2(
|
||||
trial.suggest_float("shoulder_min_high", 0.3, 4.0, step=0.1),
|
||||
)
|
||||
@@ -66,7 +66,7 @@ def suggest_scalp_params_tpe(trial: optuna.Trial) -> Dict[str, Any]:
|
||||
combo["high_chase_thr"] = r3(
|
||||
trial.suggest_float("high_chase_thr", 0.95, 1.0, step=0.005),
|
||||
)
|
||||
combo["max_daily_chg"] = r1(trial.suggest_float("max_daily_chg", 10.0, 50.0, step=1.0))
|
||||
combo["max_daily_chg"] = r1(trial.suggest_float("max_daily_chg", 5.0, 60.0, step=1.0)) # 확장: 10→5, 50→60
|
||||
combo["min_price"] = trial.suggest_int("min_price", 1000, 8000, step=500)
|
||||
combo["vol_mult"] = r2(trial.suggest_float("vol_mult", 0.0, 2.0, step=0.1))
|
||||
combo["use_defense_filters"] = trial.suggest_categorical(
|
||||
@@ -80,8 +80,8 @@ def suggest_scalp_params_tpe(trial: optuna.Trial) -> Dict[str, Any]:
|
||||
trial.suggest_float("min_drop_pct_for_loss_cut", 0.005, 0.03, step=0.001),
|
||||
)
|
||||
combo["min_margin"] = r2(trial.suggest_float("min_margin", 0.05, 0.5, step=0.05))
|
||||
combo["min_hold_sec"] = trial.suggest_int("min_hold_sec", 0, 120, step=10)
|
||||
combo["max_daily"] = trial.suggest_int("max_daily", 10, 100, step=5)
|
||||
combo["min_hold_sec"] = trial.suggest_int("min_hold_sec", 0, 300, step=10) # 확장: 120→300초
|
||||
combo["max_daily"] = trial.suggest_int("max_daily", 5, 150, step=5) # 확장: 10→5, 100→150
|
||||
|
||||
combo["use_macd_cross"] = False
|
||||
combo["skip_hts_scan_dupes"] = False
|
||||
|
||||
Reference in New Issue
Block a user