PO_EXPIRY_OPTIONS

πŸ¦‰ 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 set of trade expiry durations, in seconds, that the AI expiry selector may pick from for each trade.

Typecomma-separated integers (seconds)
Default120,300,600
RequiredNo
Maps toBotConfig.expiry_options
Read inmain.py (build_config())

What it does

build_config() passes the raw string (default "") through the helper _int_tuple(raw, fallback=(120, 300, 600)) in main.py:

  • The string is split on commas, each piece stripped, empty pieces skipped, and the rest converted with int().
  • If the result is empty (e.g. the variable is unset, empty, or just commas), the fallback (120, 300, 600) is used.
  • If any piece fails int() (e.g. 120,fast,600), the whole value is discarded: a warning is printed β€” Warning: could not parse '<raw>', using (120, 300, 600) β€” and the fallback is used. There is no partial parse.

The tuple is consumed in src/bot.py and src/core/expiry.py:

  1. AITradingBot.__init__ constructs ExpirySelector(expiry_options=cfg.expiry_options), which sorts the options and initializes a per-expiry win/loss statistics table.
  2. Before each trade, _trade_loop() calls expiry_selector.select(regime, features, confidence), which scores every option using the current regime, volatility, ADX, RSI, confidence, and the learned per-expiry win rates, then returns the highest-scoring expiry. That value is passed straight to client.buy() / client.sell().
  3. The startup banner logs Expiry: AI-selected from ['120s', '300s', '600s'].

Note the scoring rules in ExpirySelector.select() use fixed thresholds at 60, 120, 180, and 300 seconds (e.g. β€œtrending β†’ +3.0 if expiry β‰₯ 300”). Options far outside that band (e.g. 3600) are still scored, but only by the coarse >= 300 / >= 180 buckets plus learned performance.

Per-expiry win/loss stats are persisted alongside the brain in <brain>_expiry.pkl (see PO_BRAIN_PATH). If you change the option set, previously learned stats for expiries still in the set are kept when the state file loads.

Valid values

One or more positive integers separated by commas, each an expiry PocketOption accepts for the asset (typically 60–43200 s). Whitespace around numbers is allowed: 120, 300, 600 works.

Examples

export PO_EXPIRY_OPTIONS='120,300,600'
$env:PO_EXPIRY_OPTIONS = '60,120,300'
# .env
PO_EXPIRY_OPTIONS=120,300,600

Interactions

  • PO_DEFAULT_EXPIRY is not selected from this pool β€” it is only the dataset-labeling horizon.
  • Selection weight depends on PO_MIN_CONF-gated confidence values (confidence β‰₯ 0.75 favors longer expiries).
  • Learned stats persist via PO_BRAIN_PATH; PO_RETRAIN=1 skips loading them.

See also

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