'Updates the value of all positions that are currently open.
Value of closed positions is tallied as self.realised_pnl.'

def _update_portfolio(self):

    self.unrealised_pnl = 0
    self.equity = self.realised_pnl
    self.equity += self.init_cash
    for ticker in self.positions:
        pt = self.positions[ticker]
        if self.price_handler.istick():
            (bid, ask) = self.price_handler.get_best_bid_ask(ticker)
        else:
            close_price = self.price_handler.get_last_close(ticker)
            bid = close_price
            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)
