Typecheck improvements

This commit is contained in:
xmatthias
2018-06-02 13:43:51 +02:00
parent e28973c50a
commit 4a322abd4d
3 changed files with 9 additions and 8 deletions

View File

@@ -78,7 +78,7 @@ class Backtesting(object):
Generates and returns a text table for the given backtest data and the results dataframe
:return: pretty printed table with tabulate as str
"""
stake_currency = self.config.get('stake_currency')
stake_currency = str(self.config.get('stake_currency'))
floatfmt = ('s', 'd', '.2f', '.8f', '.1f')
tabular_data = []
@@ -168,7 +168,7 @@ class Backtesting(object):
record = args.get('record', None)
records = []
trades = []
trade_count_lock = {}
trade_count_lock: Dict = {}
for pair, pair_data in processed.items():
pair_data['buy'], pair_data['sell'] = 0, 0 # cleanup from previous run
@@ -230,7 +230,7 @@ class Backtesting(object):
else:
logger.info('Using local backtesting data (using whitelist in given config) ...')
timerange = Arguments.parse_timerange(self.config.get('timerange'))
timerange = Arguments.parse_timerange(str(self.config.get('timerange')))
data = optimize.load_data(
self.config['datadir'],
pairs=pairs,

View File

@@ -494,9 +494,10 @@ class Hyperopt(Backtesting):
)
def start(self) -> None:
timerange = Arguments.parse_timerange(self.config.get('timerange'))
timerange = Arguments.parse_timerange(self.config.get('timerange') if self.config.get(
'timerange') is None else str(self.config.get('timerange')))
data = load_data(
datadir=self.config.get('datadir'),
datadir=str(self.config.get('datadir')),
pairs=self.config['exchange']['pair_whitelist'],
ticker_interval=self.ticker_interval,
timerange=timerange