From 8265881d6b5b15c4c27ef1fd670151b8d06c9a13 Mon Sep 17 00:00:00 2001 From: Jacek Witkowski Date: Mon, 16 Oct 2017 11:36:17 +0200 Subject: [PATCH] Simplified the calculation of total portfolio value in Portfolio --- qstrader/portfolio.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qstrader/portfolio.py b/qstrader/portfolio.py index 6cb6b0ef..dba61212 100644 --- a/qstrader/portfolio.py +++ b/qstrader/portfolio.py @@ -39,9 +39,7 @@ def _update_portfolio(self): ask = close_price pt.update_market_value(bid, ask) self.unrealised_pnl += pt.unrealised_pnl - self.equity += ( - pt.market_value - pt.cost_basis + pt.realised_pnl - ) + self.equity += pt.unrealised_pnl + pt.realised_pnl def _add_position( self, action, ticker,