GithubHelp home page GithubHelp logo

mecscapital / mibianlib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yassinemaaroufi/mibianlib

0.0 0.0 0.0 28 KB

Python Options Pricing Library

Home Page: http://code.mibian.net

Python 100.00%

mibianlib's Introduction

MibianLib - Options Pricing Open Source Library - http://code.mibian.net/
Copyright (C) 2011 Yassine Maaroufi - <[email protected]>
Distributed under GPLv3 - http://www.gnu.org/copyleft/gpl.html



Documentation
-------------
BS - Black-Scholes        Used for pricing European options on stocks without dividends
BS([underlyingPrice, strikePrice, interestRate, daysToExpiration], volatility=x, callPrice=y, putPrice=z)

eg: 
c = mibian.BS([1.4565, 1.45, 1, 30], volatility=20)
c.callPrice               Returns the call price
c.putPrice                Returns the put price
c.callDelta               Returns the call delta
c.putDelta                Returns the put delta
c.callDelta2              Returns the call dual delta
c.putDelta2               Returns the put dual delta
c.callTheta               Returns the call theta
c.putTheta                Returns the put theta
c.callRho                 Returns the call rho
c.putRho                  Returns the put rho
c.vega                    Returns the option vega
c.gamma                   Returns the option gamma

c = mibian.BS([1.4565, 1.45, 1, 30], callPrice=0.0359)
c.impliedVolatility       Returns the implied volatility from the call price

c = mibian.BS([1.4565, 1.45, 1, 30], putPrice=0.0306)
c.impliedVolatility       Returns the implied volatility from the put price

c = mibian.BS([1.4565, 1.45, 1, 30], callPrice=0.0359, putPrice=0.0306)
c.putCallParity           Returns the put-call parity


GK - Garman-Kohlhagen     Used for pricing European options on currencies
GK([underlyingPrice, strikePrice, domesticRate, foreignRate, daysToExpiration], volatility=x, callPrice=y, putPrice=z)

eg: 
c = mibian.GK([1.4565, 1.45, 1, 2, 30], volatility=20)
c.callPrice               Returns the call price
c.putPrice                Returns the put price
c.callDelta               Returns the call delta
c.putDelta                Returns the put delta
c.callDelta2              Returns the call dual delta
c.putDelta2               Returns the put dual delta
c.callTheta               Returns the call theta
c.putTheta                Returns the put theta
c.callRhoD                Returns the call domestic rho
c.putRhoD                 Returns the put domestic rho
c.callRhoF                Returns the call foreign rho
c.putRhoF                 Returns the call foreign rho
c.vega                    Returns the option vega
c.gamma                   Returns the option gamma

c = mibian.GK([1.4565, 1.45, 1, 2, 30], callPrice=0.0359)
c.impliedVolatility       Returns the implied volatility from the call price

c = mibian.GK([1.4565, 1.45, 1, 2, 30], putPrice=0.03)
c.impliedVolatility       Returns the implied volatility from the put price

c = mibian.GK([1.4565, 1.45, 1, 2, 30], callPrice=0.0359, putPrice=0.03)
c.putCallParity           Returns the put-call parity

Me - Merton               Used for pricing European options on stocks with dividends
Me([underlyingPrice, strikePrice, interestRate, annualDividends, daysToExpiration], volatility=x, callPrice=y, putPrice=z)

eg: 
c = mibian.Me([52, 50, 1, 1, 30], volatility=20)
c.callPrice               Returns the call price
c.putPrice                Returns the put price
c.callDelta               Returns the call delta
c.putDelta                Returns the put delta
c.callDelta2              Returns the call dual delta
c.putDelta2               Returns the put dual delta
c.callTheta               Returns the call theta
c.putTheta                Returns the put theta
c.callRho                 Returns the call rho
c.putRho                  Returns the put rho
c.vega                    Returns the option vega
c.gamma                   Returns the option gamma

c = mibian.Me([52, 50, 1, 1, 30], callPrice=0.0359)
c.impliedVolatility       Returns the implied volatility from the call price

c = mibian.Me([52, 50, 1, 1, 30], putPrice=0.0306)
c.impliedVolatility       Returns the implied volatility from the put price

c = mibian.Me([52, 50, 1, 1, 30], callPrice=0.0359, putPrice=0.0306)
c.putCallParity           Returns the put-call parity



Contributions:
--------------
Contributions to MibianLib are welcome.  Please send suggestions, critics,
patches to [email protected].  Otherwise you can create a fork on
github at https://github.com/yassinemaaroufi/MibianLib.



Contributors List:								
------------------
Yassine Maaroufi <[email protected]>	
Jack Grahl <[email protected]>				
Dmitry Vatolin <[email protected]>
https://github.com/smickles

mibianlib's People

Contributors

yassinemaaroufi avatar vikramcbajaj avatar smickles 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.