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.
| Type | int |
| Default | 20 |
| Field | BotConfig.feature_window |
| Consumed in | src/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:
-
Live trading โ every trade-loop iteration:
features = self.features_engine.compute(candle_list, self.cfg.feature_window)If
computereturnsNone(insufficient history), the loop skips the cycle with the diagnosticโธ Feature compute returned None. -
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 indexmax(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 statsfrom src.config import BotConfig
cfg = BotConfig(ssid="...", feature_window=30)Interactions
lookbackbounds 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.