> ## 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.

# Getting started

> Pulse is a Python backtesting framework for options and futures strategies. You write a Strategy, run it over historical data, and read back equity, trades, greeks and metrics.

Pulse is a Python backtesting framework for options and futures strategies. You write a `Strategy`,
run it over historical data, and read back equity, trades, greeks and metrics.

## Where you run it

Pulse runs in your [Coder](https://docs.allasso.ch/dev/pulse/get-started/coder.md) workspace. Pulse and the market data are already set up there, so you can start writing a strategy immediately.

## Your first backtest

On Coder this runs as-is. A short put on Brent crude (`COM.BRN`), rolled monthly:

```python theme={null}
from pulse import Strategy, run_sequentially, InstrumentType, PeriodType, PeriodID

class ShortPut(Strategy):
    def __init__(self):
        super().__init__(name="My first backtest", underlying_id="COM.BRN")

    def on_update(self) -> None:
        if self.has_open_trades:          # hold one position at a time
            return
        u = self.underlying_id[0]
        expiry = self.resolver.expiry.relative(
            underlying_id=u, as_of_time=self.last_pulse, instrument_type=InstrumentType.PUT,
            nth=1, min_dte=30, period_type=PeriodType.MONTH, period_id=PeriodID.ALL,
        )[0]
        strike = self.resolver.strike.delta.resolve(
            underlying_id=u, as_of_time=self.last_pulse, expiration_date=expiry,
            instrument_type=InstrumentType.PUT, strike_value=0.30,    # 30-delta put
        )
        self.sell(u, InstrumentType.PUT, expiry, strike, 1, is_lots=True)

result = run_sequentially([ShortPut()], initial_equity=1_000_000)[0]
print(result.strategy.stats)
```

What each piece does:

* `on_update()` runs once per pulse; it places orders, which fill the same pulse (see
  [Architecture and the pulse loop](https://docs.allasso.ch/dev/pulse/concepts/architecture.md)).
* The resolvers turn "30-delta put, monthly, at least 30 days out" into a concrete strike and expiry
  (see [Resolvers](https://docs.allasso.ch/dev/pulse/concepts/resolvers.md)).
* `run_sequentially` assembles the environment from local defaults (the data under `PDC_PATH`, a
  timeline built from the underlying's settlement calendar) and runs the loop; the result carries the
  finished `strategy` with its `stats`. It takes a list, so the same call runs a whole
  [sweep](https://docs.allasso.ch/dev/pulse/how-to/parameter-sweeps.md).

> [!WARNING]
>
> **Set `PDC_PATH` before `import pulse`**
>
> Market data is read from the directory named by the `PDC_PATH` environment variable, and the data
> layer binds it at **import time**. Setting it inside a running session or notebook kernel is too
> late. On Coder it is preconfigured.

If a strategy can't find data, see [Gotchas & FAQ](https://docs.allasso.ch/dev/pulse/reference/gotchas-faq.md).

> [!TIP]
>
> **Where to go next**
>
> * Read results properly: [Metrics and Stats](https://docs.allasso.ch/dev/pulse/concepts/metrics.md), and the charts +
>   `StrategyReport`.
> * Build other shapes: the [Structures](https://docs.allasso.ch/dev/pulse/structures/index.md) recipes (spreads, strangles,
>   condors, ...), each with a manual and a helper version.
> * Understand the model: the [Concepts](https://docs.allasso.ch/dev/pulse/concepts/index.md) section.
> * Working examples: the [Notebooks](https://docs.allasso.ch/dev/pulse/notebooks/quickstart.md).


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