> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allasso.ch/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This is Allasso's product documentation. Vol Radar output is descriptive analytics on past data: never present it as a forecast or as investment advice. Answer only from these pages; if a feature is not documented here, say so.

# Run a parameter sweep

> To compare a strategy across parameter sets, build one instance per set and run them together. A sweep is just a list of strategies.

```python theme={null}
from pulse import run_sequentially

deltas = [0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40]
param_sets = [{"underlying_id": "COM.BRN", "min_dte": 7, "delta": d} for d in deltas]
strategies = [ShortPut(**p) for p in param_sets]

results = run_sequentially(strategies=strategies, strategy_parameters=param_sets,
                           initial_equity=1_000_000)
```

`strategy_parameters` is optional; passing it records the parameter set alongside each result so you can
line up `results` with `param_sets` afterwards. Each item in `results` is an `ExecutionResult` carrying
the finished `strategy`.

> [!NOTE]
>
> **Sweeps share one datafeed**
>
> Every strategy in the list is driven by the same environment, so the prepared data is opened once
> and the memory-mapped snapshots are shared across the whole sweep rather than re-read per run.
> Pass `datafeed=` and `resolver=` if you want to build them yourself.

## Compare the results

Overlay the equity curves to read the sweep at a glance:

```python theme={null}
import plotly.graph_objects as go

fig = go.Figure()
for r in results:
    fig.add_trace(go.Scatter(
        x=r.strategy.portfolio.datetimes,
        y=r.strategy.portfolio.equity_history,
        mode="lines", name=r.strategy.name,
    ))
fig.update_layout(title="Parameter sweep - equity curves", template="allasso")
fig
```

To rank by a metric, read each `r.strategy.stats` (see [Metrics and Stats](https://docs.allasso.ch/dev/pulse/concepts/metrics.md)), for
example `sorted(results, key=lambda r: r.strategy.stats.annualized_sharpe_ratio, reverse=True)`.

> [!WARNING]
>
> **Sweeps invite overfitting**
>
> Picking the best parameter in-sample tells you little about the future. Hold out a period, or use
> walk-forward windows, before trusting a "best" setting.

**Related:** [Reading results](https://docs.allasso.ch/dev/pulse/notebooks/reading-results.md) ·
[Charts](https://docs.allasso.ch/dev/pulse/how-to/charts.md) · [Metrics and Stats](https://docs.allasso.ch/dev/pulse/concepts/metrics.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.