--expiry

🦉 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

The trade duration (in seconds) each training sample is labeled for. Train for the expiry you actually intend to trade.

Typeint (seconds)
Default300 (5 minutes)
Maps toTrainerConfig.expiry
Read intrain.pysrc/training/trainer.py (Trainer.run(), step 2)

What it does

Together with --timeframe, expiry determines the label horizon in Trainer.run():

label_horizon = max(1, int(cfg.expiry / max(cfg.timeframe, 1)))

The trainer logs it explicitly: Generating samples (label horizon = 5 candles = 300s) …. In build_samples() (src/training/dataset.py), each candle position i becomes a sample labeled 1 (CALL wins) if candles[i + label_horizon].close is above candles[i].close, 0 (PUT wins) if below, and is skipped entirely if the close is unchanged (draws are not trained on). This mirrors exactly how a binary option of that duration would settle.

Choosing a value

  • Match your live trading expiry — e.g. PO_DEFAULT_EXPIRY=120 means you should train with --expiry 120. A brain labeled for 5-minute outcomes is not optimal for 1-minute trades; price behavior at different horizons differs.
  • Values below --timeframe clamp to a 1-candle horizon; use finer candles for shorter expiries.
  • Non-multiples of the timeframe truncate: --expiry 90 --timeframe 60 gives a 1-candle (60 s) horizon, not 90 s.
  • Larger expiries consume more data per sample: the final label_horizon candles yield no samples, and adjacent samples’ labels overlap more, which makes the effective information per sample lower.

Risk note: the labeled expiry directly shapes what the brain trades live. A mismatch between the trained expiry and the live one degrades the edge; binary options trading can lose money and past performance doesn’t guarantee future results.

Examples

python train.py --expiry 120                      # label for 2-minute trades
python train.py --data EURUSD_M1.csv --expiry 60  # 1-minute trades on M1 (horizon = 1)

Interactions

See also

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