Merge pull request #391 from jblestang/support_multiple_ticker

Support multiple tickers
This commit is contained in:
Gérald LONLAS
2018-01-20 11:02:42 -08:00
committed by GitHub
16 changed files with 165 additions and 87 deletions

View File

@@ -139,7 +139,7 @@ def get_ticker(pair: str, refresh: Optional[bool] = True) -> dict:
@cached(TTLCache(maxsize=100, ttl=30))
def get_ticker_history(pair: str, tick_interval: Optional[int] = 5) -> List[Dict]:
def get_ticker_history(pair: str, tick_interval) -> List[Dict]:
return _API.get_ticker_history(pair, tick_interval)

View File

@@ -142,6 +142,12 @@ class Bittrex(Exchange):
interval = 'oneMin'
elif tick_interval == 5:
interval = 'fiveMin'
elif tick_interval == 30:
interval = 'thirtyMin'
elif tick_interval == 60:
interval = 'hour'
elif tick_interval == 1440:
interval = 'Day'
else:
raise ValueError('Cannot parse tick_interval: {}'.format(tick_interval))