feature_window

๐Ÿฆ‰ 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 rolling window size, in candles, that the feature engine uses for its windowed statistics when building the feature vector for each prediction and training sample.

This field has no environment variable โ€” to change it, edit the default in src/config.py or construct BotConfig yourself.

Typeint
Default20
FieldBotConfig.feature_window
Consumed insrc/bot.py (AITradingBot._trade_loop, AITradingBot._load_dataset)

What it does

feature_window is passed as the window argument to FeatureEngine.compute(candles, window) in two places in src/bot.py:

  1. Live trading โ€” every trade-loop iteration:

    features = self.features_engine.compute(candle_list, self.cfg.feature_window)

    If compute returns None (insufficient history), the loop skips the cycle with the diagnostic โธ Feature compute returned None.

  2. Dataset pre-training (_load_dataset) โ€” the same window is used when generating training samples from CSV history, so training features match live features. The sample loop also starts at index max(window, 26) to guarantee enough history for the window and for MACD (26-period EMA).

Inside the feature engine the window drives the rolling statistics (e.g. windowed returns, volatility, ranges); other indicators such as SMA50 use their own fixed periods regardless of this value โ€” which is why at least ~50 candles are always required (see warmup_candles).

Valid values

Any positive integer well below lookback. The default 20 corresponds to 20 minutes of context on the default 60-second timeframe. Larger windows smooth features (slower to react); smaller windows make features more reactive but noisier.

Important: changing feature_window changes the meaning (not the count) of features. Models trained with one window and reloaded from a saved brain or journal will be fed differently-scaled features โ€” retrain (delete the brain file or set PO_RETRAIN=1) after changing it.

Examples

# src/config.py
feature_window: int = 30                # smoother rolling stats
from src.config import BotConfig
cfg = BotConfig(ssid="...", feature_window=30)

Interactions

  • lookback bounds the total history available to the window.
  • warmup_candles โ€” the enforced 60-candle floor already covers any reasonable window.
  • PO_RETRAIN โ€” force retraining after changing this value.

See also

๐Ÿ’ฌ Unsure how this interacts with the rest of the configuration? Ask in the Chipa Discord โ€” or prototype strategies no-code with ChipaEditor.