Note

This package is under active development.

Feedback and questions: dev@yieldchain.com

qdpmc is a Python package for pricing path-dependent options and structured products via Monte Carlo simulation. It utilizes vectorization to boost algorithm speed. It offers a simple, intuitive , and flexible API to its users. This simple example demonstrates how it works:

In [1]: import qdpmc as qm

In [2]: import numpy as np

# Specify an up-and-out call option
In [3]: up_out_call = qm.UpOut(
   ...:    spot=100,
   ...:    barrier=150,
   ...:    rebate=0,
   ...:    ob_days=np.linspace(1, 252, 252),
   ...:    payoff=qm.Payoff(
   ...:       qm.plain_vanilla,
   ...:       strike=100,
   ...:       option_type="call"
   ...:       )
   ...: )
   ...: 

 # Simulation parameters
In [4]: mc = qm.MonteCarlo(batch_size=125, num_iter=1000)

 # Black-Scholes dynamics
In [5]: bs = qm.BlackScholes(r=0.03, q=0, v=0.25, day_counter=252)

 # PV and Greek letters
In [6]: up_out_call.calc_value(mc, bs)
Out[6]: 6.371477718062621

Checkout Usage for further information.

Indices and tables