allow null fee on calc_base_close

This commit is contained in:
Matthias 2023-03-01 07:25:33 +01:00
parent e5c9cde36f
commit a1166b1077

View File

@ -795,10 +795,10 @@ class LocalTrade():
return interest(exchange_name=self.exchange, borrowed=borrowed, rate=rate, hours=hours)
def _calc_base_close(self, amount: FtPrecise, rate: float, fee: float) -> FtPrecise:
def _calc_base_close(self, amount: FtPrecise, rate: float, fee: Optional[float]) -> FtPrecise:
close_trade = amount * FtPrecise(rate)
fees = close_trade * FtPrecise(fee)
fees = close_trade * FtPrecise(fee or 0.0)
if self.is_short:
return close_trade + fees