calculate_funding_fees is actually a public exchange interface (used in backtesting).
This commit is contained in:
@@ -1923,7 +1923,7 @@ class Exchange:
|
||||
funding_rates = candle_histories[funding_comb]
|
||||
mark_rates = candle_histories[mark_comb]
|
||||
|
||||
return self._calculate_funding_fees(
|
||||
return self.calculate_funding_fees(
|
||||
funding_rates=funding_rates,
|
||||
mark_rates=mark_rates,
|
||||
amount=amount,
|
||||
@@ -1931,7 +1931,7 @@ class Exchange:
|
||||
close_date=close_date
|
||||
)
|
||||
|
||||
def _calculate_funding_fees(
|
||||
def calculate_funding_fees(
|
||||
self,
|
||||
funding_rates: DataFrame,
|
||||
mark_rates: DataFrame,
|
||||
|
@@ -159,7 +159,7 @@ class Kraken(Exchange):
|
||||
params['leverage'] = leverage
|
||||
return params
|
||||
|
||||
def _calculate_funding_fees(
|
||||
def calculate_funding_fees(
|
||||
self,
|
||||
funding_rates: DataFrame,
|
||||
mark_rates: DataFrame,
|
||||
|
@@ -488,7 +488,7 @@ class Backtesting:
|
||||
sell_candle_time: datetime = sell_row[DATE_IDX].to_pydatetime()
|
||||
|
||||
if self.trading_mode == TradingMode.FUTURES:
|
||||
trade.funding_fees = self.exchange._calculate_funding_fees(
|
||||
trade.funding_fees = self.exchange.calculate_funding_fees(
|
||||
funding_rates=self.futures_data[CandleType.FUNDING_RATE][trade.pair],
|
||||
mark_rates=self.futures_data[CandleType.MARK][trade.pair],
|
||||
amount=trade.amount,
|
||||
|
Reference in New Issue
Block a user