Skip to content

Commit

Permalink
Add changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
zoispag committed Feb 2, 2024
1 parent 78f23e6 commit 5afad91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `options-calculator` will be documented in this file.

## 1.0.2 - 2024-02-02

- Enforce upper and lower bounds for implied volatility.

## 1.0.1 - 2024-02-02

- Fix calculation when implied volatility is outside the initial range.
Expand Down
2 changes: 1 addition & 1 deletion src/Black76.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private function impliedVolaUsingBisection(
while (++$i < $maxIterations && ($volMax - $volMin > $epsilon || $valueMin != $valueMax)) {
$volBisection = $volMin + ($volMax - $volMin) * ($marketPrice - $valueMin) / ($valueMax - $valueMin);

// If the true implied volatility is outside of the interval [0.00001;5], the condition below ensures that it will be set to the closest bound
// If the true implied volatility is outside the interval [0.00001;5], the condition below ensures that it will be set to the closest bound
$volGuess = max($volMin, min($volBisection, $volMax));
$valueGuess = $this->getValues($type, $underlyingPrice, $strikePrice, $timeToMaturity, $volGuess)['value'];

Expand Down

0 comments on commit 5afad91

Please sign in to comment.