mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-14 04:03:55 +00:00
parent
427d762746
commit
7ee149da5d
|
@ -53,7 +53,7 @@ def init_plotscript(config, markets: List, startup_candles: int = 0):
|
||||||
data_format=config.get('dataformat_ohlcv', 'json'),
|
data_format=config.get('dataformat_ohlcv', 'json'),
|
||||||
)
|
)
|
||||||
|
|
||||||
if startup_candles:
|
if startup_candles and data:
|
||||||
min_date, max_date = get_timerange(data)
|
min_date, max_date = get_timerange(data)
|
||||||
logger.info(f"Loading data from {min_date} to {max_date}")
|
logger.info(f"Loading data from {min_date} to {max_date}")
|
||||||
timerange.adjust_start_if_necessary(timeframe_to_seconds(config.get('timeframe', '5m')),
|
timerange.adjust_start_if_necessary(timeframe_to_seconds(config.get('timeframe', '5m')),
|
||||||
|
@ -67,7 +67,7 @@ def init_plotscript(config, markets: List, startup_candles: int = 0):
|
||||||
if not filename.is_dir() and not filename.is_file():
|
if not filename.is_dir() and not filename.is_file():
|
||||||
logger.warning("Backtest file is missing skipping trades.")
|
logger.warning("Backtest file is missing skipping trades.")
|
||||||
no_trades = True
|
no_trades = True
|
||||||
|
try:
|
||||||
trades = load_trades(
|
trades = load_trades(
|
||||||
config['trade_source'],
|
config['trade_source'],
|
||||||
db_url=config.get('db_url'),
|
db_url=config.get('db_url'),
|
||||||
|
@ -75,6 +75,8 @@ def init_plotscript(config, markets: List, startup_candles: int = 0):
|
||||||
no_trades=no_trades,
|
no_trades=no_trades,
|
||||||
strategy=config.get('strategy'),
|
strategy=config.get('strategy'),
|
||||||
)
|
)
|
||||||
|
except ValueError as e:
|
||||||
|
raise OperationalException(e) from e
|
||||||
trades = trim_dataframe(trades, timerange, 'open_date')
|
trades = trim_dataframe(trades, timerange, 'open_date')
|
||||||
|
|
||||||
return {"ohlcv": data,
|
return {"ohlcv": data,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user