Python library for pricing autocallables
Project description
exotx
exotx allows you to easily price exotic options with a couple of lines of Python code.
It is based on QuantLib, the open-source library for quantitative finance.
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
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)
Price the product
my_autocallable.price(my_market_data, my_static_data, model='black-scholes')
96.08517973497098
Project details
Release history Release notifications | RSS feed
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.5.8.tar.gz
(20.5 kB
view details)
Built Distribution
exotx-0.5.8-py3-none-any.whl
(27.6 kB
view details)
File details
Details for the file exotx-0.5.8.tar.gz
.
File metadata
- Download URL: exotx-0.5.8.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46789afdfb0d8399170487e4be76bca29f2e26f8ea459e494ac55119fc5c8c8d |
|
MD5 | 1f1e8fa07e3c3b0142fb35d884ffbdfe |
|
BLAKE2b-256 | 59010e7723c60c0abce94a9567c60b3c0da43be915bbc53585f58eb65c451007 |
File details
Details for the file exotx-0.5.8-py3-none-any.whl
.
File metadata
- Download URL: exotx-0.5.8-py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c5af65af4259cc98575c3af3f2124831101bbf78cb89c43e3c5a38f1047237c |
|
MD5 | df33692f55524fa4353d9401a0f8d21d |
|
BLAKE2b-256 | 19cd6d05e6e48fabe1d63b74ab4e4320da33efda4568c68470aad6a7d76266bb |