removed backtesting stuff, fixed mypy errors

This commit is contained in:
Sam Germain 2021-10-22 11:41:24 -06:00
parent b54711a2ea
commit 70332ce16f
3 changed files with 7 additions and 11 deletions

View File

@ -1808,7 +1808,7 @@ class Exchange:
pair: str,
amount: float,
open_date: datetime,
close_date: datetime
close_date: Optional[datetime]
) -> float:
"""
calculates the sum of all funding fees that occurred for a pair during a futures trade
@ -1820,7 +1820,7 @@ class Exchange:
fees: float = 0
if close_date:
close_date_timestamp = int(close_date.timestamp())
close_date_timestamp: Optional[int] = int(close_date.timestamp())
funding_rate_history = self.get_funding_rate_history(
pair,
int(open_date.timestamp()),
@ -1846,7 +1846,7 @@ class Exchange:
self,
pair: str,
start: int,
end: Optional[int]
end: Optional[int] = None
) -> Dict:
'''
:param pair: quote/base currency pair

View File

@ -1,6 +1,6 @@
""" Gate.io exchange subclass """
import logging
from typing import Dict, List
from typing import Dict, List, Optional
from freqtrade.exceptions import OperationalException
from freqtrade.exchange import Exchange
@ -36,12 +36,13 @@ class Gateio(Exchange):
def get_funding_rate_history(
self,
pair: str,
start: int,
end: int
end: Optional[int] = None
) -> Dict:
'''
:param start: timestamp in ms of the beginning time
:param end: timestamp in ms of the end time
'''
# TODO-lev: Has a max limit into the past of 333 days
return super().get_funding_rate_history(start, end)
return super().get_funding_rate_history(pair, start, end)

View File

@ -3,7 +3,6 @@
"""
This module contains the backtesting logic
"""
import ccxt
import logging
from collections import defaultdict
from copy import deepcopy
@ -127,10 +126,6 @@ class Backtesting:
self.progress = BTProgress()
self.abort = False
self.funding_rate_history = getattr(ccxt, self._exchange_name).load_funding_rate_history(
self.timerange.startts,
self.timerange.stopts
)
self.init_backtest()
def __del__(self):