mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-14 20:01:18 +00:00
fix: improve startup_candle_count assignment
This commit is contained in:
@@ -294,10 +294,6 @@ class Exchange:
|
|||||||
# Initial markets load
|
# Initial markets load
|
||||||
self.reload_markets(True, load_leverage_tiers=False)
|
self.reload_markets(True, load_leverage_tiers=False)
|
||||||
self.validate_config(config)
|
self.validate_config(config)
|
||||||
self._startup_candle_count: int = config.get("startup_candle_count", 0)
|
|
||||||
self.required_candle_call_count = self.validate_required_startup_candles(
|
|
||||||
self._startup_candle_count, config.get("timeframe", "")
|
|
||||||
)
|
|
||||||
|
|
||||||
if self.trading_mode != TradingMode.SPOT and load_leverage_tiers:
|
if self.trading_mode != TradingMode.SPOT and load_leverage_tiers:
|
||||||
self.fill_leverage_tiers()
|
self.fill_leverage_tiers()
|
||||||
@@ -336,6 +332,12 @@ class Exchange:
|
|||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
return loop
|
return loop
|
||||||
|
|
||||||
|
def _set_startup_candle_count(self, config: Config) -> None:
|
||||||
|
self._startup_candle_count: int = config.get("startup_candle_count", 0)
|
||||||
|
self.required_candle_call_count = self.validate_required_startup_candles(
|
||||||
|
self._startup_candle_count, config.get("timeframe", "")
|
||||||
|
)
|
||||||
|
|
||||||
def validate_config(self, config: Config) -> None:
|
def validate_config(self, config: Config) -> None:
|
||||||
# Check if timeframe is available
|
# Check if timeframe is available
|
||||||
self.validate_timeframes(config.get("timeframe"))
|
self.validate_timeframes(config.get("timeframe"))
|
||||||
@@ -350,6 +352,8 @@ class Exchange:
|
|||||||
self.validate_orderflow(config["exchange"])
|
self.validate_orderflow(config["exchange"])
|
||||||
self.validate_freqai(config)
|
self.validate_freqai(config)
|
||||||
|
|
||||||
|
self._set_startup_candle_count(config)
|
||||||
|
|
||||||
def _init_ccxt(
|
def _init_ccxt(
|
||||||
self, exchange_config: dict[str, Any], sync: bool, ccxt_kwargs: dict[str, Any]
|
self, exchange_config: dict[str, Any], sync: bool, ccxt_kwargs: dict[str, Any]
|
||||||
) -> ccxt.Exchange:
|
) -> ccxt.Exchange:
|
||||||
|
|||||||
Reference in New Issue
Block a user