Troubleshooting
🦉 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
Problems grouped by lifecycle stage. Each row quotes the real log/error text from the code.
Startup and installation
| Symptom | Cause | Fix |
|---|---|---|
ERROR: PO_SSID is not set. (exit code 1) | No session ID in the environment or .env | export 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 exit | The broker client isn’t on PyPI; importing src/bot.py hard-exits without it | Install 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-learn | sklearn missing — the ensemble falls back to a non-learning stub, so the bot “runs” but never really learns | pip install scikit-learn (or pip install -r requirements.txt). Treat as mandatory. |
Warning: could not parse '...', using (120, 300, 600) | Malformed PO_EXPIRY_OPTIONS | Use comma-separated integers in seconds, e.g. 120,300,600. |
Hangs at Connecting to PocketOption … or balance is wrong | Expired/invalid SSID | Log in to PocketOption again and refresh PO_SSID. Session IDs expire. |
Brain and model state
| Symptom | Cause | Fix |
|---|---|---|
Failed to load brain: ... at startup | Corrupt/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 features | Expected 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 start | PO_RETRAIN=1 left set — it deletes the brain each startup | Unset PO_RETRAIN (or set 0) once the retrain is done. |
No trained models to save. | Saving was attempted before anything was fitted | Harmless; train first (dataset or train.py). |
| MLP silently contributes nothing on the trading machine | PyTorch not installed there — the MLP degrades to a neutral 0.5 vote | Install torch on the trading machine, or accept sklearn-only predictions. See GPU training. |
Training and datasets
| Symptom | Cause | Fix |
|---|---|---|
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 silently | Check 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 skipped | Use a longer history — tens of thousands of candles minimum. |
Holdout too small (N) — skipping walk-forward test. | Fewer than 100 test samples | More data or a larger --test-split. |
| Walk-forward WR below breakeven | No edge found on this data | Don’t deploy that brain. More history, different --expiry, or different asset. See Training. |
PyTorch not installed — skipping neural model | Informational | pip install torch, or pass --no-nn intentionally. |
--check-gpu reports CPU despite an NVIDIA GPU | CPU-only torch wheel installed | Reinstall from the CUDA index: pip install torch --index-url https://download.pytorch.org/whl/cu128. |
| CUDA out of memory during MLP training | Batch/model too large for VRAM | Lower --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 attempted | Provide 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.
⏸ reason | Why | What 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 trade | Its resolution (expiry + ~2 s) |
Wait between trades (Ns left) | 60 s pacing floor | Time, or lower min_wait_between_trades in src/config.py |
Daily loss limit reached | Daily P&L hit −PO_MAX_DAILY_LOSS | UTC-midnight reset (or, reluctantly, a restart — the counter is in-memory) |
Cooldown (Ns left) | 3 consecutive losses → 300 s pause | Time |
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 None | Not enough candles for indicators | Fills with the buffer; persistent → check candle stream health |
Volatile regime — skipping | skip_volatile_regime=True (not default) | Calmer market or disable the flag |
Low confidence: X% (need 63.0%) … | Prediction below PO_MIN_CONF | Normal. Persistent for days → consider retraining, or cautiously lower PO_MIN_CONF |
Overconfident: X% (cap=85.0%) — likely overfit noise | Above PO_MAX_CONF | Usually right to reject; frequent occurrences suggest overfit batch models — retrain |
Low range candle (…) — skip | Doji/indecision candle (range < 0.00005) | Market movement |
Indicators misaligned (conf=X%) | <2 of 3 indicators agree | Set PO_REQUIRE_ALIGNMENT=0 to disable (more, lower-quality trades) |
Signal confirmation (n/N) … | Waiting for consecutive agreeing candles | Only if signal_confirmations > 1 |
5-min trend DOWN vs CALL — skip / UP vs PUT | Higher-timeframe trend disagrees | Market alignment |
🧠 Adaptive skip: <reason> | Adaptive layer blocked regime/hour/direction or raised the threshold | Self-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
| Symptom | Cause | Fix |
|---|---|---|
| A trade stays pending long after expiry | check_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 s | Usually 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 × 5 | The 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 account | The bot books results at a hardcoded 0.85 payout | Cosmetic/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.