From 42453333bef8f600c29007e69bd5be508953a9a8 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 27 May 2021 07:38:47 +0200 Subject: [PATCH] Align coinbase download with ccxt limits Align with https://github.com/ccxt/ccxt/issues/9268 --- freqtrade/exchange/__init__.py | 1 + freqtrade/exchange/bybit.py | 1 - freqtrade/exchange/coinbasepro.py | 23 +++++++++++++++++++++++ freqtrade/exchange/hitbtc.py | 1 - requirements.txt | 2 +- 5 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 freqtrade/exchange/coinbasepro.py diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index 23ba2eb10..015e0c869 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -7,6 +7,7 @@ from freqtrade.exchange.bibox import Bibox from freqtrade.exchange.binance import Binance from freqtrade.exchange.bittrex import Bittrex from freqtrade.exchange.bybit import Bybit +from freqtrade.exchange.coinbasepro import Coinbasepro from freqtrade.exchange.exchange import (available_exchanges, ccxt_exchanges, is_exchange_known_ccxt, is_exchange_officially_supported, market_is_active, timeframe_to_minutes, timeframe_to_msecs, diff --git a/freqtrade/exchange/bybit.py b/freqtrade/exchange/bybit.py index 4a44bb42d..163f8c44e 100644 --- a/freqtrade/exchange/bybit.py +++ b/freqtrade/exchange/bybit.py @@ -18,7 +18,6 @@ class Bybit(Exchange): may still not work as expected. """ - # fetchCurrencies API point requires authentication for Bybit, _ft_has: Dict = { "ohlcv_candle_limit": 200, } diff --git a/freqtrade/exchange/coinbasepro.py b/freqtrade/exchange/coinbasepro.py new file mode 100644 index 000000000..7dd9c80dc --- /dev/null +++ b/freqtrade/exchange/coinbasepro.py @@ -0,0 +1,23 @@ +""" CoinbasePro exchange subclass """ +import logging +from typing import Dict + +from freqtrade.exchange import Exchange + + +logger = logging.getLogger(__name__) + + +class Coinbasepro(Exchange): + """ + CoinbasePro exchange class. Contains adjustments needed for Freqtrade to work + with this exchange. + + Please note that this exchange is not included in the list of exchanges + officially supported by the Freqtrade development team. So some features + may still not work as expected. + """ + + _ft_has: Dict = { + "ohlcv_candle_limit": 300, + } diff --git a/freqtrade/exchange/hitbtc.py b/freqtrade/exchange/hitbtc.py index 763535263..a48c9a198 100644 --- a/freqtrade/exchange/hitbtc.py +++ b/freqtrade/exchange/hitbtc.py @@ -17,7 +17,6 @@ class Hitbtc(Exchange): may still not work as expected. """ - # fetchCurrencies API point requires authentication for Hitbtc, _ft_has: Dict = { "ohlcv_candle_limit": 1000, "ohlcv_params": {"sort": "DESC"} diff --git a/requirements.txt b/requirements.txt index df611aedf..512b2a588 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ numpy==1.20.3 pandas==1.2.4 -ccxt==1.50.30 +ccxt==1.50.48 # Pin cryptography for now due to rust build errors with piwheels cryptography==3.4.7 aiohttp==3.7.4.post0