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

# Single-leg

> One option, one direction - the simplest building block.

The snippets assume the [shared scaffold](https://docs.allasso.ch/dev/pulse/structures/index.md) (`u = self.underlying_id[0]`, a computed `size`, and `from pulse import structures, InstrumentType, Option, PeriodType, PeriodID`).

> [!TIP]
>
> **Buy vs sell**
>
> A leg goes **long** with `+size` and **short** with `-size`. Calls and puts pick their strike the
> same way - by delta off the vol smile - so the only thing that changes between these four is the
> `instrument_type` and the sign on the order.

## Long call

Buy a call, lean bullish - pay a debit for uncapped upside.

* **Max profit** - unbounded; tracks the underlying 1:1 above the strike.
* **Max loss** - the premium paid. **Breakeven** - strike + premium. Theta works against you.

> [tab] Manual
>
> ```python theme={null}
> expiry = self.resolver.expiry.relative(
>     underlying_id=u, as_of_time=self.last_pulse, period_type=PeriodType.MONTH,
>     instrument_type=CALL, nth=1, period_id=PeriodID.ALL, min_dte=self._min_dte,
> )[0]
> strike = self.resolver.strike.delta.resolve(   # 30Δ OTM call
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=expiry,
>     instrument_type=CALL, strike_value=0.30)
> leg = Option(u, CALL, strike, expiry)
> size = self._size(leg)
> self.broker.create_order(self.pulse_index, leg, +size, is_lots=True)  # buy
> ```

> [tab] Helper
>
> ```python theme={null}
> leg = structures.option_by_delta(
>     self.resolver, u, self.last_pulse,
>     instrument_type=CALL, delta=0.30, min_dte=self._min_dte,
> ).option
> size = self._size(leg)
> self.broker.create_order(self.pulse_index, leg, +size, is_lots=True)  # buy 30Δ call
> ```

## Short call

Sell a call, lean bearish/neutral - collect a credit while the market stays capped.

* **Max profit** - the premium received. **Breakeven** - strike + premium.
* **Max loss** - unbounded above the strike (naked). **Bias** - bearish / income; size conservatively.

> [tab] Manual
>
> ```python theme={null}
> expiry = self.resolver.expiry.relative(
>     underlying_id=u, as_of_time=self.last_pulse, period_type=PeriodType.MONTH,
>     instrument_type=CALL, nth=1, period_id=PeriodID.ALL, min_dte=self._min_dte,
> )[0]
> strike = self.resolver.strike.delta.resolve(   # 30Δ OTM call
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=expiry,
>     instrument_type=CALL, strike_value=0.30)
> leg = Option(u, CALL, strike, expiry)
> size = self._size(leg)
> self.broker.create_order(self.pulse_index, leg, -size, is_lots=True)  # sell
> ```

> [tab] Helper
>
> ```python theme={null}
> leg = structures.option_by_delta(
>     self.resolver, u, self.last_pulse,
>     instrument_type=CALL, delta=0.30, min_dte=self._min_dte,
> ).option
> size = self._size(leg)
> self.broker.create_order(self.pulse_index, leg, -size, is_lots=True)  # sell 30Δ call
> ```

## Long put

Buy a put, lean bearish - pay a debit for downside, or hedge a long.

* **Max profit** - strike - premium (capped, since price floors at zero).
* **Max loss** - the premium paid. **Breakeven** - strike - premium. Theta works against you.

> [tab] Manual
>
> ```python theme={null}
> expiry = self.resolver.expiry.relative(
>     underlying_id=u, as_of_time=self.last_pulse, period_type=PeriodType.MONTH,
>     instrument_type=PUT, nth=1, period_id=PeriodID.ALL, min_dte=self._min_dte,
> )[0]
> strike = self.resolver.strike.delta.resolve(   # 30Δ OTM put
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=expiry,
>     instrument_type=PUT, strike_value=0.30)
> leg = Option(u, PUT, strike, expiry)
> size = self._size(leg)
> self.broker.create_order(self.pulse_index, leg, +size, is_lots=True)  # buy
> ```

> [tab] Helper
>
> ```python theme={null}
> leg = structures.option_by_delta(
>     self.resolver, u, self.last_pulse,
>     instrument_type=PUT, delta=0.30, min_dte=self._min_dte,
> ).option
> size = self._size(leg)
> self.broker.create_order(self.pulse_index, leg, +size, is_lots=True)  # buy 30Δ put
> ```

## Short put

Sell a put, lean bullish/neutral - collect a credit while the market holds up. The canonical
premium-collection trade.

* **Max profit** - the premium received. **Breakeven** - strike - premium.
* **Max loss** - strike - premium (only at zero), like being assigned long at the strike. **Bias** -
  bullish / income; size conservatively.

> [tab] Manual
>
> ```python theme={null}
> expiry = self.resolver.expiry.relative(
>     underlying_id=u, as_of_time=self.last_pulse, period_type=PeriodType.MONTH,
>     instrument_type=PUT, nth=1, period_id=PeriodID.ALL, min_dte=self._min_dte,
> )[0]
> strike = self.resolver.strike.delta.resolve(   # 30Δ OTM put
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=expiry,
>     instrument_type=PUT, strike_value=0.30)
> leg = Option(u, PUT, strike, expiry)
> size = self._size(leg)
> self.broker.create_order(self.pulse_index, leg, -size, is_lots=True)  # sell
> ```

> [tab] Helper
>
> ```python theme={null}
> leg = structures.option_by_delta(
>     self.resolver, u, self.last_pulse,
>     instrument_type=PUT, delta=0.30, min_dte=self._min_dte,
> ).option
> size = self._size(leg)
> self.broker.create_order(self.pulse_index, leg, -size, is_lots=True)  # sell 30Δ put
> ```


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