: Helpful tools for QIS and Pricing Structuring teams
Project description
structools
Helpful tools for QIS and Pricing Structuring teams
Installation
$ pip install structools
Usage
Every new functionality developed in this package has been interfaced so you have very little to do!
Start by creating a file launch.py with the following lines
from structools.launch import start
if __name__ == "__main__":
start()
Then open the terminal in the folder where the file launch.py is located and simply run the following command
$ streamlit run launch.py
Structools offers the possibility to download your backtest results as excel files!
Welcome to Structools!
Advanced/Further Development
For those willing to dive deeper into the code, please find below a brief way to generate your backtest:
import numpy as np
from structools.tools.date_tools import DateModel
from structools.products.basic_products import Basket
from structools.products.autocalls import Phoenix, Athena
from structools.backtest.backtester import Backtester
# Underlying creation Worst-Of 2
nominal = 1_000_000
L_COMPO = ["AAPL", "^FCHI", "^SPX", "MSFT"]
N = len(L_COMPO)
arr_weights = np.ones(N) * 1/N
basket_wof = Basket.from_params(
size=nominal,
N=2,
name="WOF2",
worst=True,
best=False,
compo=L_COMPO,
weights=arr_weights
)
# Create default phoenix with custom underlying
my_phoenix = Phoenix.from_params(underlying=basket_wof)
my_phoenix.set_parameter("coupon", 0.1) # Changing the coupon value to 10%
# Configure the backtest - 10 years history for the my_phoenix product
history_length = 10
backtester = Backtester.init_backtester(
product=my_phoenix,
backtest_length=history_length,
investment_horizon=my_phoenix.maturity
)
# Running the backtest
dict_res = backtester.backtest_autocall()
All the functionalities of the root package of this package are still available via the following command:
import pybacktestchain
The relevant information about this pacakage is available here: https://pypi.org/project/pybacktestchain/
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
structools was created by Romain Pifaut. It is licensed under the terms of the MIT license.
Credits
structools was created with cookiecutter and the py-pkgs-cookiecutter template.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file structools-0.19.1.tar.gz.
File metadata
- Download URL: structools-0.19.1.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
844d2b65a3ad8ad79581e28f63d9256142945b396f723b221947dfc29bcdc3c3
|
|
| MD5 |
de27a8a356ffdc8ebf33485ca408b2a3
|
|
| BLAKE2b-256 |
5c69f68bac9ad3ded7ae711b68b0942b50f01328e6b3af63c6349865c2940ae5
|
File details
Details for the file structools-0.19.1-py3-none-any.whl.
File metadata
- Download URL: structools-0.19.1-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e936198650834b5d35b5c38840f36a2bfe53b92b0a722b1ccdbbf638766b1c4
|
|
| MD5 |
ebadc5c47f65e085f814848b7bf34262
|
|
| BLAKE2b-256 |
8ea9dd637c8d8cc55cbe7a5244804c89c20d93ac53db8e39b958b2b50e18bd6f
|