Giter VIP home page Giter VIP logo

sebastieneveno / exotx Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 0.0 164 KB

exotx provides a simple and user-friendly interface for pricing and analyzing financial derivatives using QuantLib's advanced numerical methods.

License: MIT License

Python 100.00%
autocallable exotic-option quantitative-finance quantlib equity-derivatives barrier-option financial-derivatives financial-engineering options-pricing risk-management

exotx's Introduction

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

Vanilla Option

import exotx
from exotx.instruments import OptionType

strike = 90
option_maturity = '2016-05-04'
my_vanilla_option = exotx.VanillaOption(strike, option_maturity, OptionType.CALL)

Auto-Callable

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

Vanilla Option

from exotx.enums import PricingModel, NumericalMethod

my_pricing_config = exotx.PricingConfiguration(PricingModel.BLACK_SCHOLES, NumericalMethod.ANALYTIC, compute_greeks=True)
exotx.price(my_vanilla_option, my_market_data, my_static_data, my_pricing_config)
>>> { 
    'price': 13.83328710, 
    'delta': 0.77183751, 
    'gamma': 0.01609460, 
    'theta': -7.01024983
}

Auto-Callable

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.

exotx's People

Contributors

sebastieneveno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.