Skip to content

HugzGJ9/Quantitative_Finance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

95 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Quantitative Finance Library & Option Book Management Tool

Welcome to the Quantitative Finance Library, a Python-based toolkit for modeling, analyzing, and managing books of european options. This repository is the result of in-depth studies in quantitative finance, combining practical tools with advanced academic concepts.


πŸ“Š Features and Highlights

  • Comprehensive Risk Analysis: Includes PnL, Greeks, Vega convexity, skew, and term structure risk metrics.
  • Option Portfolio Management: Analyzing and managing books of European options.
  • Dynamic Simulations: Simulating the evolution of underlying assets and risk profiles.
  • Volatility Surfaces: Modeling volatility as a surface for active volatility trading.
  • Learning Tool: A valuable application for an initial assessment of risk exposure in a new, advanced trading strategy.

πŸš€ Demo Code

1. Demo script :

  • Visualizing Trading Strategies – This tool is perfect for users who want to visualize new trading strategies. Users can easily access the theoretical price of a book, payoff, Greek exposure (in 2D or 3D), skew, and term structure. https://youtu.be/hUNAKcM-MmM

2. Booking script :

  • Options Trading and Risk Management – For more advanced users, this tool allows traders to save their positions and conveniently access risk metrics, making it highly useful for managing option trades. https://youtu.be/Wg5Euv6VoKg

πŸ“ˆ Risk Exposure Analysis

This library provides a detailed breakdown of portfolio risk. Below are sample visualizations of risk metrics:

Payoff

image

Delta Risk Exposure

image

Vega Convexity

image

Pnl Price Exposure

image


πŸŒ€ Volatility Surface: Smile and Skew

Volatility Surface Example

Volatility surfaces integrate skew and term structure, required for OTM option trading.

image


πŸ“š Description of Classes

1. Asset Class

  • Represents the underlying asset for options.
  • Enables simulations and position management for hedging strategies.

2. Option Class

  • Built on the Asset class to represent financial derivatives.
  • Key methods:
    • Risk Metrics: DeltaRisk, GammaRisk, VegaRisk, ThetaRisk, VannaRisk, VolgaRisk
    • Pricing: option_price_mc, option_price_close_formulae
    • Visualization: display_payoff_option, RiskAnalysis, PnlRisk

3. Option 1st Generation

  • Comprises European vanilla options (e.g., spreads, straddles, strangles).
  • Inherits features from the Option class for advanced analysis.

4. Book Class

  • Combines multiple options (European or 1st Generation) into a portfolio.
  • Focused on a single underlying asset for simplicity.

5. Booking Request

  • Updates a booking Excel file to manage option book positions.
  • Computes Mark-to-Market (MtM) values and assesses risk exposure.

Example Visualization:

Booking Request Visualization

image

image


⚑ Subprojects

I have also led parallel studies on:

  • Optimizations.
  • DA Power Correlations between countries.
  • Cross-Border Optimizations in power markets.
  • Swing Options for energy markets.
  • Pricing CSSOs.

This library integrates these research insights into actionable tools for advanced financial and energy market analysis.


🎯 Motivations

This project began in Fall 2023 and has evolved with three main goals:

  1. Academic Exploration: Integrate advanced quantitative finance approaches.
  2. Personal Library: Develop a Python toolkit for advanced option strategies.
  3. Portfolio Management: Study and manage the evolution of option books over time.

The Quantitative Finance Library is now a robust tool for risk analysis and option portfolio management, leveraging simulations and dynamic risk profiling.


πŸ› οΈ How to Use

  1. Clone the repository:
    git clone https://github.com/Quantitative_Finance.git
  2. Install dependencies:
    pip install -r requirements.txt
  3. Explore the demo code and customize it for your use case.

πŸ“₯ Contributions

Contributions, issues, and feature requests are welcome! Feel free to fork the repository and submit a pull request.

πŸ“§ Contact

For questions or feedback, contact: hugo.lambert.perso@gmail.com