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

View File

@ -1,6 +1,6 @@
""" Gate.io exchange subclass """ """ Gate.io exchange subclass """
import logging import logging
from typing import Dict, List from typing import Dict, List, Optional
from freqtrade.exceptions import OperationalException from freqtrade.exceptions import OperationalException
from freqtrade.exchange import Exchange from freqtrade.exchange import Exchange
@ -36,12 +36,13 @@ class Gateio(Exchange):
def get_funding_rate_history( def get_funding_rate_history(
self, self,
pair: str,
start: int, start: int,
end: int end: Optional[int] = None
) -> Dict: ) -> Dict:
''' '''
:param start: timestamp in ms of the beginning time :param start: timestamp in ms of the beginning time
:param end: timestamp in ms of the end time :param end: timestamp in ms of the end time
''' '''
# TODO-lev: Has a max limit into the past of 333 days # 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 This module contains the backtesting logic
""" """
import ccxt
import logging import logging
from collections import defaultdict from collections import defaultdict
from copy import deepcopy from copy import deepcopy
@ -127,10 +126,6 @@ class Backtesting:
self.progress = BTProgress() self.progress = BTProgress()
self.abort = False 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() self.init_backtest()
def __del__(self): def __del__(self):