Added test_update_funding_fees in freqtradebot, test currently fails
This commit is contained in:
@@ -1807,8 +1807,8 @@ class Exchange:
|
||||
int(open_date.timestamp() * 1000)
|
||||
)
|
||||
for date in self._get_funding_fee_dates(open_date, close_date):
|
||||
funding_rate = funding_rate_history[int(date.timestamp()) * 1000]
|
||||
mark_price = mark_price_history[int(date.timestamp()) * 1000]
|
||||
funding_rate = funding_rate_history[int(date.timestamp() * 1000)]
|
||||
mark_price = mark_price_history[int(date.timestamp() * 1000)]
|
||||
fees += self._get_funding_fee(
|
||||
contract_size=amount,
|
||||
mark_price=mark_price,
|
||||
|
@@ -268,7 +268,8 @@ class FreqtradeBot(LoggingMixin):
|
||||
|
||||
def update_funding_fees(self):
|
||||
if self.trading_mode == TradingMode.FUTURES:
|
||||
for trade in Trade.get_open_trades():
|
||||
trades = Trade.get_open_trades()
|
||||
for trade in trades:
|
||||
if self.config['dry_run']:
|
||||
funding_fees = self.exchange.calculate_funding_fees(
|
||||
trade.pair,
|
||||
|
Reference in New Issue
Block a user