updated exchange.get_funding_fee_dates with better names
This commit is contained in:
parent
7122cb2fe9
commit
01229ad631
@ -1711,18 +1711,18 @@ class Exchange:
|
|||||||
'''
|
'''
|
||||||
return d.minute > 0 or d.second > 0
|
return d.minute > 0 or d.second > 0
|
||||||
|
|
||||||
def _get_funding_fee_dates(self, d1: datetime, d2: datetime):
|
def _get_funding_fee_dates(self, start: datetime, end: datetime):
|
||||||
if self.funding_fee_cutoff(d1):
|
if self.funding_fee_cutoff(start):
|
||||||
d1 += timedelta(hours=1)
|
start += timedelta(hours=1)
|
||||||
d1 = datetime(d1.year, d1.month, d1.day, d1.hour, tzinfo=timezone.utc)
|
start = datetime(start.year, start.month, start.day, start.hour, tzinfo=timezone.utc)
|
||||||
d2 = datetime(d2.year, d2.month, d2.day, d2.hour, tzinfo=timezone.utc)
|
end = datetime(end.year, end.month, end.day, end.hour, tzinfo=timezone.utc)
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
d3 = d1
|
iterator = start
|
||||||
while d3 <= d2:
|
while iterator <= end:
|
||||||
if d3.hour in self.funding_fee_times:
|
if iterator.hour in self.funding_fee_times:
|
||||||
results.append(d3)
|
results.append(iterator)
|
||||||
d3 += timedelta(hours=1)
|
iterator += timedelta(hours=1)
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user