| 1234567891011121314151617181920212223242526272829303132 |
- from __future__ import annotations
- from dragon_strategy_config import StrategyConfig
- def should_hold_glued_followthrough_reentry_kdj_only(
- *,
- enabled: bool,
- entry_reason_code: str,
- kdj_sell: bool,
- ql_sell: bool,
- holding_days: int,
- a1: float,
- b1: float,
- c1: float,
- config: StrategyConfig,
- ) -> bool:
- if not enabled:
- return False
- if entry_reason_code != "entry_glued_followthrough_reentry":
- return False
- if not kdj_sell or ql_sell:
- return False
- if holding_days > config.glued_followthrough_exit_hold_kdj_only_days_max:
- return False
- if not (config.glued_followthrough_exit_hold_kdj_only_c1_low < c1 < config.glued_followthrough_exit_hold_kdj_only_c1_high):
- return False
- if a1 <= config.glued_followthrough_exit_hold_kdj_only_a1_min:
- return False
- if b1 <= config.glued_followthrough_exit_hold_kdj_only_b1_min:
- return False
- return True
|