Skip to main content

Composable financial contracts with Monte Carlo valuation

Project description

Monte Carlo Contracts

PyPI package Build status

Composable financial contracts with Monte Carlo valuation. This module employs ideas from How to Write a Financial Contract by S. L. Peyton Jones and J-M. Eber. However, the implementation is not based on functional programming but rather using an object oriented approach. Also, this implementation is tailored towards Monte Carlo based cashflow generation whereas the paper favours more general methods.

Features

  • Composition of financial contracts using elementary contracts Zero, One, Give, Scale, And, When, Cond, Anytime and Until
  • Boolean and real valued observables (stochastic processes) to be referenced by contracts
  • Cashflow generation for composed contracts given simulation models on fixed dategrids

Examples

Install

You can install monte-carlo-contracts using pip with

pip3 install monte-carlo-contracts

or you can simply download mcc.py and then run it using python3 with

python3 mcc.py

History

0.3.0 (2020-10-23)

  • Simulation of basic contract Until
  • Currency conversion of IndexedCashflows
  • Or contract supports multiple currencies
  • ObservableFloat supports <, <=, > and >= operators with float or other ObservableFloat instances
  • ObservableBool supports ~, & and | operators for combined conditions
  • Equity Options and FX Options examples

0.2.0 (2020-10-11)

  • Simulation of basic contracts Zero, One, Give, Scale, And, When and Cond
  • Partial simulation of Or contract
  • Float observables Stock and FX
  • Boolean observables At
  • SimulatedCashflows and model-bound IndexedCashflows to represent cashflows
  • Basic Model allowing the generation of cashflows for the contracts above

0.1.0 (2020-09-22)

Credits

Main developer is luphord luphord@protonmail.com. cookiecutter-pyscript is used as project template.

History

0.1.0 (2020-09-22)

  • Initial release.

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

monte-carlo-contracts-0.3.0.tar.gz (9.2 kB view hashes)

Uploaded Source

Built Distribution

monte_carlo_contracts-0.3.0-py2.py3-none-any.whl (9.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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