1. Trading Strategy Optimization Overview
Optimization searches the parameter space for combinations that improve the objective function (e.g., maximizing Sharpe ratio). In essence, it is repeated backtesting plus objective-function comparison.
1.1. Overview
Purpose: Within the strategy’s tunable parameter ranges, use search or optimization algorithms to find better-performing parameters (such as moving-average periods or thresholds).
Relation to backtesting: Optimization = many backtests (one parameter set each) + compare and rank by the objective function (e.g., Sharpe ratio or drawdown), then pick the best or Top-K sets.
1.2. Optimization Workflow Overview
Set parameter space and objective: The strategy’s
Parameterobjects andpar_rangedefine the search space; the objective function is set in configuration (e.g., maximize Sharpe ratio).Choose an optimization algorithm:
opti_methodcan begrid,montecarlo,GA,SA,PSO,bayesian, and others.qt.run(mode=2): Run strategy optimization.Read results and best parameters: Extract the best parameter combination and Top-K results from the returned object.
1.3. Chapter Guide in This Section
2. How to Run Strategy Optimization — Entry point, optimization algorithms and run-parameter lists, parameter space, and a minimal example.
3. Optimization Algorithms: Differences and Use Cases — Algorithm comparison and selection advice.
4. Optimization Result Structure and Access — Return values, result fields, and reading best and Top-K results.
5. Analyzing and Using Optimization Results — Result analysis, objectives and constraints, applying best parameters to the strategy, and caveats.
For more algorithm details, see the optimization references (e.g., references/5-optimize-strategy.md).