Troubleshooting

🦉 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

Problems grouped by lifecycle stage. Each row quotes the real log/error text from the code.

Startup and installation

SymptomCauseFix
ERROR: PO_SSID is not set. (exit code 1)No session ID in the environment or .envexport PO_SSID='...' (bash) / $env:PO_SSID='...' (PowerShell), or copy .env.example to .env and fill it in. Run from the repo root — only ./.env is read. See PO_SSID.
ERROR: BinaryOptionsToolsV2 not installed. then immediate exitThe broker client isn’t on PyPI; importing src/bot.py hard-exits without itInstall the wheel for your platform from https://gitlab.chipatrade.com/chipadevorg/BinaryOptionsTools-v2/-/releases. See Installation. Note train.py doesn’t need it.
WARNING: scikit-learn not found. Install with: pip install scikit-learnsklearn missing — the ensemble falls back to a non-learning stub, so the bot “runs” but never really learnspip install scikit-learn (or pip install -r requirements.txt). Treat as mandatory.
Warning: could not parse '...', using (120, 300, 600)Malformed PO_EXPIRY_OPTIONSUse comma-separated integers in seconds, e.g. 120,300,600.
Hangs at Connecting to PocketOption … or balance is wrongExpired/invalid SSIDLog in to PocketOption again and refresh PO_SSID. Session IDs expire.

Brain and model state

SymptomCauseFix
Failed to load brain: ... at startupCorrupt/incompatible brain pickle (e.g. saved with a different sklearn version)The bot automatically falls back to journal reload + dataset pre-training. To rebuild deliberately: retrain with python train.py, or start once with PO_RETRAIN=1.
Feature dimension changed (N → M) — resetting.The feature engine’s vector size changed (code update, changed experimental features) while old state expected N featuresExpected after feature changes: the ensemble resets itself and relearns. For a clean slate, retrain the brain; note journal reload also skips old trades whose feature dimension doesn’t match (Persistence).
🔄 Force retrain requested — ignoring saved brain. on every startPO_RETRAIN=1 left set — it deletes the brain each startupUnset PO_RETRAIN (or set 0) once the retrain is done.
No trained models to save.Saving was attempted before anything was fittedHarmless; train first (dataset or train.py).
MLP silently contributes nothing on the trading machinePyTorch not installed there — the MLP degrades to a neutral 0.5 voteInstall torch on the trading machine, or accept sklearn-only predictions. See GPU training.

Training and datasets

SymptomCauseFix
Dataset too small (N candles). (trainer aborts) / Dataset too small (N candles), skipping pre-training. (bot)Fewer than 50 candles parsed — wrong path or unrecognized format; bad rows are skipped silentlyCheck the file path, then compare the file against the data format spec. The log’s Parsed N candles from file. versus your row count reveals silent skipping.
Only N valid samples — need at least 200. (trainer) / Only N valid samples from dataset, skipping. (bot, <20)Data parsed but too short after the ≥26-candle feature warm-up and label horizon; flat closes are also skippedUse a longer history — tens of thousands of candles minimum.
Holdout too small (N) — skipping walk-forward test.Fewer than 100 test samplesMore data or a larger --test-split.
Walk-forward WR below breakevenNo edge found on this dataDon’t deploy that brain. More history, different --expiry, or different asset. See Training.
PyTorch not installed — skipping neural modelInformationalpip install torch, or pass --no-nn intentionally.
--check-gpu reports CPU despite an NVIDIA GPUCPU-only torch wheel installedReinstall from the CUDA index: pip install torch --index-url https://download.pytorch.org/whl/cu128.
CUDA out of memory during MLP trainingBatch/model too large for VRAMLower --batch-size (e.g. 512) or shrink --hidden.
Not enough data for batch models (N)Fewer than 100 buffered samples when GBM/RF training was attemptedProvide more data; the online models still work meanwhile.

No trades happening

First: a bot that mostly logs ⏸ Low confidence is working correctly — it trades only when the model has an edge. Walk the diagnostic (printed at most every 30 s) through this table; the full explanations are in Live trading.

reasonWhyWhat unblocks it
Warming up (N/60 candles)Candle buffer below max(warmup_candles, 60)Time — one candle per timeframe interval; check the stream subscribed (📡 Using subscribe_symbol_time_aligned …)
Max trades open (1/1)A pending tradeIts resolution (expiry + ~2 s)
Wait between trades (Ns left)60 s pacing floorTime, or lower min_wait_between_trades in src/config.py
Daily loss limit reachedDaily P&L hit −PO_MAX_DAILY_LOSSUTC-midnight reset (or, reluctantly, a restart — the counter is in-memory)
Cooldown (Ns left)3 consecutive losses → 300 s pauseTime
Outside trading hours (HH UTC)UTC hour not whitelisted in trading_hours (default excludes 05–15 and 18 UTC)Wait, or edit trading_hours in src/config.py
Adaptive cooldown (Ns)Last-10 win rate < 40%Time / better results
Feature compute returned NoneNot enough candles for indicatorsFills with the buffer; persistent → check candle stream health
Volatile regime — skippingskip_volatile_regime=True (not default)Calmer market or disable the flag
Low confidence: X% (need 63.0%) …Prediction below PO_MIN_CONFNormal. Persistent for days → consider retraining, or cautiously lower PO_MIN_CONF
Overconfident: X% (cap=85.0%) — likely overfit noiseAbove PO_MAX_CONFUsually right to reject; frequent occurrences suggest overfit batch models — retrain
Low range candle (…) — skipDoji/indecision candle (range < 0.00005)Market movement
Indicators misaligned (conf=X%)<2 of 3 indicators agreeSet PO_REQUIRE_ALIGNMENT=0 to disable (more, lower-quality trades)
Signal confirmation (n/N) …Waiting for consecutive agreeing candlesOnly if signal_confirmations > 1
5-min trend DOWN vs CALL — skip / UP vs PUTHigher-timeframe trend disagreesMarket alignment
🧠 Adaptive skip: <reason>Adaptive layer blocked regime/hour/direction or raised the thresholdSelf-clears as its stats evolve; full reset = delete learned state (Persistence)

Also check the candle stream: Candle stream error: ... stops the whole bot (_running = False) — restart it and check connectivity/SSID.

Trade results

SymptomCauseFix
A trade stays pending long after expirycheck_win returns something unparseable; the checker first tries win/loss/draw (dict result/status keys or plain string), then substring-matches win / loss/lose / draw in the raw response, else retries every 3 sUsually resolves on a later poll. Enable debug logging to see check_win(id) raw=… parsed=….
Abandoning stale trade <id> after timeout: ...check_win kept erroring until the trade was older than expiry × 5The trade is dropped unresolved — not journaled as win/loss and not learned from. Occasional occurrences are tolerable; frequent ones point at connection/SSID problems or a broker API change.
Logged profit doesn’t match your accountThe bot books results at a hardcoded 0.85 payoutCosmetic/accounting only; the broker’s actual payout applies to your balance.

Risk note

If the bot stops trading because of the daily loss limit or cooldowns, that is the risk management working as designed — bypassing it by restarting or loosening limits increases the money you can lose. See Risk management.

See also

💬 Questions about running AthenaAI? Ask in the #trading-bots channel on the Chipa Discord — and if you’d rather design strategies without touching Python, try ChipaEditor.