Skip to main content

Module strategy

Module strategy 

Source
Expand description

§Strategies: turning SD into option trades

A strategy answers two questions every day:

  1. Flat? Should I open a trade, and if so, which option legs?
  2. In a trade? Should I close it today?

That is the whole Strategy trait. Pricing, costs, expiry, marking to market and bookkeeping all live in sim, so a new idea is ~30 lines: implement name, thesis, enter and exit, add it to catalog, and run cargo run --release --bin sd_options.

§The ideas, and why each exists

The backtests in docs/ showed SD v2 is good at how big and poor at which way. Options let you trade those two separately:

StrategyBets onUses from SDWhy it might work
CoilStraddlea big move, either waysqueeze + expected move vs implied movesqueezes precede expansions; buy vol when it looks cheap
QuietCondora small movelow expected move, no squeeze, no live firesell vol when SD expects calm and options price more
FireVerticaldirection after a firelean, intensity, decaythe classic SD trade, kept to measure it honestly
SdRouterwhichever regime SD seeseverythingone account, one position, the right tool per regime
Always* baselinesnothingnothingthe same trades on a timer: SD must beat these to earn its keep

Modules§

book
Book: trading a full month or a full year, the way a person would
pricing
Pricing: what an option costs
sim
Simulator: the honest bookkeeper

Structs§

Always
The same trade structure on a timer, ignoring SD entirely.
CoilStraddle
Buy a one-month straddle while price is coiled and SD expects a bigger move than options are pricing.
Context
Everything a strategy may look at on one bar. All of it is known at the close of that bar; nothing comes from the future.
FireVertical
The classic SD trade: when a squeeze fires with a clear lean, buy a debit spread toward SD’s expected move.
LegSpec
One option leg, with strike given as a multiple of spot (1.00 = ATM).
Named
Gives any strategy a different display name (handy for variants).
OpenView
What an open trade looks like to exit.
Plan
What to open.
QuietCondor
Sell a defined-risk iron condor when SD expects calm and options price more movement than SD does.
SdRouter
One position at a time, the right tool for the regime SD reports.
WeeklyCoilStraddle
CoilStraddle on a one-week clock: the same “coiled and cheap” test, a straddle that expires in about a week, and quick exits. Short options carry more gamma (they react more to a sudden move) but also lose value faster each day and pay proportionally more in spreads.

Constants§

MONTH
A month of option life in trading days (≈30 calendar days).
WEEK
A week of option life (trading days).

Traits§

Strategy
The whole contract between an idea and the simulator.

Functions§

catalog
Every strategy the options backtester runs.
short_catalog
Short-horizon option strategies (intra-week / few-day setups).