Python Code/Prompts

Open-source Python implementations and Claude prompts for quantitative finance.

Newsletter

Get exclusive models, prompts and code

One short email when there's something new. finance models, code walkthroughs, agentic prompts. No spam.

Built with
Anthropic Claude Python R ChatGPT GitHub Jupyter Excel PowerPoint VS Code SQL MATLAB

Read the theory, explore the code, and copy what you need.

Black-Scholes Option Pricing Model

Complete implementation of the Black-Scholes framework covering European option pricing, arbitrage bounds, implied volatility via Brent's method, and put-call parity.

Options Pricing Implied Volatility
ΔΓ

Option Greeks in Python

Step-by-step Delta, Gamma, Theta and Vega in Python. Includes formulas, plots, and an interactive chart that shows how gamma sharpens as time to expiry approaches zero.

Greeks Delta Gamma
Σ

Heston Vol Surface in Python

Stochastic volatility step by step: each Heston parameter as a 1D slice (rho, xi, kappa, v_0), then stacked into the full 3D implied vol surface with a low-vs-high regime comparison.

Heston Stochastic Vol Skew

Monte Carlo Option Pricing with GBM

Monte Carlo simulation under Geometric Brownian Motion with Itô correction. Terminal distributions, path simulation, and comparison against Black-Scholes analytical prices.

Monte Carlo Simulation GBM

CRR Binomial Tree for American Options

Cox-Ross-Rubinstein binomial tree for American and European option pricing, early exercise detection, and convergence to Black-Scholes.

Binomial Tree American Options Early Exercise

MVO Portfolio Optimization

Mean-variance optimization using the Markowitz framework, covering efficient frontier, Sharpe ratio maximization, constrained allocation, and portfolio backtesting.

Portfolio Markowitz Backtesting

Dashboard Automation Prompt

Step-by-step Claude prompt that turns any Python financial model into a fully interactive, self-contained HTML dashboard.

Claude Prompt Dashboard

PowerPoint Automation Prompt

Claude Design system + Claude Code skill that builds institutional equity research decks straight from an Excel model and exports a finished PDF.

Claude Design Skills Decks