Code Monkey home page Code Monkey logo

financialtoolbox.jl's Introduction

FinancialToolbox

CI codecov

This is a Julia package containing some useful Financial functions for Pricing and Risk Management under the Black and Scholes Model.
The syntax is the same of the Matlab Financial Toolbox.

It currently contains the following functions:

  • blsprice : Black & Scholes Price for European Options.
  • blsbin : Black & Scholes Price for Binary European Options.
  • blkprice : Black Price for European Options.
  • blsdelta : Black & Scholes Delta sensitivity for European Options.
  • blsgamma : Black & Scholes Gamma sensitivity for European Options.
  • blstheta : Black & Scholes Theta sensitivity for European Options.
  • blsvega : Black & Scholes Vega sensitivity for European Options.
  • blsrho : Black & Scholes Rho sensitivity for European Options.
  • blslambda: Black & Scholes Lambda sensitivity for European Options.
  • blspsi : Black & Scholes Psi sensitivity for European Options.
  • blsvanna : Black & Scholes Vanna sensitivity for European Options.
  • blsimpv : Black & Scholes Implied Volatility for European Options (using Brent Method).
  • blkimpv : Black Implied Volatility for European Options (using Brent Method).

Currently supports classical numerical input and other less common like:

It also contains some functions that could be useful for the Dates Management:

  • yearfrac : fraction of years between two Dates (currently only the first seven convention of Matlab are supported).
  • daysact : number of days between two Dates.

The module is standalone.

How to Install

To install the package simply type on the Julia REPL the following:

Pkg.add("FinancialToolbox")

How to Test

After the installation, to test the package type on the Julia REPL the following:

Pkg.test("FinancialToolbox")

Example of Usage

The following example is the pricing of a European Call Option with underlying varying according to the Black Scholes Model, given the implied volatility. After that it is possible to check the result computing the inverse of the Black Scholes formula.

#Import the Package
using FinancialToolbox

#Define input data
spot=10;K=10;r=0.02;T=2.0=0.2;d=0.01;

#Call the function
Price=blsprice(spot,K,r,T,σ,d)
#Price=1.1912013169995816

#Check the Result
Volatility=blsimpv(spot,K,r,T,Price,d)
#Volatility=0.20000000000000002

Contributors

Thanks to Modesto Mas for the implementation of the Brent Method.

financialtoolbox.jl's People

Contributors

rcalxrc08 avatar juliatagbot 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.