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.
| Type | comma-separated integers (seconds) |
| Default | 120,300,600 |
| Required | No |
| Maps to | BotConfig.expiry_options |
| Read in | main.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:
AITradingBot.__init__constructsExpirySelector(expiry_options=cfg.expiry_options), which sorts the options and initializes a per-expiry win/loss statistics table.- Before each trade,
_trade_loop()callsexpiry_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 toclient.buy()/client.sell(). - 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,600Interactions
PO_DEFAULT_EXPIRYis 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=1skips 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.