feat: Enhance trading system with new e_min_chg_pct parameter and related logic

Changes:
- Introduced the `e_min_chg_pct` parameter to define the minimum price change percentage compared to the previous day's close, enhancing the momentum trading strategy.
- Updated various functions and classes to incorporate this new parameter, ensuring it is utilized in both backtesting and live trading scenarios.
- Improved documentation and comments to clarify the purpose and usage of the new parameter across the codebase.

Impact:
- This addition allows for more precise control over trading conditions, potentially increasing the effectiveness of the momentum strategy while maintaining system integrity and performance.
This commit is contained in:
Your Name
2026-08-01 16:19:24 +09:00
parent 7050f788c5
commit cb7e5037a0
30 changed files with 2206 additions and 253 deletions

View File

@@ -121,6 +121,8 @@ def get_momentum_defaults_from_db(db=None, *, env_row: Optional[Dict[str, Any]]
mom_vol_mult = momentum_env_float(r, "MOMENTUM_VOL_MULT", 1.05)
mom_vol_win = momentum_env_int(r, "MOMENTUM_VOL_WIN", 5)
mom_time_end = momentum_env_int(r, "MOMENTUM_TIME_END_HM", 1530)
# HTS K: 전일 종가 대비 최소 등락률(%). 0=단순 종가 초과만. HTS 기본 0.2.
e_min_chg_pct = momentum_env_float(r, "MOMENTUM_E_MIN_CHG_PCT", 0.2)
sl_pct = abs(_legacy_float(
r, "MOMENTUM_STOP_LOSS_PCT", ("SCALP_STOP_LOSS_PCT",), 0.03,
))
@@ -184,6 +186,7 @@ def get_momentum_defaults_from_db(db=None, *, env_row: Optional[Dict[str, Any]]
except Exception:
rsi_period, mom_rsi_min, mom_rsi_max = 3, 50.0, 80.0
mom_vol_mult, mom_vol_win, mom_time_end = 1.2, 5, 1530
e_min_chg_pct = 0.2
sl_pct, tp_pct, tp_max = 0.03, 0.08, 0.10
shoulder_high, shoulder_cut = 0.005, 0.003
ratchet_tiers, trail_pct, trail_arm_pct = "", 0.02, 0.01
@@ -216,6 +219,7 @@ def get_momentum_defaults_from_db(db=None, *, env_row: Optional[Dict[str, Any]]
"mom_vol_mult": mom_vol_mult,
"mom_vol_win": mom_vol_win,
"mom_time_end_hm": mom_time_end,
"e_min_chg_pct": e_min_chg_pct,
"mom_max_from_open_pct": mom_max_open,
"mom_min_from_open_pct": mom_min_open,
"sl_pct": sl_pct,