chore: move fallback param to config directly

This commit is contained in:
Matthias
2024-11-27 18:20:44 +01:00
parent 0f53dc1b7b
commit 69c1de7e4a
3 changed files with 3 additions and 5 deletions

View File

@@ -225,6 +225,7 @@ Mandatory parameters are marked as **Required**, which means that they are requi
| `exchange.skip_open_order_update` | Skips open order updates on startup should the exchange cause problems. Only relevant in live conditions.<br>*Defaults to `false`*<br> **Datatype:** Boolean | `exchange.skip_open_order_update` | Skips open order updates on startup should the exchange cause problems. Only relevant in live conditions.<br>*Defaults to `false`*<br> **Datatype:** Boolean
| `exchange.unknown_fee_rate` | Fallback value to use when calculating trading fees. This can be useful for exchanges which have fees in non-tradable currencies. The value provided here will be multiplied with the "fee cost".<br>*Defaults to `None`<br> **Datatype:** float | `exchange.unknown_fee_rate` | Fallback value to use when calculating trading fees. This can be useful for exchanges which have fees in non-tradable currencies. The value provided here will be multiplied with the "fee cost".<br>*Defaults to `None`<br> **Datatype:** float
| `exchange.log_responses` | Log relevant exchange responses. For debug mode only - use with care.<br>*Defaults to `false`*<br> **Datatype:** Boolean | `exchange.log_responses` | Log relevant exchange responses. For debug mode only - use with care.<br>*Defaults to `false`*<br> **Datatype:** Boolean
| `exchange.only_from_ccxt` | Prevent data-download from data.binance.vision. Leaving this as false can greatly speed up downloads, but may be problematic if the site is not available.<br>*Defaults to `false`*<br> **Datatype:** Boolean
| `experimental.block_bad_exchanges` | Block exchanges known to not work with freqtrade. Leave on default unless you want to test if that exchange works now. <br>*Defaults to `true`.* <br> **Datatype:** Boolean | `experimental.block_bad_exchanges` | Block exchanges known to not work with freqtrade. Leave on default unless you want to test if that exchange works now. <br>*Defaults to `true`.* <br> **Datatype:** Boolean
| | **Plugins** | | **Plugins**
| `edge.*` | Please refer to [edge configuration document](edge.md) for detailed explanation of all possible configuration options. | `edge.*` | Please refer to [edge configuration document](edge.md) for detailed explanation of all possible configuration options.

View File

@@ -110,13 +110,11 @@ class Binance(Exchange):
candle_type: CandleType, candle_type: CandleType,
is_new_pair: bool = False, is_new_pair: bool = False,
until_ms: int | None = None, until_ms: int | None = None,
only_from_ccxt: bool = False,
) -> DataFrame: ) -> DataFrame:
""" """
Overwrite to introduce "fast new pair" functionality by detecting the pair's listing date Overwrite to introduce "fast new pair" functionality by detecting the pair's listing date
Does not work for other exchanges, which don't return the earliest data when called with "0" Does not work for other exchanges, which don't return the earliest data when called with "0"
:param candle_type: Any of the enum CandleType (must match trading mode!) :param candle_type: Any of the enum CandleType (must match trading mode!)
:param only_from_ccxt: Only download data using the API provided by CCXT
""" """
if is_new_pair: if is_new_pair:
x = self.loop.run_until_complete( x = self.loop.run_until_complete(
@@ -136,7 +134,7 @@ class Binance(Exchange):
) )
return DataFrame(columns=DEFAULT_DATAFRAME_COLUMNS) return DataFrame(columns=DEFAULT_DATAFRAME_COLUMNS)
if only_from_ccxt: if self._config["exchange"].get("only_from_ccxt", False):
return super().get_historic_ohlcv( return super().get_historic_ohlcv(
pair=pair, pair=pair,
timeframe=timeframe, timeframe=timeframe,
@@ -146,6 +144,7 @@ class Binance(Exchange):
until_ms=until_ms, until_ms=until_ms,
) )
else: else:
# Download from data.binance.vision
return self.get_historic_ohlcv_fast( return self.get_historic_ohlcv_fast(
pair=pair, pair=pair,
timeframe=timeframe, timeframe=timeframe,

View File

@@ -2230,7 +2230,6 @@ class Exchange:
candle_type: CandleType, candle_type: CandleType,
is_new_pair: bool = False, is_new_pair: bool = False,
until_ms: int | None = None, until_ms: int | None = None,
only_from_ccxt: bool = False,
) -> DataFrame: ) -> DataFrame:
""" """
Get candle history using asyncio and returns the list of candles. Get candle history using asyncio and returns the list of candles.
@@ -2242,7 +2241,6 @@ class Exchange:
:param candle_type: '', mark, index, premiumIndex, or funding_rate :param candle_type: '', mark, index, premiumIndex, or funding_rate
:param is_new_pair: used by binance subclass to allow "fast" new pair downloading :param is_new_pair: used by binance subclass to allow "fast" new pair downloading
:param until_ms: Timestamp in milliseconds to get history up to :param until_ms: Timestamp in milliseconds to get history up to
:param only_from_ccxt: Only download data using the API provided by CCXT
:return: Dataframe with candle (OHLCV) data :return: Dataframe with candle (OHLCV) data
""" """
pair, _, _, data, _ = self.loop.run_until_complete( pair, _, _, data, _ = self.loop.run_until_complete(