From 36252a3da853ec3000802c563addff9655e4333b Mon Sep 17 00:00:00 2001
From: rgaveiga
Date: Mon, 22 Dec 2025 21:58:17 -0300
Subject: [PATCH 1/9] Update all changes
---
CHANGELOG.md | 9 +
docs/optionlab.html | 181 +-
docs/optionlab/black_scholes.html | 224 +--
docs/optionlab/engine.html | 28 +-
docs/optionlab/models.html | 2412 ++++++++++++-----------
docs/optionlab/plot.html | 24 +-
docs/optionlab/support.html | 584 +++---
docs/optionlab/utils.html | 64 +-
docs/search.js | 2 +-
examples/black_scholes_calculator.ipynb | 11 +-
examples/calendar_spread.ipynb | 12 +-
examples/call_spread.ipynb | 30 +-
examples/covered_call.ipynb | 14 +-
examples/naked_call.ipynb | 52 +-
optionlab/.gitignore | 1 +
optionlab/__init__.py | 129 +-
optionlab/black_scholes.py | 88 +-
optionlab/engine.py | 10 +-
optionlab/models.py | 26 +-
optionlab/plot.py | 8 +-
optionlab/price_array.py | 100 -
optionlab/support.py | 214 +-
optionlab/utils.py | 24 +-
pyproject.toml | 2 +-
tests/.gitignore | 4 +-
tests/test_core.py | 145 +-
tests/test_misc.py | 131 --
tests/test_models.py | 2 +-
28 files changed, 2062 insertions(+), 2469 deletions(-)
delete mode 100644 optionlab/price_array.py
delete mode 100644 tests/test_misc.py
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5f649af..4cbfbbe 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,14 @@
# CHANGELOG
+## 1.5.0 (2025-12-14)
+
+- Changed `get_pop` to compute the expected profit and expected loss of a strategy with the Black-Scholes model by calling a new function, `_compute_expected_returns_bs`.
+- Updated docstrings.
+- Removed price_array.py (a better Monte Carlo implementation is coming soon).
+- The `expected_return_above_target` and `expected_return_below_target` fields in `PoPOutputs`, in models.py, are no longer optional but floats with default value of 0.0.
+- The same for the `expected_profit` and `expected_loss` fields in `EngineData` and `Outputs`, both also in models.py.
+- Removed test_misc.py.
+
## 1.4.3 (2025-04-14)
- Updated docstrings.
diff --git a/docs/optionlab.html b/docs/optionlab.html
index 155e707..c8d756e 100644
--- a/docs/optionlab.html
+++ b/docs/optionlab.html
@@ -3,14 +3,14 @@
-
+
optionlab API documentation
-
+
+
the expected profit and expected loss of the strategy
+
the probability of profit
The probability of profit (PoP) of the strategy on the user-defined target date
-is calculated analytically by default using the Black-Scholes model. Alternatively,
+is calculated analytically by using the Black-Scholes model. Alternatively,
the user can provide an array of terminal underlying asset prices obtained from
-other sources (e.g., the Heston model, a Laplace distribution, or a Machine Learning/Deep Learning model)
-to be used in the calculations instead of the Black-Scholes model. This allows
-OptionLab to function as a calculator that supports a variety of pricing
-models.
+other sources (e.g., the Heston model, a Laplace distribution, or a Machine
+Learning/Deep Learning model) to be used in the calculations instead of the
+Black-Scholes model. This allows OptionLab to function as a calculator that
+supports a variety of pricing models.
An advanced feature of OptionLab that provides great flexibility in building
complex dynamic strategies is the ability to include previously created positions
@@ -225,28 +221,28 @@
Examples
7 8**OptionLab** calculations can produce a number of useful outputs: 9
- 10- the profit/loss profile of the strategy on a user-defined target date,
+ 10- the profit/loss profile of the strategy on a user-defined target date 11
- 12- the range of stock prices for which the strategy is profitable,
+ 12- the range of stock prices for which the strategy is profitable 13
- 14- the Greeks associated with each leg of the strategy,
+ 14- the Greeks associated with each leg of the strategy 15
- 16- the resulting debit or credit on the trading account,
+ 16- the resulting debit or credit on the trading account 17 18- the maximum and minimum returns within a specified lower and higher price range
- 19of the underlying asset,
+ 19of the underlying asset 20
- 21- the expected profit and expected loss, and
+ 21- the expected profit and expected loss of the strategy 22
- 23- an estimate of the strategy's probability of profit.
+ 23- the probability of profit 24 25The probability of profit (PoP) of the strategy on the user-defined target date
- 26is calculated analytically by default using the Black-Scholes model. Alternatively,
+ 26is calculated analytically by using the Black-Scholes model. Alternatively, 27the user can provide an array of terminal underlying asset prices obtained from
- 28other sources (e.g., the Heston model, a Laplace distribution, or a Machine Learning/Deep Learning model)
- 29to be used in the calculations instead of the Black-Scholes model. This allows
- 30**OptionLab** to function as a calculator that supports a variety of pricing
- 31models.
+ 28other sources (e.g., the Heston model, a Laplace distribution, or a Machine
+ 29Learning/Deep Learning model) to be used in the calculations instead of the
+ 30Black-Scholes model. This allows **OptionLab** to function as a calculator that
+ 31supports a variety of pricing models. 32 33An advanced feature of **OptionLab** that provides great flexibility in building 34complex dynamic strategies is the ability to include previously created positions
@@ -367,128 +363,17 @@