Don't attempt to calculate funding fees when the initial timeframe hasn't been exceeded.

This commit is contained in:
Wade Dyck 2021-12-27 16:51:47 -07:00
parent a26c82b7cc
commit 60dfadf446

View File

@ -1865,6 +1865,7 @@ class Exchange:
mark_rates = candle_histories[mark_comb]
df = funding_rates.merge(mark_rates, on='date', how="inner", suffixes=["_fund", "_mark"])
if not df.empty:
df = df[(df['date'] >= open_date) & (df['date'] <= close_date)]
fees = sum(df['open_fund'] * df['open_mark'] * amount)