refactor
This commit is contained in:
parent
69f68c428e
commit
feca87345f
@ -61,6 +61,11 @@ def load_data(datadir: str, ticker_interval: int = 5, pairs: Optional[List[str]]
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def tickerdata_to_dataframe(data):
|
||||||
|
preprocessed = preprocess(data)
|
||||||
|
return preprocessed
|
||||||
|
|
||||||
|
|
||||||
def preprocess(tickerdata: Dict[str, List]) -> Dict[str, DataFrame]:
|
def preprocess(tickerdata: Dict[str, List]) -> Dict[str, DataFrame]:
|
||||||
"""Creates a dataframe and populates indicators for given ticker data"""
|
"""Creates a dataframe and populates indicators for given ticker data"""
|
||||||
return {pair: populate_indicators(parse_ticker_dataframe(pair_data))
|
return {pair: populate_indicators(parse_ticker_dataframe(pair_data))
|
||||||
|
@ -13,7 +13,6 @@ from freqtrade.analyze import populate_buy_trend, populate_sell_trend
|
|||||||
from freqtrade.exchange import Bittrex
|
from freqtrade.exchange import Bittrex
|
||||||
from freqtrade.main import min_roi_reached
|
from freqtrade.main import min_roi_reached
|
||||||
import freqtrade.misc as misc
|
import freqtrade.misc as misc
|
||||||
from freqtrade.optimize import preprocess
|
|
||||||
import freqtrade.optimize as optimize
|
import freqtrade.optimize as optimize
|
||||||
from freqtrade.persistence import Trade
|
from freqtrade.persistence import Trade
|
||||||
|
|
||||||
@ -162,12 +161,12 @@ def start(args):
|
|||||||
data[pair] = exchange.get_ticker_history(pair, args.ticker_interval)
|
data[pair] = exchange.get_ticker_history(pair, args.ticker_interval)
|
||||||
else:
|
else:
|
||||||
logger.info('Using local backtesting data (using whitelist in given config) ...')
|
logger.info('Using local backtesting data (using whitelist in given config) ...')
|
||||||
data = optimize.load_data(args.datadir, pairs=pairs, ticker_interval=args.ticker_interval,
|
|
||||||
refresh_pairs=args.refresh_pairs)
|
|
||||||
|
|
||||||
logger.info('Using stake_currency: %s ...', config['stake_currency'])
|
logger.info('Using stake_currency: %s ...', config['stake_currency'])
|
||||||
logger.info('Using stake_amount: %s ...', config['stake_amount'])
|
logger.info('Using stake_amount: %s ...', config['stake_amount'])
|
||||||
|
|
||||||
|
data = optimize.load_data(args.datadir, pairs=pairs, ticker_interval=args.ticker_interval,
|
||||||
|
refresh_pairs=args.refresh_pairs)
|
||||||
|
|
||||||
max_open_trades = 0
|
max_open_trades = 0
|
||||||
if args.realistic_simulation:
|
if args.realistic_simulation:
|
||||||
logger.info('Using max_open_trades: %s ...', config['max_open_trades'])
|
logger.info('Using max_open_trades: %s ...', config['max_open_trades'])
|
||||||
@ -177,7 +176,7 @@ def start(args):
|
|||||||
from freqtrade import main
|
from freqtrade import main
|
||||||
main._CONF = config
|
main._CONF = config
|
||||||
|
|
||||||
preprocessed = preprocess(data)
|
preprocessed = optimize.tickerdata_to_dataframe(data)
|
||||||
# Print timeframe
|
# Print timeframe
|
||||||
min_date, max_date = get_timeframe(preprocessed)
|
min_date, max_date = get_timeframe(preprocessed)
|
||||||
logger.info('Measuring data from %s up to %s ...', min_date.isoformat(), max_date.isoformat())
|
logger.info('Measuring data from %s up to %s ...', min_date.isoformat(), max_date.isoformat())
|
||||||
|
@ -230,8 +230,8 @@ def start(args):
|
|||||||
logger.info('Using config: %s ...', args.config)
|
logger.info('Using config: %s ...', args.config)
|
||||||
config = load_config(args.config)
|
config = load_config(args.config)
|
||||||
pairs = config['exchange']['pair_whitelist']
|
pairs = config['exchange']['pair_whitelist']
|
||||||
PROCESSED = optimize.preprocess(optimize.load_data(
|
data = optimize.load_data(args.datadir, pairs=pairs, ticker_interval=args.ticker_interval)
|
||||||
args.datadir, pairs=pairs, ticker_interval=args.ticker_interval))
|
PROCESSED = optimize.tickerdata_to_dataframe(data)
|
||||||
|
|
||||||
if args.mongodb:
|
if args.mongodb:
|
||||||
logger.info('Using mongodb ...')
|
logger.info('Using mongodb ...')
|
||||||
|
Loading…
Reference in New Issue
Block a user