Skip to main content

Python library for pricing autocallables

Project description

exotx

exotx is a Python wrapper for the QuantLib library, a powerful open-source library for quantitative finance. exotx provides a simple and user-friendly interface for pricing and analyzing financial derivatives using QuantLib's advanced numerical methods.

Installation

To install exotx, simply use pip:

pip install exotx

Usage

Define the product

import exotx

notional = 100
strike = 100.0
autocall_barrier_level = 1.0  # 100%
annual_coupon_value = 0.03  # 3.00%
coupon_barrier_level = 0.75  # 75%
protection_barrier_level = 0.75  # 75%

my_autocallable = exotx.Autocallable(notional, strike, autocall_barrier_level, annual_coupon_value, coupon_barrier_level, protection_barrier_level)

Define the static data

The object that represents static data such as the calendar, the day counter or the business day convention used.

From the constructor

my_static_data = exotx.StaticData(day_counter='Actual360', business_day_convention='ModifiedFollowing')

From JSON

my_json = {
    'day_counter': 'Actual360',
    'business_day_convention': 'ModifiedFollowing'
}
my_static_data = exotx.StaticData.from_json(my_json)

Define the market data

From the constructor

reference_date = '2015-11-06'
spot = 100.0
risk_free_rate = 0.01
dividend_rate = 0.0
black_scholes_volatility = 0.2

my_market_data = exotx.MarketData(reference_date, spot, risk_free_rate, dividend_rate, black_scholes_volatility=black_scholes_volatility)

From JSON

my_json = {
    'reference_date': '2015-11-06',
    'spot': 100,
    'risk_free_rate': 0.01,
    'dividend_rate': 0,
    'black_scholes_volatility': 0.2
}
my_market_data = exotx.MarketData.from_json(my_json)

Price the product

exotx.price(my_autocallable, my_market_data, my_static_data, model='black-scholes')
96.08517973497098

Contributing

We welcome contributions to exotx! If you find a bug or would like to request a new feature, please open an issue on the Github repository. If you would like to contribute code, please submit a pull request.

License

exotx is released under the MIT License.

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

exotx-0.6.1.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

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

exotx-0.6.1-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

Details for the file exotx-0.6.1.tar.gz.

File metadata

  • Download URL: exotx-0.6.1.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for exotx-0.6.1.tar.gz
Algorithm Hash digest
SHA256 cebd5e2bfac6167a5010b3e79646cac7267b36904f56ec29f257aebe28ba958f
MD5 bcad4466b94ce608bbe9aeca1cf46f4d
BLAKE2b-256 92f6f2a71a81784814dd6c10ebad69829f7e47143d385436f3eeebc7cb4caff0

See more details on using hashes here.

File details

Details for the file exotx-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: exotx-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 36.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for exotx-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 52ca2efdbb5374d530d565b760ea2d4db8f14b0857755f6f7592904b9d143c87
MD5 0d242b6177eb1f8b524b55e83d6041a9
BLAKE2b-256 7e60be72fb4b644c43a98f5031673107d0c054cf2523b67dcb56c10d8b6f04e2

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