GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mcf-long-short/option-pricing-fourier-transform: Option pricing: Simple app for vanilla option pricing using Black-Scholes model and Merton model via Fourier Transform. Spot prices for the underlying are fetched from Yahoo Finance API.

BranchesTags
Open more actions menu

Latest commit

 

History

14 Commits
14 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
notebooks
notebooks
 
 
options
options
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
README.md
README.md
 
 
app.py
app.py
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

Option pricing via Fourier transform methods

Stramlit app: https://share.streamlit.io/mcf-long-short/option-pricing-fourier-transform/main/app.py

Introduction

Fourier Transform and Fast Fourier transforms (FFT) represent popular approaches to option pricing. They provide a semi-closed form expressions for European and American option prices. Most importantly, calculation using these methods is fast and accurate, very useful when we need to bring the model to data (to calibrate it). A number of methods have been proposed in the literature. The goal of this project is to implement these algorithms for Black–Scholes and Merton model. Brief introduction to the methods as well as implementation of various models in Python can be found in Hilpisch (2015). A really nicely written intro to the Fourier transform and their applications in option pricing can be found in Schmeltze (2010).

This repository contains implementation of various Fourier transform methods for pricing options: Black–Scholes and Merton model via FT and FFT. There is an implementation of those models, a streamlit web app for testing those models and jupyter notebook for model performance comparison under /notebooks/ directory.

Key implementation references:

  • Hilpisch, Y. (2015) Derivatives Analytics with Python, John Wiley
  • Schmeltze (2010) Fourier Pricing. Full title: Option Pricing formulae using Fourier Transform: Theory and Applications

This repository represents group project work for course in Derivatives for advanced degree Masters in Computational Finance, Union University.

Demo

streamlit-app-2021-09-12-14-09-33.mp4

How to run the code?

Running in docker container

Build image and run docker container:

docker build -t option-pricing-fourier:latest .
docker run -p 8080:8080 option-pricing-fourier:latest

Streamlit app should be at: http://localhost:8080/

Running locally

Create python venv and install requirements

# Create virtual env
python3 -m venv venv

#Activate venv (Unix/MaxOS)
source venv/bin/activate

#Activate venv (Windows)
venv\Scripts\activate.bat

# Install requirements
python -m pip install -r requirements.txt

To run streamlit app: streamlit run app.py

About

Option pricing: Simple app for vanilla option pricing using Black-Scholes model and Merton model via Fourier Transform. Spot prices for the underlying are fetched from Yahoo Finance API.

share.streamlit.io/mcf-long-short/option-pricing-fourier-transform/main/app.py

Topics

black-scholesdockerfourier-transformmertonoption-pricingpythonyahoo-finance

Resources

Readme
Activity
Custom properties

Stars

9 stars

Watchers

0 watching

Forks

3 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.