Fix bug in RPC history mode when no data is found

This commit is contained in:
Matthias
2021-01-06 15:38:46 +01:00
parent a9ca72c1b8
commit e69dac2704
2 changed files with 10 additions and 0 deletions

View File

@@ -788,6 +788,8 @@ class RPC:
timerange=timerange_parsed,
data_format=config.get('dataformat_ohlcv', 'json'),
)
if pair not in _data:
raise RPCException(f"No data for {pair}, {timeframe} in {timerange} found.")
from freqtrade.resolvers.strategy_resolver import StrategyResolver
strategy = StrategyResolver.load_strategy(config)
df_analyzed = strategy.analyze_ticker(_data[pair], {'pair': pair})