options-backtestinglisted
Install: claude install-skill howard-lynn-ye/fin-skills
# Options backtesting
**An equity position ends when you sell it. An options position can end five ways, and you control
one of them.**
| How it ends | Who decides |
|---|---|
| You close it | you |
| Expires worthless | nobody — clean |
| Expires ITM, exercised by exception | the clearing house, by default |
| **Assigned early** | **the long side, and you find out afterwards** |
| **Pinned at the strike** | **unknown until assignment notices arrive** |
A backtest that computes `max(S − K, 0)` at expiry has modelled rows two and three and silently
assumed the others never happen. This skill is about what that costs.
For **pricing** a single option, Greeks scaling, and vol-surface fitting, go to
`../derivatives-pricing/SKILL.md` — including its §6, which carries the measured evidence that
`lastPrice` is unusable (54.6% of a live SPY call chain quoted outside its own bid-ask).
## 0. 🚨 Almost nothing in Python backtests options correctly
✅ **Fetched from the PyPI JSON API on 2026-09-04.** Of every package on PyPI (the full index, 884,814
names, was swept), **exactly one models assignment, exercise, settlement and margin: QuantConnect's
LEAN.** One more is a genuine multi-leg backtester that explicitly disclaims assignment. Everything
else is a pricer, a payoff plotter, or a live-broker SDK.
| Package | Latest | Multi-leg | Assignment | Margin | What it actually is |
|---|---|---|---|---|---|
| **LEAN** (`lean` 1.0.229, 2026-08-28, Apache-2.0; ✅ `lean-cli` 326★, pushed 20