--window

🦉 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 rolling window size, in candles, that the feature engine uses to compute indicator features for each training sample.

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

What it does

Trainer.run() passes feature_window as the window argument of build_samples(). For every candle position, _build_range() calls feature_engine.compute(chunk, window) (src/core/feature_engine.py) with that window; positions where the engine returns None (not enough history) are skipped, and any NaN/inf features are zeroed with np.nan_to_num.

The window also sets where sample generation starts: start = max(window, 26). With the default of 20 the floor of 26 wins (the feature engine’s longest fixed indicator lookback), so the first 26 candles never produce samples; a window above 26 pushes the start further out.

Choosing a value

  • The default 20 matches the bot’s live BotConfig.feature_window default — keep them identical, otherwise the live feature vectors are computed with a different window than the brain was trained on. See feature-window.
  • Larger windows produce smoother, slower-reacting indicator features and slightly fewer samples (later start); smaller windows are noisier.
  • Values below 26 make no difference to the sample start (the 26-candle floor applies) but still change the indicator window itself.

Examples

python train.py --window 20            # default, matches live config
python train.py --window 50            # slower, smoother features

Interactions

  • --lookback — caps the total candle history handed to the feature engine per sample; the window operates inside that history.
  • BotConfig.feature_window (reference) — the live value; must match for consistent features.

See also

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