An open API service indexing awesome lists of open source software.

https://github.com/gauss314/back-scholes-model

Black Scholes and Merton option, greeks and implied volatility calc for PHP Laravel or Symfony package
https://github.com/gauss314/back-scholes-model

black finance greeks implied-volatility laravel option-valuation options php quant scholes

Last synced: 7 months ago
JSON representation

Black Scholes and Merton option, greeks and implied volatility calc for PHP Laravel or Symfony package

Awesome Lists containing this project

README

          

# Black and Scholes and Merton forms


 Version
Total Downloads
License

A simple way to get options primes, greeks and implied volatility using Black&Scholes valuation model.

# Installation

```shell
$ composer require "gauss314/bsm"
```

# Usage

For Laravel 5, Symfony and any PHP project and framework with a composer.json file

```php
bsCall($spot, $strike, $free_risk, $time, $sigma, $dividend_yield);
/*
Array
(
[call] => 2.3601461764389
[delta] => 0.52172023548133
[gamma] => 0.069473882914289
[vega] => 0.11420364314678
[theta] => -0.040524357193283
[rho] => 0.040941269072625
)
*/

/*
**********************************************
GET Put prime, and greeks
**********************************************
*/
$put = $bsm->bsPut($spot, $strike, $free_risk, $time, $sigma, $dividend_yield);
/*
Array
(
[put] => 2.2123103559286
[delta] => -0.47827976451867
[gamma] => 0.069473882914289
[vega] => 0.11420364314678
[theta] => -0.035600140877582
[rho] => -0.041129002855723
)
*/

/*
**********************************************
GET Implied volatility
**********************************************
*/

$iv = $bsm->ivCall($spot, $strike, $free_risk, $tiempo, $mkt_value); // 16.84647

//Use ivPut() method to get implied volatility from put contract.

```


# Configuration

It doesnt need any configuration line

Enjoy it! :heart:


# Reference

- [Black & Scholes & Merton forms](https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model)


# License

MIT