alpha = -math.log(tau) / _LOG_2
else:
warnings.warn(
- f"Param: exit_power_tau={tau} outside (0,1]; falling back to alpha=1.0",
+ f"Param: exit_power_tau={tau} outside (0,1]; falling back to 1.0",
RewardDiagnosticsWarning,
stacklevel=2,
)
time_attenuation_coefficient = kernel(effective_dr)
except Exception as e:
warnings.warn(
- f"Param: exit_attenuation_mode='{exit_attenuation_mode}' failed ({e!r}); falling back to linear",
+ f"Param: exit_attenuation_mode='{exit_attenuation_mode}' failed ({e!r}); falling back to 'linear'",
RewardDiagnosticsWarning,
stacklevel=2,
)
if exit_factor_threshold > 0 and np.isfinite(exit_factor_threshold): # noqa: SIM102
if abs(exit_factor) > exit_factor_threshold:
warnings.warn(
- f"Param: |exit_factor|={abs(exit_factor):.2f} > threshold={exit_factor_threshold:.2f}",
+ f"Param: |exit_factor|={abs(exit_factor):.6g} > threshold={exit_factor_threshold:.6g}",
RewardDiagnosticsWarning,
stacklevel=2,
)
if efficiency_coefficient < 0.0:
if _get_bool_param(params, "check_invariants"):
warnings.warn(
- f"Param: efficiency_coefficient={efficiency_coefficient:.4f} < 0; falling back to 0.0",
+ f"Param: efficiency_coefficient={efficiency_coefficient:.6g} < 0; falling back to 0.0",
RewardDiagnosticsWarning,
stacklevel=2,
)
ci_low, ci_high = lower, upper
results[metric] = (mean, ci_low, ci_high)
warnings.warn(
- f"Stats: bootstrap_ci for '{metric}' degenerate (width={width:.2e}); adjusted to epsilon={epsilon:.1e}",
+ f"Stats: bootstrap_ci for '{metric}' degenerate (width={width:.6g}); falling back to epsilon={epsilon:.6g}",
RewardDiagnosticsWarning,
stacklevel=2,
)
label_weights = self.ft_params.get("label_weights")
if label_weights is not None:
- logger.info(f" label_weights: {label_weights}")
+ formatted_label_weights = [format_number(w) for w in label_weights]
+ logger.info(f" label_weights: [{', '.join(formatted_label_weights)}]")
else:
logger.info(
" label_weights: [1.0, ...] * n_objectives, l1 normalized (default)"
self.set_optuna_label_candle(pair)
self._optuna_label_candles[pair] = 0
else:
- logger.info(
+ logger.debug(
f"[{pair}] Optuna {namespace} callback throttled, still {optuna_label_remaining_candles} candles to go"
)
if len(self._optuna_label_incremented_pairs) >= len(self.pairs):
logger.info("Extrema Weighting:")
logger.info(f" strategy: {self.extrema_weighting['strategy']}")
- logger.info(f" source_weights: {self.extrema_weighting['source_weights']}")
+ formatted_source_weights = {
+ k: format_number(v)
+ for k, v in self.extrema_weighting["source_weights"].items()
+ }
+ logger.info(f" source_weights: {formatted_source_weights}")
logger.info(f" aggregation: {self.extrema_weighting['aggregation']}")
logger.info(
f" aggregation_normalization: {self.extrema_weighting['aggregation_normalization']}"
pair=trade.pair,
current_time=current_time,
callback=lambda: logger.info(
- f"Trade {trade.trade_direction} {trade.pair} stage {trade_exit_stage} | "
+ f"[{trade.pair}] Trade {trade.trade_direction} stage {trade_exit_stage} | "
f"Take Profit: {format_number(trade_take_profit_price)}, Rate: {format_number(current_rate)}"
),
)
initial_trade_partial_stake_amount = trade_partial_stake_amount
trade_partial_stake_amount = trade.stake_amount - min_stake
logger.info(
- f"Trade {trade.trade_direction} {trade.pair} stage {trade_exit_stage} | "
+ f"[{trade.pair}] Trade {trade.trade_direction} stage {trade_exit_stage} | "
f"Partial stake amount adjusted from {format_number(initial_trade_partial_stake_amount)} to {format_number(trade_partial_stake_amount)} to respect min_stake {format_number(min_stake)}"
)
return (
pair=pair,
current_time=current_time,
callback=lambda: logger.info(
- f"Trade {trade.trade_direction} {trade.pair} stage {trade_exit_stage} | "
+ f"[{trade.pair}] Trade {trade.trade_direction} stage {trade_exit_stage} | "
f"Take Profit: {format_number(trade_take_profit_price)}, Rate: {format_number(current_rate)}"
),
)
pair=pair,
current_time=current_time,
callback=lambda: logger.info(
- f"Trade {trade.trade_direction} {trade.pair} stage {trade_exit_stage} | "
+ f"[{trade.pair}] Trade {trade.trade_direction} stage {trade_exit_stage} | "
f"Take Profit: {format_number(trade_take_profit_price)}, Rate: {format_number(current_rate)} | "
f"Declining: {trade_recent_pnl_declining} "
f"(tV:{format_number(t_trade_recent_velocity)}<=-t:{format_number(-t_crit_trade_recent_velocity)}, tA:{format_number(t_trade_recent_acceleration)}<=-t:{format_number(-t_crit_trade_recent_acceleration)})"