Skip to content

projects /

bookpolicy

Scores an options action against the book you already hold, putting opening, closing, and doing nothing on one scale.

  • preparing release
  • v0.0.3
  • Python
  • Python 3.12+
  • MIT
Source published at release

Most options tools score a candidate trade on its own: this spread has a 70% probability of profit, that one collects more credit. Once you already hold positions, that’s the wrong comparison, because the same spread can help one book and hurt another.

bookpolicy scores an action against a book and a target, and every score comes with a plain-language rationale.

total, parts = score(book, candidate, terms, target)
for p in parts:
    print(f'{p.term:<18}{p.value:+8.3f}  {p.rationale}')
# delta_gap           +1.600  closes the delta gap by $19,200 ($28,300 → $9,100 from a $12,000 band)
# theta_yield         +1.400  collects $7.00/day against $500 of capital (1.400%/day)
# transaction_cost    -0.022  costs $2.24 in fees and crossing
  • No dependencies: stdlib and Decimal only. No pandas, numpy, broker SDK, network, or disk I/O.
  • assert_pnl_blind verifies that scores don’t depend on what you originally paid.