]> Piment Noir Git Repositories - freqai-strategies.git/commit
refactor(quickadapter)!: normalize tunables namespace for semantic consistency (#26)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 28 Dec 2025 18:51:56 +0000 (19:51 +0100)
committerGitHub <noreply@github.com>
Sun, 28 Dec 2025 18:51:56 +0000 (19:51 +0100)
commit286cfda4e18ccb1cd40f8bd631f8ee0f117d617e
tree00baa04498cc4945505b9ee887bb09f954cd772b
parent6ae066c91237df40d74f941f14fc56f3a2bbcd6a
refactor(quickadapter)!: normalize tunables namespace for semantic consistency (#26)

* refactor(quickadapter): normalize tunables namespace for semantic consistency

Rename config keys and internal variables to follow consistent naming conventions:
- `_candles` suffix for time periods in candle units
- `_fraction` suffix for values in [0,1] range
- `_multiplier` suffix for scaling factors
- `_method` suffix for algorithm selectors

Config key renames (with backward-compatible deprecated aliases):
- lookback_period → lookback_period_candles
- decay_ratio → decay_fraction
- min/max_natr_ratio_percent → min/max_natr_ratio_fraction
- window → window_candles
- label_natr_ratio → label_natr_multiplier
- threshold_outlier → outlier_threshold_fraction
- thresholds_smoothing → threshold_smoothing_method
- thresholds_alpha → soft_extremum_alpha
- extrema_fraction → keep_extrema_fraction
- expansion_ratio → space_fraction
- trade_price_target → trade_price_target_method

Internal variable renames for code consistency:
- threshold_outlier → outlier_threshold_fraction
- thresholds_alpha → soft_extremum_alpha
- extrema_fraction → keep_extrema_fraction (local vars and function params)
- _reversal_lookback_period → _reversal_lookback_period_candles
- natr_ratio → natr_multiplier (zigzag function param)

All deprecated aliases emit warnings and remain functional for backward compatibility.

* chore(quickadapter): remove temporary audit file from codebase

* refactor(quickadapter): align constant names with normalized tunables

Rename class constants to match the normalized config key names:
- PREDICTIONS_EXTREMA_THRESHOLD_OUTLIER_DEFAULT → PREDICTIONS_EXTREMA_OUTLIER_THRESHOLD_FRACTION_DEFAULT
- PREDICTIONS_EXTREMA_THRESHOLDS_ALPHA_DEFAULT → PREDICTIONS_EXTREMA_SOFT_EXTREMUM_ALPHA_DEFAULT
- PREDICTIONS_EXTREMA_EXTREMA_FRACTION_DEFAULT → PREDICTIONS_EXTREMA_KEEP_EXTREMA_FRACTION_DEFAULT

* fix(quickadapter): rename outlier_threshold_fraction to outlier_threshold_quantile

The value (e.g., 0.999) represents the 99.9th percentile, which is
mathematically a quantile, not a fraction. This aligns the naming with
the semantic meaning of the parameter.

* fix(quickadapter): add missing deprecated alias support

Add backward-compatible deprecated alias handling for:
- freqai.optuna_hyperopt.expansion_ratio → space_fraction
- freqai.feature_parameters.min_label_natr_ratio → min_label_natr_multiplier
- freqai.feature_parameters.max_label_natr_ratio → max_label_natr_multiplier

Also add missing deprecated alias documentation in README for:
- reversal_confirmation.min_natr_ratio_percent → min_natr_ratio_fraction
- reversal_confirmation.max_natr_ratio_percent → max_natr_ratio_fraction

This ensures all deprecated aliases mentioned in the commit message of the
namespace normalization refactor are properly implemented.

* style(readme): normalize trailing whitespace

* fix(quickadapter): address PR review feedback

- Fix error message referencing 'window' instead of 'window_candles'
- Clarify soft_extremum_alpha error message (alpha=0 uses mean)
- Improve space_fraction documentation in README
- Simplify midpoint docstring

* refactor(quickadapter): rename safe configuration value retrieval helper

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* refactor(quickadapter): rename natr_ratio_fraction to natr_multiplier_fraction

- Align naming with label_natr_multiplier for consistency
- Rename get_config_value_with_deprecated_alias to get_config_value

* refactor(quickadapter): centralize label_natr_multiplier migration in get_label_defaults

- Move label_natr_ratio -> label_natr_multiplier migration to get_label_defaults()
- Update get_config_value to migrate in-place (pop old key, store new key)
- Remove redundant get_config_value calls in Strategy and Model __init__
- Simplify cached properties to use .get() since migration is done at init
- Rename _CUSTOM_STOPLOSS_NATR_RATIO_FRACTION to _CUSTOM_STOPLOSS_NATR_MULTIPLIER_FRACTION

* fix(quickadapter): check that df columns exist before using them

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* docs(README.md): update QuickAdapter strategy documentation

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* chore(quickadapter): bump version to 3.8.0

* refactor(quickadapter): remove unnecessary intermediate variable

* refactor(quickadapter): add cached properties for label_period_candles bounds

* chore(quickadapter): cleanup docstrings and comments

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
---------

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
.opencode/command/openspec-apply.md
.opencode/command/openspec-archive.md
.opencode/command/openspec-proposal.md
AGENTS.md
README.md
openspec/project.md
quickadapter/user_data/config-template.json
quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py
quickadapter/user_data/strategies/QuickAdapterV3.py
quickadapter/user_data/strategies/Utils.py