From 0a595190a3e622915defb62153ec3886ce5c4c54 Mon Sep 17 00:00:00 2001 From: xmatthias Date: Sat, 2 Jun 2018 13:59:35 +0200 Subject: [PATCH] fix last typechecks --- freqtrade/arguments.py | 3 ++- freqtrade/optimize/backtesting.py | 2 +- freqtrade/optimize/hyperopt.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/freqtrade/arguments.py b/freqtrade/arguments.py index 2421abc9f..fc917394e 100644 --- a/freqtrade/arguments.py +++ b/freqtrade/arguments.py @@ -211,7 +211,8 @@ class Arguments(object): self.hyperopt_options(hyperopt_cmd) @staticmethod - def parse_timerange(text: str) -> Optional[Tuple[Tuple, Optional[int], Optional[int]]]: + def parse_timerange(text: Optional[str]) -> Optional[Tuple[Tuple, + Optional[int], Optional[int]]]: """ Parse the value of the argument --timerange to determine what is the range desired :param text: value from --timerange diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 0e77572a5..78ab72988 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -219,7 +219,7 @@ class Backtesting(object): logger.info('Using local backtesting data (using whitelist in given config) ...') timerange = Arguments.parse_timerange(str(self.config.get('timerange'))) - data = optimize.load_data( + data = optimize.load_data( # type: ignore self.config['datadir'], pairs=pairs, ticker_interval=self.ticker_interval, diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index f6cbb270b..8b8e9576b 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -494,9 +494,9 @@ class Hyperopt(Backtesting): ) def start(self) -> None: - timerange = Arguments.parse_timerange(self.config.get('timerange') if self.config.get( + timerange = Arguments.parse_timerange(None if self.config.get( 'timerange') is None else str(self.config.get('timerange'))) - data = load_data( + data = load_data( # type: ignore datadir=str(self.config.get('datadir')), pairs=self.config['exchange']['pair_whitelist'], ticker_interval=self.ticker_interval,