Updated LocalTrade.calc_close_trade_value formula for shorting futures

This commit is contained in:
Sam Germain 2021-10-11 05:56:27 -06:00
parent d5a1385fdc
commit ae3688a18a

View File

@ -709,6 +709,9 @@ class LocalTrade():
elif (trading_mode == TradingMode.FUTURES):
funding_fees = self.funding_fees or 0.0
if self.is_short:
return float(self._calc_base_close(amount, rate, fee)) - funding_fees
else:
return float(self._calc_base_close(amount, rate, fee)) + funding_fees
else:
raise OperationalException(