--timeframe
🦉 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 candle period of the input dataset, in seconds. This flag describes the data — it is not a preference.
| Type | int (seconds) |
| Default | 60 (M1 candles) |
| Maps to | TrainerConfig.timeframe |
| Read in | train.py → src/training/trainer.py (Trainer.run(), step 2) |
What it does
Trainer.run() uses timeframe for exactly one thing: computing the label horizon, the number of candles the labeler looks into the future:
label_horizon = max(1, int(cfg.expiry / max(cfg.timeframe, 1)))
With the defaults (--expiry 300, --timeframe 60), each sample asks “is the close higher 5 candles later?” — matching the outcome of a 5-minute binary option on M1 data. The division truncates toward zero and the result is floored at 1 candle; max(timeframe, 1) guards against a zero timeframe.
The horizon is passed to build_samples() in src/training/dataset.py, where sample i is labeled 1 if candles[i + label_horizon].close > candles[i].close, 0 if lower, and skipped if exactly flat. The last label_horizon candles produce no samples (no future to look at).
Choosing a value
- Set it to the dataset’s actual candle period:
60for M1,300for M5, etc. A wrong value silently mislabels every sample — e.g. claiming--timeframe 300for M1 data makes a 300 s expiry label only 1 candle ahead (1 minute), so the brain learns the wrong horizon. - If
--expiryis smaller than--timeframe, the horizon clamps to 1 candle — the finest resolution the data allows. Use finer-grained candles instead if you need sub-candle expiries. - It should also match the bot’s live
PO_TIMEFRAMEso the features the brain learned from resemble what it sees live.
Examples
python train.py --data EURUSD_M1.csv --timeframe 60 --expiry 300 # horizon = 5 candles
python train.py --data EURUSD_M5.csv --timeframe 300 --expiry 300 # horizon = 1 candleInteractions
--expiry— the other half of the label-horizon formula.PO_TIMEFRAME— the live counterpart; keep them consistent.
See also
💬 Unsure how this interacts with the rest of the configuration? Ask in the Chipa Discord — or prototype strategies no-code with ChipaEditor.