Small style fixes and adjusted tests

This commit is contained in:
Matthias
2019-10-27 10:56:38 +01:00
parent 73f5bff9c5
commit 132a4da7cf
7 changed files with 27 additions and 15 deletions

View File

@@ -147,7 +147,7 @@ def load_pair_history(pair: str,
"""
timerange_startup = deepcopy(timerange)
if startup_candles:
if startup_candles and timerange_startup:
logger.info('Using indicator startup period: %s ...', startup_candles)
timerange_startup.subtract_start(timeframe_to_seconds(ticker_interval) * startup_candles)

View File

@@ -447,6 +447,7 @@ class Exchange:
def validate_required_startup_candles(self, startup_candles) -> None:
"""
Checks if required startup_candles is more than ohlcv_candle_limit.
Requires a grace-period of 5 candles - so a startup-period up to 494 is allowed by default.
"""
if startup_candles + 5 > self._ft_has['ohlcv_candle_limit']:
raise OperationalException(

View File

@@ -22,8 +22,7 @@ from pandas import DataFrame
from skopt import Optimizer
from skopt.space import Dimension
from freqtrade.configuration import TimeRange
from freqtrade.data.history import load_data, get_timeframe, trim_dataframe
from freqtrade.data.history import get_timeframe, trim_dataframe
from freqtrade.misc import round_dict
from freqtrade.optimize.backtesting import Backtesting
# Import IHyperOpt and IHyperOptLoss to allow unpickling classes from these modules

View File

@@ -424,7 +424,7 @@ class IStrategy(ABC):
def tickerdata_to_dataframe(self, tickerdata: Dict[str, List]) -> Dict[str, DataFrame]:
"""
Creates a dataframe and populates indicators for given ticker data
Used by optimize operations only, not during dry / live runs.
Used by optimize operations only, not during dry / live runs.
"""
return {pair: self.advise_indicators(pair_data, {'pair': pair})
for pair, pair_data in tickerdata.items()}