Skip to main content

: 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

Welcome to Structools!

Testing

You can easily test that the package has been properly installed by creating a python file test.py (or any name you want) containing the following lines

from structools.test import run_tests

if __name__ == "__main__":

    run_tests()

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

structools-0.18.1.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

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

structools-0.18.1-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file structools-0.18.1.tar.gz.

File metadata

  • Download URL: structools-0.18.1.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for structools-0.18.1.tar.gz
Algorithm Hash digest
SHA256 98314df9245fab74ef7b96da03276a35bdd992dd3cd5119fc33b0d86aa6849f0
MD5 75f0211adb5208187c0518e1bdc3e7cf
BLAKE2b-256 67db46a9843c9d7d4cd229862c2af8ed40ca2f214a6a594856e04fb54f91f003

See more details on using hashes here.

File details

Details for the file structools-0.18.1-py3-none-any.whl.

File metadata

  • Download URL: structools-0.18.1-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for structools-0.18.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a8f85cc371250ae75a4b476b93a0b5a79a7bf19df5294e055649fcd26e2f6e71
MD5 f70cb0a005ed3045404c03a3b4828aea
BLAKE2b-256 b9ed03f067796144c9cb33aa126fbf3f2e2cde0ce9a925d4f05543f048dda3bb

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