generate_strategy_params
Generates strategy parameters code from a JSON configuration, automatically assigning parameters to components, registering with the framework, and building Optuna search spaces with crossover constraints.
Instructions
Generate strategy_params.py from params_to_optimize.json.
Deterministic code generation: parses the JSON → determines parameter
ownership across components → emits ComponentParameterTemplate classes
+ framework registration + optuna_search_space with crossover
constraints → writes the target file. Period parameters that exceed
the frequency-appropriate indicator cap are auto-clamped and reported.
Args:
params_file_path: Absolute path to ``params_to_optimize.json``.
output_path: Absolute path to write ``strategy_params.py``.
frequency: ``"interday"`` (caps: TEMA≤62, ADX≤93, default≤180)
or ``"intraday"`` (caps: TEMA≤500, ADX≤750, default≤1000).
Returns ``{"success": bool, "output_path": str, "corrections":
[{"param", "type", "old_*", "new_*", "cap", "category", "changes"?}],
"message": str}``. Parse / IO failures surface as
``success=False`` rather than raising.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params_file_path | Yes | ||
| output_path | Yes | ||
| frequency | No | interday |