Cleanup plotting (if you have backtest results, no need to download

data!)
This commit is contained in:
Matthias 2019-08-22 16:24:57 +02:00
parent f8c72feea8
commit 99b2be90fd
2 changed files with 3 additions and 12 deletions

View File

@ -35,7 +35,7 @@ ARGS_CREATE_USERDIR = ["user_data_dir"]
ARGS_DOWNLOAD_DATA = ["pairs", "pairs_file", "days", "exchange", "timeframes", "erase"] ARGS_DOWNLOAD_DATA = ["pairs", "pairs_file", "days", "exchange", "timeframes", "erase"]
ARGS_PLOT_DATAFRAME = ["pairs", "indicators1", "indicators2", "plot_limit", "db_url", ARGS_PLOT_DATAFRAME = ["pairs", "indicators1", "indicators2", "plot_limit", "db_url",
"trade_source", "export", "exportfilename", "timerange", "refresh_pairs"] "trade_source", "export", "exportfilename", "timerange"]
ARGS_PLOT_PROFIT = (ARGS_COMMON + ARGS_STRATEGY + ARGS_PLOT_PROFIT = (ARGS_COMMON + ARGS_STRATEGY +
["pairs", "timerange", "export", "exportfilename", "db_url", "trade_source"]) ["pairs", "timerange", "export", "exportfilename", "db_url", "trade_source"])

View File

@ -1,6 +1,6 @@
import logging import logging
from pathlib import Path from pathlib import Path
from typing import Any, Dict, List, Optional from typing import Any, Dict, List
import pandas as pd import pandas as pd
@ -9,8 +9,7 @@ from freqtrade.data import history
from freqtrade.data.btanalysis import (combine_tickers_with_mean, from freqtrade.data.btanalysis import (combine_tickers_with_mean,
create_cum_profit, create_cum_profit,
extract_trades_of_period, load_trades) extract_trades_of_period, load_trades)
from freqtrade.exchange import Exchange from freqtrade.resolvers import StrategyResolver
from freqtrade.resolvers import ExchangeResolver, StrategyResolver
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -29,12 +28,6 @@ def init_plotscript(config):
Initialize objects needed for plotting Initialize objects needed for plotting
:return: Dict with tickers, trades, pairs and strategy :return: Dict with tickers, trades, pairs and strategy
""" """
exchange: Optional[Exchange] = None
# Exchange is only needed when downloading data!
if config.get("refresh_pairs", False):
exchange = ExchangeResolver(config.get('exchange', {}).get('name'),
config).exchange
strategy = StrategyResolver(config).strategy strategy = StrategyResolver(config).strategy
if "pairs" in config: if "pairs" in config:
@ -49,9 +42,7 @@ def init_plotscript(config):
datadir=Path(str(config.get("datadir"))), datadir=Path(str(config.get("datadir"))),
pairs=pairs, pairs=pairs,
ticker_interval=config['ticker_interval'], ticker_interval=config['ticker_interval'],
refresh_pairs=config.get('refresh_pairs', False),
timerange=timerange, timerange=timerange,
exchange=exchange,
) )
trades = load_trades(config) trades = load_trades(config)