Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/pybroker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 7 additions & 3 deletions src/pybroker/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
Optional,
Union,
)
from typing_extensions import Concatenate, ParamSpec


P = ParamSpec("P")


def _between(
Expand Down Expand Up @@ -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.

Expand Down
Loading