PO_DEFAULT_EXPIRY

๐Ÿฆ‰ 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 nominal trade duration, in seconds, used to label historical candles during dataset pre-training. Despite its name, it is not used as a live-trade expiry โ€” live expiries are always chosen from PO_EXPIRY_OPTIONS.

Typeint (seconds)
Default300
RequiredNo
Maps toBotConfig.default_expiry
Read inmain.py (build_config())

What it does

build_config() parses it with int(env("PO_DEFAULT_EXPIRY", "300")) โ€” a non-integer value raises ValueError and crashes at startup.

Its only consumer is AITradingBot._load_dataset() in src/bot.py, which runs when no saved brain is loaded and PO_DATASET points at a CSV:

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

For each training sample at candle i, the label compares candles[i + label_horizon].close with candles[i].close: higher โ†’ label 1 (a CALL would have won), lower โ†’ label 0 (a PUT would have won), equal โ†’ the sample is skipped. With the defaults (300 s expiry, 60 s candles) the horizon is 5 candles, i.e. the models are trained to predict price direction 5 minutes ahead.

Effectively, PO_DEFAULT_EXPIRY answers: โ€œhow far into the future should the pre-trained models learn to predict?โ€ Setting it close to the expiries you actually trade (from PO_EXPIRY_OPTIONS) keeps training labels consistent with live outcomes. The src/config.py comment notes 300 s was chosen because it had the best historical win rate.

If the brain loads from disk (or the dataset is missing/too small), this variable has no effect for that run.

Valid values

A positive integer number of seconds, normally a multiple of PO_TIMEFRAME. Values smaller than one timeframe are clamped to a 1-candle horizon by max(1, โ€ฆ).

Examples

export PO_DEFAULT_EXPIRY=300
$env:PO_DEFAULT_EXPIRY = '300'
# .env
PO_DEFAULT_EXPIRY=300

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.