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
- Host: GitHub
- URL: https://github.com/gauss314/back-scholes-model
- Owner: gauss314
- Created: 2020-01-03T21:49:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-30T17:48:09.000Z (over 4 years ago)
- Last Synced: 2025-11-14T13:07:30.804Z (8 months ago)
- Topics: black, finance, greeks, implied-volatility, laravel, option-valuation, options, php, quant, scholes
- Language: PHP
- Homepage:
- Size: 23.4 KB
- Stars: 9
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Black and Scholes and Merton forms
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