Skip to content

Commit 1fa9168

Browse files
authored
Merge branch 'main' into refactor-get-profit-range
2 parents 13ae03a + 00f5628 commit 1fa9168

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CHANGELOG
22

3-
## 1.4.1 (2025-01-04)
3+
## 1.4.1 (2025-01-23)
44

55
- Removed a small bug in `create_price_seq` in support.py
66
- Improved the algorithm in `get_profit_range` in support.py, then renamed to `_get_profit_range`

optionlab/support.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import numpy as np
88
from numpy import abs, round, arange, sum, exp
9+
910
from numpy.lib.scimath import log, sqrt
1011
from scipy import stats
1112

@@ -27,9 +28,9 @@ def get_pl_profile(
2728
x: float,
2829
val: float,
2930
n: int,
30-
s: np.ndarray,
31+
s: ndarray,
3132
commission: float = 0.0,
32-
) -> tuple[np.ndarray, float]:
33+
) -> tuple[ndarray, float]:
3334
"""
3435
Returns the profit/loss profile and cost of an options trade at expiration.
3536
@@ -73,8 +74,8 @@ def get_pl_profile(
7374

7475

7576
def get_pl_profile_stock(
76-
s0: float, action: Action, n: int, s: np.ndarray, commission: float = 0.0
77-
) -> tuple[np.ndarray, float]:
77+
s0: float, action: Action, n: int, s: ndarray, commission: float = 0.0
78+
) -> tuple[ndarray, float]:
7879
"""
7980
Returns the profit/loss profile and cost of a stock position.
8081
@@ -116,7 +117,7 @@ def get_pl_profile_bs(
116117
target_to_maturity_years: float,
117118
volatility: float,
118119
n: int,
119-
s: np.ndarray,
120+
s: ndarray,
120121
y: float = 0.0,
121122
commission: float = 0.0,
122123
) -> tuple[FloatOrNdarray, float]:
@@ -175,7 +176,7 @@ def get_pl_profile_bs(
175176

176177

177178
@lru_cache
178-
def create_price_seq(min_price: float, max_price: float) -> np.ndarray:
179+
def create_price_seq(min_price: float, max_price: float) -> ndarray:
179180
"""
180181
Generates a sequence of stock prices from a minimum to a maximum price with
181182
increment $0.01.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "optionlab"
33
version = "1.4.1"
44
description = "Python library for evaluating options trading strategies"
5+
56
authors = ["Roberto Gomes, PhD <[email protected]>"]
67
readme = "README.md"
78

0 commit comments

Comments
 (0)