Giter Club home page Giter Club logo

cpp-binomial-greeks's Introduction

Calculating option greeks using Bianomial Tree

This project is part of the C++ Nanodegree program from Udacity. I develop a program to approximate and consolidate an options portfolio's Greeks using the binomial tree model. The Greeks are defined as derivatives of the option value with respect to the underlying parameters on which it is dependent. They help decide how to hedge the positions against some of its risk drivers, as stock price direction, volatility, and interest rate. After calculating the greeks and current PnL for a portfolio read from data/portfolio.csv, the program output the results in the same folder in two different files. One with the data computed to all options and another with the data consolidated by the underlying stock.

Install

To set up your environment to run the code in this repository, start by installing Docker and Make in your machine (in Windows, you may want to try chocolatery). Then, run the following commands

$ make docker-build
$ make environment-test

Run

In a terminal or command window, navigate to the top-level project directory cpp-binomial-greeks/ (that contains this README) and run the following command.

$ make greeks-computation

Reference

  1. P. Wilmott. Paul Wilmott on Quantitative Finance 3 Volume Set (2nd Edition). Wiley, 2006. pg 287-289 link
  2. CL. Costa. Opções - Operando Volatilidade. BMF, 1999. pg 97-99 link

License

The contents of this repository are covered under the MIT License.

cpp-binomial-greeks's People

Contributors

ucaiado avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cpp-binomial-greeks's Issues

Implement portfolio file parsing

Should generate a vector of Enums with instruments metadata. So I need to:

  • Create the required Structs
  • Create the required Enums
  • Read data from file Translate data in the created structures
  • return a vector of these strcutures

Calculate the greeks for all options and consolidate the data

The results should be saved by option and by underlying. It will be used to save the data later. Also, the dimension of the greeks should be changed to something more useful. So, to complete this task:

  • calculate greeks by option
  • calculate greeks by underlying
  • change greeks dimension
  • consolidate the pnl for each underlying

Implement Risk calculation to all portfolio

The data generated by greeks computation can be used to calculate a single distribution of PnL to the entire portfolio. Already closed positions should be added up in each one of the possible scenarios.

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.