diff --git a/docs/data-download.md b/docs/data-download.md index 4339e9862..5ae1fe560 100644 --- a/docs/data-download.md +++ b/docs/data-download.md @@ -268,6 +268,7 @@ If `--convert` is also provided, the resample step will happen automatically and !!! Note "Kraken user" Kraken users should read [this](exchanges.md#historic-kraken-data) before starting to download data. + Kraken Futures uses standard OHLCV downloads and does not require `--dl-trades`. Example call: diff --git a/docs/exchanges.md b/docs/exchanges.md index 547814bfe..a6eb4c31d 100644 --- a/docs/exchanges.md +++ b/docs/exchanges.md @@ -217,6 +217,44 @@ freqtrade download-data --exchange kraken --dl-trades -p BTC/EUR BCH/EUR Please pay attention that rateLimit configuration entry holds delay in milliseconds between requests, NOT requests/sec rate. So, in order to mitigate Kraken API "Rate limit exceeded" exception, this configuration should be increased, NOT decreased. +## Kraken Futures + +Kraken Futures uses the exchange id `krakenfutures` and supports isolated futures mode. + +```jsonc +"exchange": { + "name": "krakenfutures", + "key": "your_exchange_key", + "secret": "your_exchange_secret", + "ccxt_config": {"enableRateLimit": true}, + "ccxt_async_config": {"enableRateLimit": true}, + "triggerSignal": "mark" // "mark" (default), "last", or "index" +}, +"trading_mode": "futures", +"margin_mode": "isolated", +"stake_currency": "USD" +``` + +!!! Tip "Stoploss on Exchange" + Kraken Futures supports `stoploss_on_exchange` with both `limit` and `market` stop orders. + Use `exchange.triggerSignal` to select the trigger price source (`mark`, `last`, or `index`). + +!!! Note "Collateral" + Kraken Futures is USD-settled. Kraken allows EUR collateral, but USD is the recommended stake currency. + +!!! Note "Pair format" + Futures pairs use CCXT symbols, for example `BTC/USD:USD`. + +### Data download + +Kraken Futures uses normal OHLCV downloads. + +```bash +freqtrade download-data --exchange krakenfutures --trading-mode futures --pairs BTC/USD:USD --timeframes 1m 5m +``` + +Note: OHLCV requests are capped at 2000 candles per call, so large downloads may take longer. + ## Kucoin Kucoin requires a passphrase for each api key, you will therefore need to add this key into the configuration so your exchange section looks as follows: diff --git a/freqtrade/exchange/exchange_utils.py b/freqtrade/exchange/exchange_utils.py index 9d13c067d..402fbbb32 100644 --- a/freqtrade/exchange/exchange_utils.py +++ b/freqtrade/exchange/exchange_utils.py @@ -54,21 +54,13 @@ def available_exchanges(ccxt_module: CcxtModuleType | None = None) -> list[str]: return [x for x in exchanges if validate_exchange(x)[0]] -def _exchange_has_helper( - ex_has_or_exchange: dict[str, Any] | ccxt.Exchange, - required: dict[str, list[str]], -) -> list[str]: +def _exchange_has_helper(ex_has: dict[str, Any], required: dict[str, list[str]]) -> list[str]: """ Checks availability of methods (or their replacement)s in a merged has-dict. :param ex_has: merged "has" dict (ccxt + freqtrade overrides) :param required: dict of required methods, with possible replacement methods as list :return: list of missing required methods """ - if isinstance(ex_has_or_exchange, dict): - ex_has = ex_has_or_exchange - else: - ex_has = getattr(ex_has_or_exchange, "has", {}) or {} - return [ k for k, v in required.items()