--lookback
🦉 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 maximum candle history (in candles) handed to the feature engine for each training sample.
| Type | int (candles) |
| Default | 200 |
| Maps to | TrainerConfig.lookback |
| Read in | train.py → src/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.lookbackdefault (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--lookbackif sample generation is slow. - It must comfortably exceed
--windowand the feature engine’s longest indicator (26 candles), otherwise features come backNoneand samples are skipped.
Examples
python train.py --lookback 200 # default
python train.py --lookback 100 # faster sample generation, less contextInteractions
--window— the indicator window inside this history.--max-candles— caps the whole dataset;--lookbackcaps 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.