Updated LocalTrade.calc_close_trade_value formula for shorting futures
This commit is contained in:
parent
d5a1385fdc
commit
ae3688a18a
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user