poll_interval

🦉 AthenaAI is an AI-powered ensemble machine-learning trading bot for PocketOption, built on BinaryOptionsToolsV2Get it on GitLab
💬 Need help? Join the Chipa Discord · ⚡ Go no-code with ChipaEditor

How often, in seconds, the main trade loop wakes up to re-evaluate all gates and (potentially) place a trade.

This field has no environment variable — to change it, edit the default in src/config.py or construct BotConfig yourself.

Typefloat (seconds)
Default2.0
FieldBotConfig.poll_interval
Consumed insrc/bot.py (AITradingBot._trade_loop)

What it does

The core decision loop in src/bot.py starts every iteration with:

await asyncio.sleep(self.cfg.poll_interval)

Each iteration then runs the full gate pipeline: warmup, concurrency, wait-between-trades, daily loss, cooldown, trading hours, feature extraction, regime detection, prediction, confidence gates, indicator alignment, signal confirmation, adaptive gate, stake sizing, and finally trade execution.

Notes on what poll_interval does and does not affect:

  • Candles are not polled. Candle data arrives via a streaming subscription (_candle_stream); poll_interval only sets how often decisions are made on that data.
  • Polling faster than the candle timeframe does not create more signals: signal confirmation counts one vote per unique candle timestamp (see signal_confirmations), so repeated polls within the same candle short-circuit.
  • Diagnostic “why not trading” log lines are additionally rate-limited to one every 30 seconds regardless of this value.
  • The result checker (_result_checker) polls trade outcomes on its own fixed 3-second sleep, unaffected by this field.
  • Smaller values mean more frequent feature/regime computation over the whole candle buffer — a modest CPU cost.

Valid values

Any positive float (seconds). The default 2.0 reacts within about 2 s of a candle close. Values above the timeframe (60 s default) risk skipping candles entirely; values well below ~1 s only burn CPU without producing more trades.

Examples

# src/config.py
poll_interval: float = 5.0              # evaluate every 5 seconds
from src.config import BotConfig
cfg = BotConfig(ssid="...", poll_interval=5.0)

Interactions

  • PO_TIMEFRAME — the candle period is the real cadence of new information.
  • signal_confirmations — per-candle voting makes faster polling redundant for signal generation.

See also

💬 Unsure how this interacts with the rest of the configuration? Ask in the Chipa Discord — or prototype strategies no-code with ChipaEditor.