'Calculates PnL up to this point.
If the position is not closed, these will be unrealized PnL.'

def getPnL(self, includeCommissions=True):

    if (includeCommissions is False):
        warninghelpers.deprecation_warning('includeCommissions    will    be    deprecated    in    the    next    version.', stacklevel=2)
    ret = 0
    price = self.getLastPrice()
    if (price is not None):
        ret = self.__posTracker.getPnL(price=price, includeCommissions=includeCommissions)
    return ret
