Skip to content

About

Expired-options data from LSEG, 3D option price surfaces, and a covered-call book with Reg T margin, published as static sites on GitHub Pages. Duke FINTECH 535.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

FINTECH 535: Options Data and a Covered-Call Book

Expired-options data from LSEG, an implied price surface, and a margin-aware covered-call backtest

Live: option surface Live: covered call Duke Data Python

Felipe Jaramillo Penagos · Duke University · Fall 2026


Two projects that pull historical option data from LSEG, reconstruct it into something tradable, and publish the results as static sites on GitHub Pages.

Project What it does Live site
Option Surface Lab Builds OPRA RICs for expired UUUU options, pulls their history from LSEG, renders 3D call and put price surfaces, and tests how far trade prints sit from the bid-ask midpoint. Open
Covered-Call Book Buys 100 shares each Monday and writes that Friday's call on AAPL and MPWR, then keeps a full blotter, ledger, Reg T margin account, and NAV path through expiry. Open

How it is built

Covered-call book

hw2-covered-call/src/
├── fetch.py          the only module that calls LSEG; caches raw data to data/
├── rics.py           OPRA RIC construction and parsing
├── engine.py         position state machine, Reg T margin, fills (no LSEG import)
├── run_backtest.py   weekly loop, mid-versus-print regression, performance
├── validate.py       reconciliation checks on a finished book
├── build_site.py     static site generator
└── make_fixture.py   synthetic GBM and Black-Scholes data for testing offline
  • Testable without data access. engine.py never imports LSEG, so the accounting is tested against hand-computed positions and synthetic fixtures. There are 58 engine checks and 34 RIC checks.
  • Two strike rules. One picks the nearest out-of-the-money strike; the other targets a call delta. On 30 seeded synthetic paths, the delta rule's realized assignment rates (0.152, 0.306, 0.476) tracked their targets (0.15, 0.30, 0.45).
  • Validated before publishing. validate.py checks that cash reconciles to the blotter, that no shares are sold before they are bought, that assignment happens only above the strike, and that NAV equals the sum of its parts.
  • Fill assumption tested, not assumed. A regression of trade prints on midpoints shows, name by name, whether filling at the mid is defensible.

Details, including two places where the course handout's RIC rules disagree with LSEG's API, are in the covered-call README.

Option Surface Lab

hw1-option-surface/src/option_surface_lab.py parses RICs, fetches expired contracts in batches, reshapes them into a long table, and renders the call and put surfaces, the mid-versus-trade comparison, and sparsity statistics into a single index.html.

Reproduce

Data pulls need an LSEG Workspace session. Everything downstream runs from the cache:

cd hw2-covered-call/src
python3 run_backtest.py AAPL --rule nearest_otm
python3 validate.py AAPL
python3 build_site.py AAPL
python3 test_engine.py && python3 test_rics.py

About

Coursework for FINTECH 535, Advanced Design and Testing of Algorithmic Trading Systems, at Duke University.

About

Expired-options data from LSEG, 3D option price surfaces, and a covered-call book with Reg T margin, published as static sites on GitHub Pages. Duke FINTECH 535.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages