From e192714b7557591c00abf215a1c31812dda5b111 Mon Sep 17 00:00:00 2001 From: edtechre Date: Tue, 23 Dec 2025 01:19:08 -0800 Subject: [PATCH 1/2] Fix type signature of add_execution --- src/pybroker/strategy.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pybroker/strategy.py b/src/pybroker/strategy.py index bcde212c..63d86a43 100644 --- a/src/pybroker/strategy.py +++ b/src/pybroker/strategy.py @@ -73,6 +73,10 @@ Optional, Union, ) +from typing_extensions import Concatenate, ParamSpec + + +P = ParamSpec("P") def _between( @@ -904,12 +908,12 @@ def set_slippage_model(self, slippage_model: Optional[SlippageModel]): def add_execution( self, - fn: Optional[Callable[[ExecContext], None]], + fn: Optional[Callable[Concatenate[ExecContext, P], None]], symbols: Union[str, Iterable[str]], models: Optional[Union[ModelSource, Iterable[ModelSource]]] = None, indicators: Optional[Union[Indicator, Iterable[Indicator]]] = None, - *args: Any, - **kwargs: Any, + *args: P.args, + **kwargs: P.kwargs, ): r"""Adds an execution to backtest. From 1bafae886fae3ce907142b255b61f982d6f4dbbb Mon Sep 17 00:00:00 2001 From: Ed West Date: Tue, 3 Feb 2026 14:29:03 -0800 Subject: [PATCH 2/2] Remove 'subtract_fees' parameter from config documentation --- src/pybroker/config.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pybroker/config.py b/src/pybroker/config.py index 91b73590..c595b1fc 100644 --- a/src/pybroker/config.py +++ b/src/pybroker/config.py @@ -29,8 +29,6 @@ class StrategyConfig: :class:`pybroker.common.FeeInfo`. - ``None``: Fees are disabled (default). fee_amount: Brokerage fee amount. - subtract_fees: Whether to subtract fees from the cash balance after an - order is filled. Defaults to ``False``. enable_fractional_shares: Whether to enable trading fractional shares. Set to ``True`` for crypto trading. Defaults to ``False``. round_fill_price: Whether to round fill prices to the nearest cent.