remove get_tickers_data from plot_dataframe

This commit is contained in:
Matthias 2019-06-22 16:45:38 +02:00
parent d8286d7a98
commit 026784efac

View File

@ -31,7 +31,7 @@ from typing import Any, Dict, List
import pandas as pd import pandas as pd
from freqtrade.arguments import Arguments, TimeRange from freqtrade.arguments import Arguments
from freqtrade.data import history from freqtrade.data import history
from freqtrade.data.btanalysis import load_trades, extract_trades_of_period from freqtrade.data.btanalysis import load_trades, extract_trades_of_period
from freqtrade.optimize import setup_configuration from freqtrade.optimize import setup_configuration
@ -43,38 +43,6 @@ from freqtrade.state import RunMode
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def get_tickers_data(strategy, exchange, pairs: List[str], timerange: TimeRange,
datadir: Path, refresh_pairs: bool, live: bool):
"""
Get tickers data for each pairs on live or local, option defined in args
:return: dictionary of tickers. output format: {'pair': tickersdata}
"""
ticker_interval = strategy.ticker_interval
tickers = history.load_data(
datadir=datadir,
pairs=pairs,
ticker_interval=ticker_interval,
refresh_pairs=refresh_pairs,
timerange=timerange,
exchange=exchange,
live=live,
)
# No ticker found, impossible to download, len mismatch
for pair, data in tickers.copy().items():
logger.debug("checking tickers data of pair: %s", pair)
logger.debug("data.empty: %s", data.empty)
logger.debug("len(data): %s", len(data))
if data.empty:
del tickers[pair]
logger.info(
'An issue occured while retreiving data of %s pair, please retry '
'using -l option for live or --refresh-pairs-cached', pair)
return tickers
def generate_dataframe(strategy, tickers, pair) -> pd.DataFrame: def generate_dataframe(strategy, tickers, pair) -> pd.DataFrame:
""" """
Get tickers then Populate strategy indicators and signals, then return the full dataframe Get tickers then Populate strategy indicators and signals, then return the full dataframe
@ -113,10 +81,16 @@ def analyse_and_plot_pairs(config: Dict[str, Any]):
timerange = Arguments.parse_timerange(config["timerange"]) timerange = Arguments.parse_timerange(config["timerange"])
ticker_interval = strategy.ticker_interval ticker_interval = strategy.ticker_interval
tickers = get_tickers_data(strategy, exchange, pairs, timerange, tickers = history.load_data(
datadir=Path(str(config.get("datadir"))), datadir=Path(str(config.get("datadir"))),
refresh_pairs=config.get('refresh_pairs', False), pairs=pairs,
live=config.get("live", False)) ticker_interval=config['ticker_interval'],
refresh_pairs=config.get('refresh_pairs', False),
timerange=timerange,
exchange=exchange,
live=config.get("live", False),
)
pair_counter = 0 pair_counter = 0
for pair, data in tickers.items(): for pair, data in tickers.items():
pair_counter += 1 pair_counter += 1