diff --git a/freqtrade/analyze.py b/freqtrade/analyze.py index e10959ad2..3e65cb997 100644 --- a/freqtrade/analyze.py +++ b/freqtrade/analyze.py @@ -81,8 +81,7 @@ def analyze_ticker(pair: str) -> DataFrame: add several TA indicators and buy signal to it :return DataFrame with ticker data and indicator data """ - minimum_date = arrow.utcnow().shift(hours=-24) - data = get_ticker_history(pair, minimum_date) + data = get_ticker_history(pair) dataframe = parse_ticker_dataframe(data) if dataframe.empty: diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index 29236eb5d..c0e390832 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -96,8 +96,8 @@ def get_ticker(pair: str) -> dict: return _API.get_ticker(pair) -def get_ticker_history(pair: str, minimum_date: arrow.Arrow) -> List: - return _API.get_ticker_history(pair, minimum_date) +def get_ticker_history(pair: str) -> List: + return _API.get_ticker_history(pair) def cancel_order(order_id: str) -> None: diff --git a/freqtrade/exchange/bittrex.py b/freqtrade/exchange/bittrex.py index b0aca09b7..f7011ce2e 100644 --- a/freqtrade/exchange/bittrex.py +++ b/freqtrade/exchange/bittrex.py @@ -1,7 +1,6 @@ import logging -from typing import List, Optional, Dict +from typing import List, Dict -import arrow import requests from bittrex.bittrex import Bittrex as _Bittrex @@ -87,7 +86,7 @@ class Bittrex(Exchange): 'last': float(data['result']['Last']), } - def get_ticker_history(self, pair: str, minimum_date: Optional[arrow.Arrow] = None): + def get_ticker_history(self, pair: str): url = self.TICKER_METHOD headers = { # TODO: Set as global setting @@ -96,15 +95,12 @@ class Bittrex(Exchange): params = { 'marketName': pair.replace('_', '-'), 'tickInterval': self.TICKER_INTERVAL, - # TODO: Timestamp has no effect on API response - '_': minimum_date.timestamp * 1000 } data = requests.get(url, params=params, headers=headers).json() if not data['success']: - raise RuntimeError('{message} params=({pair}, {minimum_date})'.format( + raise RuntimeError('{message} params=({pair})'.format( message=data['message'], - pair=pair, - minimum_date=minimum_date)) + pair=pair)) return data['result'] def get_order(self, order_id: str) -> Dict: diff --git a/freqtrade/exchange/interface.py b/freqtrade/exchange/interface.py index ff6637337..904123093 100644 --- a/freqtrade/exchange/interface.py +++ b/freqtrade/exchange/interface.py @@ -1,7 +1,5 @@ from abc import ABC, abstractmethod -from typing import List, Optional, Dict - -import arrow +from typing import List, Dict class Exchange(ABC): @@ -85,11 +83,10 @@ class Exchange(ABC): """ @abstractmethod - def get_ticker_history(self, pair: str, minimum_date: Optional[arrow.Arrow] = None) -> List: + def get_ticker_history(self, pair: str) -> List: """ Gets ticker history for given pair. :param pair: Pair as str, format: BTC_ETC - :param minimum_date: Minimum date (optional) :return: list, format: [ { 'O': float, (Open)