mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-13 12:00:16 +08:00
BUG: Make payout affect ending_cash.
The payout should be reflected in ending cash, not just the total used for pnl.
This commit is contained in:
@@ -252,8 +252,8 @@ class PerformancePeriod(object):
|
||||
payout = self._get_payout_total(pt.positions)
|
||||
|
||||
total_at_start = self.starting_cash + self.starting_value
|
||||
self.ending_cash = self.starting_cash + self.period_cash_flow
|
||||
total_at_end = self.ending_cash + self.ending_value + payout
|
||||
self.ending_cash = self.starting_cash + self.period_cash_flow + payout
|
||||
total_at_end = self.ending_cash + self.ending_value
|
||||
|
||||
self.pnl = total_at_end - total_at_start
|
||||
if total_at_start != 0:
|
||||
|
||||
Reference in New Issue
Block a user