Skip to content

Commit 9873a86

Browse files
committed
fix: improve startup_candle_count assignment
1 parent 1c8bbc1 commit 9873a86

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

freqtrade/exchange/exchange.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,6 @@ def __init__(
294294
# Initial markets load
295295
self.reload_markets(True, load_leverage_tiers=False)
296296
self.validate_config(config)
297-
self._startup_candle_count: int = config.get("startup_candle_count", 0)
298-
self.required_candle_call_count = self.validate_required_startup_candles(
299-
self._startup_candle_count, config.get("timeframe", "")
300-
)
301297

302298
if self.trading_mode != TradingMode.SPOT and load_leverage_tiers:
303299
self.fill_leverage_tiers()
@@ -336,6 +332,12 @@ def _init_async_loop(self) -> asyncio.AbstractEventLoop:
336332
asyncio.set_event_loop(loop)
337333
return loop
338334

335+
def _set_startup_candle_count(self, config: Config) -> None:
336+
self._startup_candle_count: int = config.get("startup_candle_count", 0)
337+
self.required_candle_call_count = self.validate_required_startup_candles(
338+
self._startup_candle_count, config.get("timeframe", "")
339+
)
340+
339341
def validate_config(self, config: Config) -> None:
340342
# Check if timeframe is available
341343
self.validate_timeframes(config.get("timeframe"))
@@ -350,6 +352,8 @@ def validate_config(self, config: Config) -> None:
350352
self.validate_orderflow(config["exchange"])
351353
self.validate_freqai(config)
352354

355+
self._set_startup_candle_count(config)
356+
353357
def _init_ccxt(
354358
self, exchange_config: dict[str, Any], sync: bool, ccxt_kwargs: dict[str, Any]
355359
) -> ccxt.Exchange:

0 commit comments

Comments
 (0)