mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-14 20:01:18 +00:00
Update merge to "left" to avoid creating non-existing mark candles
This commit is contained in:
@@ -4314,8 +4314,8 @@ def test_combine_funding_and_mark(
|
||||
assert len(df) == 1
|
||||
|
||||
# Empty funding rates
|
||||
funding_rates = DataFrame([], columns=['date', 'open'])
|
||||
df = exchange.combine_funding_and_mark(funding_rates, mark_rates, futures_funding_rate)
|
||||
funding_rates2 = DataFrame([], columns=['date', 'open'])
|
||||
df = exchange.combine_funding_and_mark(funding_rates2, mark_rates, futures_funding_rate)
|
||||
if futures_funding_rate is not None:
|
||||
assert len(df) == 3
|
||||
assert df.iloc[0]['open_fund'] == futures_funding_rate
|
||||
@@ -4324,6 +4324,12 @@ def test_combine_funding_and_mark(
|
||||
else:
|
||||
assert len(df) == 0
|
||||
|
||||
# Empty mark candles
|
||||
mark_candles = DataFrame([], columns=['date', 'open'])
|
||||
df = exchange.combine_funding_and_mark(funding_rates, mark_candles, futures_funding_rate)
|
||||
|
||||
assert len(df) == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize('exchange,rate_start,rate_end,d1,d2,amount,expected_fees', [
|
||||
('binance', 0, 2, "2021-09-01 01:00:00", "2021-09-01 04:00:00", 30.0, 0.0),
|
||||
|
||||
Reference in New Issue
Block a user