--lookback

🦉 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 maximum candle history (in candles) handed to the feature engine for each training sample.

Typeint (candles)
Default200
Maps toTrainerConfig.lookback
Read intrain.pysrc/training/trainer.py (Trainer.run()) → src/training/dataset.py (_build_range())

What it does

In _build_range() (src/training/dataset.py), the feature vector for candle i is computed from the slice:

chunk = candles[max(0, i - lookback):i + 1]

so each sample sees at most lookback + 1 candles of history. In the parallel path of build_samples(), each worker’s candle slice is also extended backwards by lookback candles so chunk boundaries don’t truncate anyone’s history.

Choosing a value

  • The default 200 matches the bot’s live BotConfig.lookback default (reference); keep them equal so live feature vectors see the same amount of history as training did.
  • Larger lookbacks slow sample generation roughly linearly (each feature_engine.compute() call processes more candles) — the training guide’s troubleshooting suggests reducing --lookback if sample generation is slow.
  • It must comfortably exceed --window and the feature engine’s longest indicator (26 candles), otherwise features come back None and samples are skipped.

Examples

python train.py --lookback 200        # default
python train.py --lookback 100       # faster sample generation, less context

Interactions

  • --window — the indicator window inside this history.
  • --max-candles — caps the whole dataset; --lookback caps per-sample history.
  • BotConfig.lookback (reference) — the live counterpart.

See also

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