def cal_close_today_amount(self, trade_amount, trade_side):
    if (trade_side == SIDE.SELL):
        close_today_amount = (trade_amount - self.buy_old_quantity)
    else:
        close_today_amount = (trade_amount - self.sell_old_quantity)
    return max(close_today_amount, 0)
def cal_close_today_amount(self, trade_amount, trade_side):
    if (trade_side == SIDE.SELL):
        close_today_amount = (trade_amount - self.buy_old_quantity)
    else:
        close_today_amount = (trade_amount - self.sell_old_quantity)
    return max(close_today_amount, 0)