2017 © Pedro Peláez
 

library blackscholes

image

shadiakiki1986/blackscholes

  • Sunday, September 24, 2017
  • by shadiakiki1986
  • Repository
  • 2 Watchers
  • 1 Stars
  • 206 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 5 % Grown

The README.md

php-blackscholes Build Status

Black-Scholes option pricing in php, (*1)

Based on Black-Scholes in Multiple Languages and wikipedia formula, (*2)

Installation

composer require shadiakiki1986/blackscholes, (*3)

Usage

Example

Call option price example from quora, (*4)

require_once 'vendor/autoload.php';

$strike = 470;
$interest = 0.02;
$timeToMaturity = 0.17;
$underlyingPrice = 460;
$volatility = 0.58;
$bs = new \shadiakiki1986\BlackScholes(
  $underlyingPrice,
  $strike,
  $timeToMaturity,
  $interest,
  $volatility
);
var_dump($bs->call());

will display 40.1047 (note that they have a mistake in their d1 function), (*5)

Alternatively, (*6)

$call = new \shadiakiki1986\BlackScholesStatic::calculate(
  'c',
  $underlyingPrice,
  $strike,
  $timeToMaturity,
  $interest, 
  $volatility
);
var_dump($call);

The Versions

24/09 2017

dev-master

9999999-dev

  Sources   Download

The Development Requires

by Shadi Akiki

06/01 2017

0.0.2

0.0.2.0

  Sources   Download

The Development Requires

by Shadi Akiki

05/01 2017

0.0.1

0.0.1.0

  Sources   Download

The Development Requires

by Shadi Akiki