--max-candles
🦉 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
Use at most the N most recent candles from the dataset. Bounds memory use and training time on large histories.
| Type | int (candles) |
| Default | 500000 |
| Maps to | TrainerConfig.max_candles |
| Read in | train.py → src/training/trainer.py (Trainer.run(), step 1) |
What it does
After load_candles() parses the CSV, Trainer.run() trims from the front — keeping the end of the file, i.e. the most recent data (files are assumed chronological):
if len(candles) > cfg.max_candles:
log.info("Using most recent %d of %d candles.", cfg.max_candles, len(candles))
candles = candles[-cfg.max_candles:]
If the file has fewer candles than the cap, the flag has no effect. The trim happens before sample generation, so it also bounds how many samples exist and therefore how large the walk-forward holdout is.
Choosing a value
- The 500,000 default is roughly 16 months of M1 data — enough for a solid brain while keeping sample generation tractable.
- Lower it (e.g.
100000) for fast iteration while experimenting; the training guide’s recipe pairs it with--no-nn. - Recency vs volume trade-off: a smaller cap trains only on recent market behavior (adapts to regime shifts, fewer samples); a larger cap gives more samples but includes older regimes.
- Don’t go so low that you fall under the hard minimums: 50 candles to run at all, 200 valid samples after feature generation, and 100 holdout samples for the walk-forward test to run (see
--test-split).
Examples
python train.py --max-candles 100000 --no-nn # fast experiment loop
python train.py --max-candles 1000000 # use up to ~3 years of M1Interactions
--data— the file being trimmed; must be in chronological order for “most recent” to mean what you expect.--test-split— the holdout is a fraction of the samples that survive this trim.
See also
💬 Unsure how this interacts with the rest of the configuration? Ask in the Chipa Discord — or prototype strategies no-code with ChipaEditor.