From 9477dbbd079594158fc92b1821447d44fe9cf66a Mon Sep 17 00:00:00 2001 From: Samuel Husso Date: Sat, 10 Feb 2018 10:46:26 +0200 Subject: [PATCH] parse ccxt ticker --- freqtrade/analyze.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/freqtrade/analyze.py b/freqtrade/analyze.py index 70bf40936..08672cf00 100644 --- a/freqtrade/analyze.py +++ b/freqtrade/analyze.py @@ -27,12 +27,13 @@ def parse_ticker_dataframe(ticker: list) -> DataFrame: :param ticker: See exchange.get_ticker_history :return: DataFrame """ - columns = {'C': 'close', 'V': 'volume', 'O': 'open', 'H': 'high', 'L': 'low', 'T': 'date'} - frame = DataFrame(ticker) \ - .rename(columns=columns) - if 'BV' in frame: - frame.drop('BV', 1, inplace=True) - frame['date'] = to_datetime(frame['date'], utc=True, infer_datetime_format=True) + cols = ['date', 'open', 'high', 'low', 'close', 'volume'] + frame = DataFrame(ticker, columns=cols) + + frame['date'] = to_datetime(frame['date'], + unit='ms', + utc=True, + infer_datetime_format=True) frame.sort_values('date', inplace=True) return frame @@ -82,8 +83,6 @@ def analyze_ticker(ticker_history: List[Dict]) -> DataFrame: return dataframe -# FIX: Maybe return False, if an error has occured, -# Otherwise we might mask an error as an non-signal-scenario def get_signal(pair: str, interval: int) -> (bool, bool): """ Calculates current signal based several technical analysis indicators