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['confidence_interval'][0]:.4f}, {result.metrics['confidence_interval'][1]:.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.3.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.3-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quanteo-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 ec97becc7ef827d8af86c833ccaad51cbba0c7a11267937dae875f197621b2cb
MD5 21e2db6247ca1bda5c7eb9106a820b3b
BLAKE2b-256 c10df3a240fab7dd430c8603d47fd1b63cfb8db12d14f404e6e9b4902efed34b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: quanteo-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c9ec98bc11b6f5058677c4892fa379dde8abcf142ee93201a36b49ceeb00215a
MD5 8663f7025bca417a89ff4a766b8c1bf9
BLAKE2b-256 34650be3c2b79322ea90c1d851f95899c0e115a1d21ee5bb06f2889a414df4d5

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