warmup_candles
🦉 AthenaAI is an AI-powered ensemble machine-learning trading bot for PocketOption, built on BinaryOptionsToolsV2 → Get it on GitLab
💬 Need help? Join the Chipa Discord · ⚡ Go no-code with ChipaEditor
How many candles of history the bot fetches at startup, and how many candles must be in the buffer before the trade loop will consider trading.
This field has no environment variable — to change it, edit the default in src/config.py or construct BotConfig yourself.
| Type | int |
| Default | 60 |
| Field | BotConfig.warmup_candles |
| Consumed in | src/bot.py (AITradingBot.start, AITradingBot._trade_loop) |
| Enforced floor | 60 (feature engine needs at least 50 candles for SMA50) |
What it does
Two places in src/bot.py use this field:
-
Startup history fetch (
start()): the bot requests historical candles from PocketOption before entering the main loop. The API’sget_candles(asset, period, offset)takes an offset in seconds of history, so the bot computeswarmup_offset = effective_warmup * timeframe(e.g. 60 candles × 60 s = 3600 s). Before that, a floor is enforced:effective_warmup = max(self.cfg.warmup_candles, 60)If you set
warmup_candlesbelow 60, the bot logs a warning and uses 60 anyway, because feature computation needs at least 50 candles (SMA50):⚠warmup_candles=30 too low (features need ≥50), using 60 -
Trade-loop gate (
_trade_loop()): trading is blocked until the live candle buffer holds at leastmax(warmup_candles, 60)candles:if len(self.candles) < max(self.cfg.warmup_candles, 60): reason = f"Warming up ({len(self.candles)}/{max(self.cfg.warmup_candles, 60)} candles)"
Because the startup fetch normally fills the buffer immediately, the gate is mostly relevant when the historical fetch returns fewer candles than requested.
Valid values
Any int; effective minimum is 60. Values above lookback (default 200) are pointless as the gate can never require more candles than the deque holds — keep warmup_candles <= lookback.
Examples
# src/config.py
warmup_candles: int = 120 # wait for 120 closed candles (2 h on 60s timeframe)from src.config import BotConfig
cfg = BotConfig(ssid="...", warmup_candles=120)Interactions
PO_TIMEFRAMEconverts the candle count into seconds of history requested at startup.lookbackcaps the candle buffer size;warmup_candlesmust be at or below it.feature_window— features additionally require ~50 candles regardless of this setting, which is why the 60-candle floor exists.
See also
💬 Unsure how this interacts with the rest of the configuration? Ask in the Chipa Discord — or prototype strategies no-code with ChipaEditor.