Skip to content

Commit

Permalink
update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuizi7 committed May 23, 2020
1 parent e9acda1 commit 90bf7ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rqalpha/portfolio/position.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ def position_pnl(self):
@property
def pnl(self):
# type: () -> float
"""
返回该持仓的累积盈亏
"""
if self.quantity == 0:
return 0
return (self.last_price - self.avg_price) * self.quantity * self._direction_factor
Expand Down

0 comments on commit 90bf7ad

Please sign in to comment.