drop minimum_date from get_ticker_history

This commit is contained in:
gcarq 2017-11-06 00:06:59 +01:00
parent 60e651cb4c
commit 810f2f9243
4 changed files with 9 additions and 17 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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)