Merge pull request #6576 from samgermain/funding-tests

funding_fee tests
This commit is contained in:
Matthias
2022-03-25 15:11:45 +01:00
committed by GitHub
4 changed files with 26 additions and 28 deletions

View File

@@ -2301,11 +2301,10 @@ class Exchange:
timeframe = self._ft_has['mark_ohlcv_timeframe']
timeframe_ff = self._ft_has.get('funding_fee_timeframe',
self._ft_has['mark_ohlcv_timeframe'])
open_date = timeframe_to_prev_date(timeframe, open_date)
if not close_date:
close_date = datetime.now(timezone.utc)
open_timestamp = int(open_date.timestamp()) * 1000
open_timestamp = int(timeframe_to_prev_date(timeframe, open_date).timestamp()) * 1000
# close_timestamp = int(close_date.timestamp()) * 1000
mark_comb: PairWithTimeframe = (

View File

@@ -273,7 +273,7 @@ class FreqtradeBot(LoggingMixin):
pair=trade.pair,
amount=trade.amount,
is_short=trade.is_short,
open_date=trade.open_date
open_date=trade.open_date_utc
)
trade.funding_fees = funding_fees
else:
@@ -1350,7 +1350,7 @@ class FreqtradeBot(LoggingMixin):
pair=trade.pair,
amount=trade.amount,
is_short=trade.is_short,
open_date=trade.open_date,
open_date=trade.open_date_utc,
)
exit_type = 'exit'
if exit_check.exit_type in (ExitType.STOP_LOSS, ExitType.TRAILING_STOP_LOSS):