Would refitting have helped? (out of sample)
walk_forwardWhether re-optimising an allocation would have helped: fit on the years before each date, hold on prices it had not seen, repeat, and compare that record with the portfolio actually held and with equal weights. Use it only when the reader asks whether an optimiser would have beaten what they hold; it is not for choosing weights. tickers are the candidates (2 to 30); holdings, if given, is the portfolio compared against; objective picks what each fit maximises (default max_sharpe); train_years and step_months set how much history each fit uses and how often it refits. Returns the record, never an allocation to hold.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Currency every figure is expressed in (USD, EUR, GBP, CAD…). Default USD. | |
| tickers | Yes | The candidate holdings, 2 to 30. | |
| holdings | No | Optional: the portfolio actually held, {ticker: weight}, measured on the same span for comparison. | |
| objective | No | What each refit maximises or minimises: max_sharpe, min_variance, min_drawdown, min_cvar or max_quadratic_utility. | max_sharpe |
| step_months | No | Months each fitted mix is held. | |
| train_years | No | Years of history each refit sees. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Where the prices came from and what was missing or repaired. | |
| _fence | Yes | What these figures are and are not: descriptive, no forecast, no advice. Repeat its sense when presenting the result. | |
| objective | No | What each refit optimised. | |
| fitted_window | No | First and last date of shared history. | |
| out_of_sample | No | start, end, n_refits, train_years, step_months, mean_turnover, verdict (one sentence on the record), limitations, tracks (per track: label, cagr, vol, sharpe, max_drawdown, nav), refits (date, turnover); or `unavailable` with the reason. |