Skip to main content

A quantitative options pricing and risk library.

Project description

QUANTEO: Quantitative Options Pricing & Risk

Quanteo is an Object-Oriented Python library for derivative pricing and risk sensitivity analysis. This project is developed as part of my learning journey during the MSc in Mathematical Engineering at Politecnico di Torino. The library implements stochastic models and variance reduction techniques to estimate option prices and Greeks, particularly for path-dependent derivatives.


Author: Matteo Ientile
MSc Mathematical Engineering – Politecnico di Torino

LinkedIn X

Installation

You can install the official release directly via pip:

pip install quanteo

Functionalities available at the moment

1. Simulation & Pricing Engines

  • Monte Carlo: Path generation for Geometric Brownian Motion (GBM).
  • Quasi-Monte Carlo: Sobol low-discrepancy sequences for improved convergence.
  • Variance Reduction: Control Variates (anchored to analytical solutions) and Antithetic Sampling.
  • Analytical Models: Closed-form Black-Scholes-Merton (BSM) for European and Geometric Asian options.

2. Risk Management (Greeks)

  • Computation of Δ (Delta), Γ (Gamma), ν (Vega), ρ (Rho), and Θ (Theta).
  • Finite Differences: Central difference approximations for numerical sensitivities.
  • CRN (Common Random Numbers): Epsilon caching to ensure stability in numerical derivatives.

3. Contract Types

  • European Options: Standard Call/Put payoffs.
  • Asian Options: Discrete Arithmetic and Geometric averages.

Examples

The examples/ directory contains notebooks demonstrating the implementation:

  • european_options_and_greeks.ipynb: Benchmarking BSM, MC, and QMC engines.
  • asian_options_and_variance_reduction.ipynb: Statistical impact of Control Variates on Asian contracts.

Usage

from quanteo.models import GBM
from quanteo.options import ArithmeticAsianOption, GeometricAsianOption
from quanteo.pricers import MonteCarloPricer, ControlVariateMC, GeometricAsianPricer

# 1. Market Data
model = GBM(S0=85.0, r=0.04, sigma=0.42)

# 2. Options (126 observations)
target = ArithmeticAsianOption(T=0.5, K=88.0, N=126)
control = GeometricAsianOption(T=0.5, K=88.0, N=126)

# 3. Analytical Anchor
exact_cv = GeometricAsianPricer().price(control, model).price

# 4. Monte Carlo with Control Variate
mc = MonteCarloPricer(n_paths=5000, n_steps=126)
cv_engine = ControlVariateMC(mc)

result = cv_engine.price(target, control, exact_cv, model)

print(f"Price: {result.price:.4f}")
print(f"95% CI: [{result.metrics['cv_lower_bound']:.4f}, {result.metrics['cv_upper_bound']:.4f}]")

Roadmap

  • Heston Model: Stochastic volatility integration.
  • Jump Diffusion: Merton model for discontinuous price paths.
  • American Options: Longstaff-Schwartz (LSM) implementation.
  • Dashboard: Streamlit interface for visualization.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quanteo-0.1.2.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quanteo-0.1.2-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file quanteo-0.1.2.tar.gz.

File metadata

  • Download URL: quanteo-0.1.2.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for quanteo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d71497da1723bba537117bc09abede90c7d3848ce774b4bde508800453fcf05d
MD5 d602e577e2e300870fd3d2fed1207c34
BLAKE2b-256 28baaf0b4fb21a5f6ed186a2b504109fe67d766292ba004ab45b9d72d6d3c08b

See more details on using hashes here.

File details

Details for the file quanteo-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: quanteo-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for quanteo-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14a09378250543b48e1a062e0dc2f3a8aec6bae6ceb2fbfc548fd4d56e958053
MD5 1fa7c963b13d45874f0d7ff9cfb34244
BLAKE2b-256 d9d0bb6513b364eeba84ac43093d332fe18b077d4034a7bd27c6a97aa1e1b52e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page