Skip to content

Barrier option pricing: Geometric Brownian Motion modeled stock & Monte Carlo simulation in Python

License

Notifications You must be signed in to change notification settings

t4fita/Barrier-option-pricing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Barrier-option-pricing

Geometric Brownian Motion modeled stock & Monte Carlo simulation in Python

This repository contains a Python implementation of the Monte Carlo simulation method for barrier option pricing. Using this approach, we can visualize simulated stock paths, taking into account various financial parameters.

Features

  • Monte Carlo simulation for stock price paths.
  • Animated visualization of stock paths.
  • Interactive plot allowing users to hover over paths to view option prices.
  • Dynamic display of days passed in the animation.
  • Barrier and strike price visualization on the graph.

Prerequisites

  • Python 3.8+
  • matplotlib
  • numpy
  • ffmpeg (For saving the animation)

Installation

  1. Clone the repository:
    git clone https://github.com/t4fita/Barrier-option-pricing
  2. Install the required packages (it's recommended to use a virtual environment):
    pip install -r requirements.txt
  3. Usage To run the simulation and visualize the animated plot:
     python main.py
    

Configuration

The simulation's parameters like initial stock price, volatility, strike price, barrier price, maturity, etc., are adjustable within the main.py script.

Output

The script will display an animated plot showing the simulated stock paths. You can hover over the paths to view their respective option prices.

animation.mp4

Saving The Animation

To save the animation, uncomment the respective lines in the main.py script. You can save it in formats like MP4 or GIF.

License

This project is open source and available under the MIT License

About

Barrier option pricing: Geometric Brownian Motion modeled stock & Monte Carlo simulation in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages