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.
| Type | int (seconds) |
| Default | 300 |
| Required | No |
| Maps to | BotConfig.default_expiry |
| Read in | main.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=300Interactions
- Divided by
PO_TIMEFRAMEto compute the label horizon. - Only matters when
PO_DATASETpre-training actually runs โ i.e. no brain was loaded (PO_BRAIN_PATH) orPO_RETRAIN=1forced a retrain. - Live expiry per trade comes from
PO_EXPIRY_OPTIONSvia the expiry selector.
See also
๐ฌ Unsure how this interacts with the rest of the configuration? Ask in the Chipa Discord โ or prototype strategies no-code with ChipaEditor.