option-pricing

Prices European and American options using nine numerical methods with a numpy-based CLI.

Updated Aug 13, 2026
One-click install
npx skills add https://github.com/Martino17x/Sentinel-Invest --skill option-pricing-martino17x
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: option-pricing
Source: https://github.com/Martino17x/Sentinel-Invest/tree/main/.agents/skills/option-pricing
Command: npx skills add https://github.com/Martino17x/Sentinel-Invest --skill option-pricing-martino17x

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Pricing options accurately and quickly for backtesting requires implementing multiple numerical methods (closed-form, trees, Monte Carlo) with known speed and error trade-offs, which is tedious to build and validate from scratch. ## Core Features & Use Cases - Nine pricing methods: Black-Scholes, Binomial CRR, Trinomial Boyle, Monte Carlo with antithetic variates, Longstaff-Schwartz, Bjerksund-Stensland/BAW, Heston stochastic volatility, and Bates with jump diffusion. - Analytics utilities: Analytic Greeks, implied volatility solver, P(ITM) and P(Profit) under the risk-neutral measure, and price surfaces across strikes. - Backtesting-oriented performance: Closed-form methods run at hundreds of thousands of options per second, with a built-in benchmark mode and validation against Hull textbook examples. - Use Case: Run a long-volatility backtest on SPY by computing theoretical Black-Scholes prices with historical IV, comparing them against market prices, and filtering trades with P(Profit) above a threshold. ## Quick Start Ask the AI to price an at-the-money European call with S=100, K=100, T=0.25, r=0.05, and sigma=0.20 using the option pricing script.

Frequently Asked Questions about option-pricing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I price an American option in Python?▼

Use the bs2 mode for a closed-form Bjerksund-Stensland/BAW approximation at about 3.6 microseconds per option, or the binomial mode with steps=2000 for about 0.1% error. For custom payoffs, the lsm mode implements Longstaff-Schwartz Monte Carlo.

What is the fastest option pricing method for backtesting?▼

Black-Scholes runs at roughly 419,000 options per second for European options, and BAW (bs2) at about 276,000 per second for American options. Both are O(1) closed-form methods, roughly 2000x faster than a binomial tree with 500 steps.

How do I calculate implied volatility from option prices?▼

Use the iv mode with the observed market price, spot, strike, time to expiry, and rate. It solves via bisection in about 82 microseconds for European options using Black-Scholes, and uses a binomial engine for American options.

Does this option pricer support stochastic volatility models?▼

Yes, it implements Heston 1993 via Fourier integration at about 400 microseconds per option, capturing volatility smile through the rho parameter. Bates 1996 adds Merton jump diffusion for crash risk at about 6 milliseconds per option.

What are the limitations of Black-Scholes for option pricing?▼

Black-Scholes assumes constant volatility and lognormal returns, so it misses the volatility smile and underestimates tail risk. It also only prices European options; use BAW or binomial trees for American exercise, and Heston or Bates when skew matters.

Which option pricing methods are not supported?▼

Path-dependent exotics like Asian, barrier, and lookback options are not implemented out of the box, though the Monte Carlo framework is extensible. Multi-asset options, discrete dividends, and rough volatility models are also unsupported.