We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 590dee7 commit 56681cfCopy full SHA for 56681cf
backtesting/backtesting.py
@@ -671,9 +671,12 @@ def is_short(self):
671
672
@property
673
def pl(self):
674
- """Trade profit (positive) or loss (negative) in cash units."""
+ """
675
+ Trade profit (positive) or loss (negative) in cash units.
676
+ Commissions are reflected only after the Trade is closed.
677
678
price = self.__exit_price or self.__broker.last_price
- return self.__size * (price - self.__entry_price)
679
+ return (self.__size * (price - self.__entry_price)) - self._commissions
680
681
682
def pl_pct(self):
0 commit comments