Skip to content

Commit

Permalink
Update CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaveiga committed Sep 27, 2024
1 parent 7f5928f commit f2fa689
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
18 changes: 14 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# CHANGELOG

## 1.2.2 (2024-09-27)

- discriminator="type" removed from strategy: list[StrategyLeg] = Field(..., min_length=1) in models.py, since
it was causing errors in new Pydantic versions.
- Changed StotckStrategy and OptionStrategy to Stock and Option in models.py, respectively.
- Changed BaseStrategy to BaseLeg in models.py.
- Changed Strategy to StrategyLeg in models.py.
- Removed premium field from Stock in models.py.
- Moved n field to BaseLeg in models.py.

## 1.2.1 (2024-06-03)

- Add 1 to `time_to_target` and `time_to_maturity` in `engine.py` to consider the target and expiration dates as trading days in the calculations
- Change Jupyter notebooks in the `examples` directory to utilize the `run_strategy()` function for performing options strategy calculations, instead of using the `StrategyEngine` class (deprecated)
- Correct the PoP Calculator notebook
- Change the name of variable `project_target_ranges` in `models.py` and `engine.py` to `profit_target_ranges`
- Changed Jupyter notebooks in the `examples` directory to utilize the `run_strategy()` function for performing options strategy calculations, instead of using the `StrategyEngine` class (deprecated)
- Corrected the PoP Calculator notebook
- Changed the name of variable `project_target_ranges` in `models.py` and `engine.py` to `profit_target_ranges`

## 1.2.0 (2024-03-31)

- Add functions to run engine.
- Added functions to run engine.

## 1.1.0 (2024-03-24)

Expand Down
5 changes: 2 additions & 3 deletions optionlab/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Option(BaseLeg):
between this price and the current price is considered in
the payoff calculation.
"expiration" : string | int, optional.
Expiration date or days to maturity. If not defined, will use `target_date`
Expiration date or days to maturity. If not defined, will use `target_date`
or `days_to_target_date`.
"""

Expand Down Expand Up @@ -229,8 +229,7 @@ def validate_dates(self) -> "Inputs":
expiration_dates = [
strategy.expiration
for strategy in self.strategy
if isinstance(strategy, Option)
and isinstance(strategy.expiration, dt.date)
if isinstance(strategy, Option) and isinstance(strategy.expiration, dt.date)
]
if self.start_date and self.target_date:
if any(
Expand Down

0 comments on commit f2fa689

Please sign in to comment.