Don't attempt to calculate funding fees when the initial timeframe hasn't been exceeded.
This commit is contained in:
parent
a26c82b7cc
commit
60dfadf446
@ -1865,8 +1865,9 @@ class Exchange:
|
|||||||
mark_rates = candle_histories[mark_comb]
|
mark_rates = candle_histories[mark_comb]
|
||||||
|
|
||||||
df = funding_rates.merge(mark_rates, on='date', how="inner", suffixes=["_fund", "_mark"])
|
df = funding_rates.merge(mark_rates, on='date', how="inner", suffixes=["_fund", "_mark"])
|
||||||
df = df[(df['date'] >= open_date) & (df['date'] <= close_date)]
|
if not df.empty:
|
||||||
fees = sum(df['open_fund'] * df['open_mark'] * amount)
|
df = df[(df['date'] >= open_date) & (df['date'] <= close_date)]
|
||||||
|
fees = sum(df['open_fund'] * df['open_mark'] * amount)
|
||||||
|
|
||||||
return fees
|
return fees
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user