PO_TIMEFRAME

๐Ÿฆ‰ 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

The candle period, in seconds, for all market data the bot consumes.

Typeint (seconds)
Default60
RequiredNo
Maps toBotConfig.timeframe
Read inmain.py (build_config())

What it does

build_config() parses the value with int(env("PO_TIMEFRAME", "60")). A non-integer value (e.g. 1m or 60.5) raises ValueError and crashes at startup โ€” there is no fallback.

The value flows into src/bot.py in four places:

  1. Warmup history size โ€” start() converts the warmup candle count to seconds of history: warmup_offset = effective_warmup * cfg.timeframe, then calls client.get_candles(asset, timeframe, warmup_offset). With defaults, 60 candles ร— 60 s = 3600 s of history.
  2. Live candle subscription โ€” _candle_stream() passes timedelta(seconds=cfg.timeframe) to subscribe_symbol_time_aligned (or subscribe_symbol), so the stream delivers one completed candle per period.
  3. Dataset label horizon โ€” _load_dataset() computes label_horizon = max(1, int(cfg.default_expiry / max(cfg.timeframe, 1))), i.e. how many candles ahead the training label looks. With defaults, 300 / 60 = 5 candles. A timeframe of 0 is guarded by max(timeframe, 1) here but would still produce a zero warmup offset and a nonsensical subscription.
  4. Startup banner โ€” logged as Timeframe: %ds.

Valid values

A positive integer number of seconds that PocketOption supports as a candle period (e.g. 60, 300). The bot does not validate against a list; unsupported values fail at the API level.

Examples

export PO_TIMEFRAME=60
$env:PO_TIMEFRAME = '60'
# .env
PO_TIMEFRAME=60

Interactions

  • PO_DEFAULT_EXPIRY divided by PO_TIMEFRAME sets the dataset label horizon โ€” change one and you change how training labels are generated.
  • PO_DATASET must contain candles of this same timeframe for pre-training labels to be meaningful (the bot cannot verify this).
  • The warmup_candles count itself is a config-only field: warmup-candles.
  • Real environment variables override .env values (see index).

See also

๐Ÿ’ฌ Unsure how this interacts with the rest of the configuration? Ask in the Chipa Discord โ€” or prototype strategies no-code with ChipaEditor.