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. 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.