- DTE-based rolling - the strangle (short call + short put) is rolled whenever the current options fall below
min_dtedays to expiry - Daily delta hedging - the net options delta is neutralized each day using a front-month futures contract
Imports
We need the standard Pulse building blocks plusInstrumentType.FUTURE for the delta hedge leg.
Strategy Design
TheDeltaHedgedShortStrangle strategy has four helper methods and a simple main loop:
Helpers
Roll trigger - _should_roll()
Returns True when:
- No strangle is open yet, or
- The DTE of the current options (read live from the datafeed) has fallen below
min_dte
Roll - _roll_strangle()
- Closes the existing strangle and hedge atomically so the books go flat
- Resolves fresh call and put instruments via
_resolve_strangle_instruments() - Sells both legs with
is_lots=True-lotsis in contract lots, multiplied bycontract_sizeinternally - Calls
_enter_hedge()to open the initial futures position for this cycle
Hedge entry - _enter_hedge(call, put)
Resolves the futures expiry to match the option DTE (not a fixed offset), ensuring the hedge tracks the same underlying forward contract. Opens the initial futures position via broker.create_order.
Hedge rebalance - _rebalance_hedge()
On every non-roll day, calls _calculate_hedge_quantity() on the current strangle legs and calls Trade.rebalance(quantity) on the open hedge trade - adjusting the quantity in-place without generating a new trade entry.
Lots vs. Units
Running the Backtest
We initialise the strategy on Brent Crude (COM.BRN) with:run_sequentially wires up the datafeed, resolver, broker, and portfolio, then drives the strategy day-by-day through the full history.
Output
Performance Metrics
Output
Equity Curve

Inspecting Trades
Every completed trade is stored instrategy.trades. Each trade records its instrument, quantity, open/close prices, and final P&L.
Output
Comparing Hedged vs. Unhedged
To see how much the delta hedge matters, we can run both variants side-by-side. The unhedged version is identical except_delta_hedge is never called - achieved simply by subclassing and overriding on_update.
Output

Inspecting the Hedge
We can visualise how the delta hedge tracked the strangle’s net delta across the first strangle cycle. The three trades of the first cycle are call (index 0), put (index 1), and hedge (index 2).

