| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- from __future__ import annotations
- from dataclasses import dataclass, field, replace
- @dataclass(frozen=True)
- class StrategyConfig:
- disabled_rules: frozenset[str] = field(default_factory=frozenset)
- post_exit_confirmation_window_days: int = 10
- aux_sell_same_side_once_per_cycle: bool = True
- aux_sell_duplicate_cooldown_days: int = 5
- aux_sell_high_zone_kdj_only_block_c1: float = 85.0
- aux_sell_high_zone_kdj_only_block_b1: float = -0.02
- aux_sell_high_zone_warning_c1: float = 80.0
- aux_sell_strong_break_c1: float = 60.0
- aux_sell_strong_break_b1: float = -0.05
- aux_sell_stronger_c1_delta: float = 8.0
- aux_sell_stronger_b1_delta: float = 0.05
- aux_sell_high_zone_rearm_c1_delta: float = 2.0
- state_crash_followthrough_window_days: int = 5
- state_crash_followthrough_repeat_cooldown_days: int = 4
- state_crash_followthrough_c1_max: float = 80.0
- state_crash_followthrough_a1_max: float = 0.01
- state_crash_followthrough_b1_max: float = -0.15
- glued_high_weak_rebound_high_c1: float = 68.0
- glued_high_weak_rebound_high_b1: float = -0.08
- glued_high_weak_rebound_mid_c1: float = 50.0
- glued_high_weak_rebound_mid_b1: float = -0.15
- glued_high_weak_rebound_ql_c1_low: float = 35.0
- glued_high_weak_rebound_ql_c1_high: float = 55.0
- glued_high_weak_rebound_ql_b1: float = -0.06
- glued_high_weak_rebound_ql_a1: float = -0.013
- glued_followthrough_pending_enabled: bool = False
- glued_followthrough_confirm_window_bars: int = 3
- glued_followthrough_allow_mid_zone_very_weak_b1: bool = False
- glued_followthrough_allow_high_zone_weak_b1: bool = False
- glued_followthrough_allow_ql_rebound_weak_followthrough: bool = False
- glued_followthrough_require_ql_buy_reconfirm: bool = True
- glued_followthrough_require_close_break_signal_close: bool = True
- glued_followthrough_require_b1_repair: bool = True
- glued_followthrough_b1_repair_min: float = 0.02
- glued_followthrough_exit_hold_kdj_only_enabled: bool = False
- glued_followthrough_exit_hold_kdj_only_days_max: int = 12
- glued_followthrough_exit_hold_kdj_only_c1_low: float = 55.0
- glued_followthrough_exit_hold_kdj_only_c1_high: float = 60.0
- glued_followthrough_exit_hold_kdj_only_a1_min: float = 0.0
- glued_followthrough_exit_hold_kdj_only_b1_min: float = -0.02
- glued_selective_hot_c1_min: float = 0.0
- glued_selective_hot_c1_max: float = 999.0
- glued_selective_hot_b1_min: float = 1.0
- glued_selective_low_c1_min: float = 0.0
- glued_selective_low_c1_max: float = 0.0
- glued_selective_low_b1_max: float = -999.0
- deep_oversold_filter1_c1_low: float = 13.0
- deep_oversold_filter1_c1_high: float = 15.0
- deep_oversold_filter1_a1_min: float = -0.04
- deep_oversold_filter1_b1_max: float = -0.08
- deep_oversold_filter2_c1_low: float = 13.0
- deep_oversold_filter2_c1_high: float = 14.5
- deep_oversold_filter2_a1_min: float = -0.04
- deep_oversold_filter2_b1_min: float = -0.06
- deep_oversold_entry_c1_max: float = 16.0
- deep_oversold_entry_a1_min: float = -0.09
- deep_oversold_entry_b1_min: float = -0.10
- deep_oversold_shallow_ql_fallback: bool = True
- deep_oversold_positive_b1_fallback_a1_min: float = -0.02
- deep_oversold_block_positive_b1_rebound: bool = False
- deep_oversold_block_shallow_false_start_without_ql: bool = False
- deep_oversold_confirm_weak_with_ql: bool = False
- deep_oversold_confirm_window_bars: int = 2
- deep_oversold_selective_positive_b1_c1_max: float = 0.0
- deep_oversold_selective_shallow_c1_min: float = 0.0
- deep_oversold_selective_shallow_b1_min: float = 1.0
- deep_oversold_selective_mixed_c1_max: float = 0.0
- deep_oversold_selective_mixed_require_no_ql: bool = False
- oversold_recovery_c1_low: float = 18.0
- oversold_recovery_c1_high: float = 22.0
- oversold_recovery_a1_min: float = -0.03
- oversold_recovery_a1_max: float = 0.0
- oversold_recovery_b1_min: float = -0.02
- oversold_reversal_after_ql_block_c1_low: float = 23.0
- oversold_reversal_after_ql_block_c1_high: float = 26.0
- oversold_reversal_after_ql_block_b1_min: float = -0.12
- oversold_reversal_after_ql_block_a1_min: float = -0.035
- oversold_reversal_after_ql_entry_c1_low: float = 20.0
- oversold_reversal_after_ql_entry_c1_high: float = 26.0
- oversold_reversal_after_ql_entry_a1_min: float = -0.04
- oversold_reversal_after_ql_entry_a1_max: float = 0.0
- oversold_reversal_after_ql_entry_b1_min: float = -0.22
- oversold_reversal_after_ql_entry_b1_max: float = 0.0
- post_sell_rebound_block_high_c1: float = 22.0
- post_sell_rebound_block_high_a1_min: float = -0.035
- post_sell_rebound_block_high_b1_max: float = -0.07
- post_sell_rebound_block_low_c1: float = 15.0
- post_sell_rebound_block_low_a1_min: float = -0.04
- post_sell_rebound_block_low_b1_max: float = -0.095
- post_sell_rebound_entry1_c1_low: float = 18.0
- post_sell_rebound_entry1_c1_high: float = 30.0
- post_sell_rebound_entry1_a1_min: float = -0.045
- post_sell_rebound_entry1_a1_max: float = 0.0
- post_sell_rebound_entry1_b1_low: float = -0.09
- post_sell_rebound_entry1_b1_high: float = -0.04
- post_sell_rebound_entry2_c1_high: float = 19.0
- post_sell_rebound_entry2_a1_min: float = -0.04
- post_sell_rebound_entry2_a1_max: float = 0.0
- post_sell_rebound_entry2_b1_low: float = -0.13
- post_sell_rebound_entry2_b1_high: float = -0.09
- predictive_b1_break_short_holding_days_max: int = 2
- predictive_b1_break_short_a1_min: float = -0.02
- predictive_b1_break_short_a1_max: float = 0.0
- predictive_b1_break_short_b1_max: float = -0.13
- predictive_b1_break_short_c1_low: float = 50.0
- predictive_b1_break_short_c1_high: float = 70.0
- predictive_b1_break_long_holding_days_min: int = 40
- predictive_b1_break_long_max_c1: float = 80.0
- predictive_b1_break_long_max_a1: float = 0.15
- predictive_b1_break_long_max_b1: float = 0.30
- predictive_b1_break_long_ql_days_max: int = 7
- predictive_b1_break_long_a1_min: float = -0.02
- predictive_b1_break_long_a1_max: float = 0.0
- predictive_b1_break_long_b1_max: float = -0.12
- predictive_b1_break_long_c1_low: float = 60.0
- predictive_b1_break_long_c1_high: float = 65.0
- enable_knife_take_profit_2_wait_ql: bool = True
- def with_updates(self, **kwargs) -> "StrategyConfig":
- if "disabled_rules" in kwargs and not isinstance(kwargs["disabled_rules"], frozenset):
- kwargs["disabled_rules"] = frozenset(kwargs["disabled_rules"])
- return replace(self, **kwargs)
|