def _cal_realized_pnl(self, cost_price, trade_price, side, consumed_quantity):
    if (side == SIDE.BUY):
        return (((cost_price - trade_price) * consumed_quantity) * self.contract_multiplier)
    else:
        return (((trade_price - cost_price) * consumed_quantity) * self.contract_multiplier)
def _cal_realized_pnl(self, cost_price, trade_price, side, consumed_quantity):
    if (side == SIDE.BUY):
        return (((cost_price - trade_price) * consumed_quantity) * self.contract_multiplier)
    else:
        return (((trade_price - cost_price) * consumed_quantity) * self.contract_multiplier)