Optimize a portfolio
optimize_portfolioSearch a portfolio's allocations — some may go to 0 — for the best score on the first 70% of its last run, then show how that did on the last 30% (which the search never saw) next to the current allocations and equal ones. The last 30% is the honest number; say so. Needs a run first (run_portfolio). Free: it re-weights the run's results. Nothing changes unless apply is true — ask the user before applying. Objectives: avg_month, green_months, min_drawdown, fast_recovery (these two never at a lower return than now), sharpe, return_over_dd.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| cap | No | The most any one strategy may have, 0–1. Default 0.4. | |
| apply | No | Take the answer: set its allocations on the portfolio. | |
| objective | Yes |