@@ -340,8 +340,6 @@ class Portfolio:
340340 cash: Starting cash balance.
341341 fee_mode: Brokerage fee mode.
342342 fee_amount: Brokerage fee amount.
343- subtract_fees: Whether to subtract fees from the cash balance after an
344- order is filled.
345343 enable_fractional_shares: Whether to enable trading fractional shares.
346344 position_mode: Position mode for :class:`.Portfolio`.
347345 max_long_positions: Maximum number of long :class:`.Position`\ s that
@@ -358,7 +356,6 @@ class Portfolio:
358356 with the unrealized PnL of all open short positions.
359357 fees: Current brokerage fees.
360358 fee_amount: Brokerage fee amount.
361- subtract_fees: Whether to subtract fees from the cash balance.
362359 enable_fractional_shares: Whether to enable trading fractional shares.
363360 orders: ``deque`` of all filled orders, sorted in ascending
364361 chronological order.
@@ -384,7 +381,6 @@ def __init__(
384381 Union [FeeMode , Callable [[FeeInfo ], Decimal ], None ]
385382 ] = None ,
386383 fee_amount : Optional [float ] = None ,
387- subtract_fees : bool = False ,
388384 enable_fractional_shares : bool = False ,
389385 position_mode : PositionMode = PositionMode .DEFAULT ,
390386 max_long_positions : Optional [int ] = None ,
@@ -397,7 +393,6 @@ def __init__(
397393 self ._fee_amount : Optional [Decimal ] = (
398394 None if fee_amount is None else to_decimal (fee_amount )
399395 )
400- self ._subtract_fees = subtract_fees
401396 self ._enable_fractional_shares = enable_fractional_shares
402397 self ._position_mode = position_mode
403398 self .equity : Decimal = self .cash
@@ -513,7 +508,7 @@ def _add_order(
513508 )
514509 self .orders .append (order )
515510 self .fees += fees
516- if self ._subtract_fees :
511+ if self ._fee_mode is not None :
517512 self .cash -= fees
518513 return order
519514
0 commit comments