| _Reversal confirmation_ | | | |
| reversal_confirmation.lookback_period_candles | 0 | int >= 0 | Prior confirming candles; 0 = none. |
| reversal_confirmation.decay_fraction | 0.5 | float (0,1] | Geometric per-candle volatility adjusted reversal threshold relaxation factor. |
-| reversal_confirmation.min_natr_multiplier_fraction | 0.0095 | float [0,1] | Lower bound fraction for volatility adjusted reversal threshold. |
-| reversal_confirmation.max_natr_multiplier_fraction | 0.0125 | float [0,1] | Upper bound fraction (>= lower bound) for volatility adjusted reversal threshold. |
+| reversal_confirmation.min_natr_multiplier_fraction | 0.0095 | float [0,1] | Lower bound fraction (< upper bound) for volatility adjusted reversal threshold. |
+| reversal_confirmation.max_natr_multiplier_fraction | 0.0125 | float [0,1] | Upper bound fraction (> lower bound) for volatility adjusted reversal threshold. |
| _Regressor model_ | | | |
| freqai.regressor | `xgboost` | enum {`xgboost`,`lightgbm`,`histgradientboostingregressor`,`ngboost`,`catboost`} | Machine learning regressor algorithm. |
| _Model training parameters_ | | | |
allow_equal=False,
non_negative=True,
finite_only=True,
+ max_value=1,
)
return {
allow_equal: bool = False,
non_negative: bool = True,
finite_only: bool = True,
+ max_value: float | int | None = None,
) -> tuple[float | int, float | int]:
min_name = f"min_{name}"
max_name = f"max_{name}"
f"Invalid {name}: defaults ordering must have min < max, "
f"got min={default_min!r}, max={default_max!r}"
)
+ if max_value is not None and (default_min > max_value or default_max > max_value):
+ raise ValueError(
+ f"Invalid {name}: defaults must be <= {max_value!r}, "
+ f"got min={default_min!r}, max={default_max!r}"
+ )
def _validate_component(
value: float | int | None, name: str, default_value: float | int
if non_negative:
constraints.append("non-negative")
constraints.append("numeric")
+ if max_value is not None:
+ constraints.append(f"<= {max_value}")
constraint_str = " ".join(constraints)
if (
not isinstance(value, (int, float))
or isinstance(value, bool)
or (finite_only and not _is_finite_value(value))
or (non_negative and value < 0)
+ or (max_value is not None and value > max_value)
):
logger.warning(
f"Invalid {name} {value!r}: must be {constraint_str}, using default {default_value!r}"