Small style fixes and adjusted tests
This commit is contained in:
@@ -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)
|
||||
|
||||
|
@@ -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(
|
||||
|
@@ -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
|
||||
|
@@ -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()}
|
||||
|
Reference in New Issue
Block a user