Quickstart
π¦ 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
This guide takes you from an installed AthenaAI to a running bot in five steps.
1. Get your PocketOption session ID (SSID)
The bot authenticates with your PocketOption session ID, read from the PO_SSID environment variable. To obtain it, log in to PocketOption in your browser and extract the session ID from the siteβs websocket authentication (browser DevTools β Network β WS frames; the session string is what BinaryOptionsToolsV2 expects as ssid).
Never put the SSID in source code β the bot only reads it from the environment or .env. If it is missing, main.py exits with:
ERROR: PO_SSID is not set.
Provide your PocketOption session ID via the environment:
export PO_SSID='your-session-id' # Linux/macOS
$env:PO_SSID='your-session-id' # PowerShell
or copy .env.example to .env and fill it in.2. Create your .env
Copy the template and fill in your values:
cp .env.example .env # Linux/macOSCopy-Item .env.example .env # Windows PowerShell
The template covers the required SSID plus the most common trading, money-management, and persistence settings:
PO_SSID=your_session_id_here
PO_ASSET=EURUSD
PO_TIMEFRAME=60
PO_EXPIRY_OPTIONS=120,300,600
PO_DEFAULT_EXPIRY=300
PO_BASE_STAKE=25
PO_MAX_STAKE=100
PO_MAX_DAILY_LOSS=300
PO_MIN_CONF=0.63
PO_MAX_CONF=0.85
PO_REQUIRE_ALIGNMENT=1
PO_DATASET=EURUSD_M1.csv
PO_BRAIN_PATH=athena_brain.pkl
main.py loads .env with os.environ.setdefault, so a variable already set in your real environment wins over the .env value. Details in Configuration; each variable has its own page under the environment reference.
3. (Optional but recommended) Train a brain first
Train offline from historical data β no PocketOption connection needed:
python train.py
Defaults train on EURUSD_M1.csv and save to athena_brain.pkl, which matches the .env above, so the bot loads it at startup and skips in-process pre-training. A successful run ends with a walk-forward report and:
β
Training complete β brain saved to athena_brain.pkl
See the full Training guide. If you skip this step, the bot pre-trains itself from PO_DATASET at startup instead (slower, done in-process).
4. Run the bot
python main.pyWhat you should see
The startup banner (real log lines from src/bot.py):
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π¦ AthenaAI TRADING BOT v6.0 β PocketOption
Asset: EURUSD | Timeframe: 60s
Expiry: AI-selected from ['120s', '300s', '600s']
Models: SGD + PA + NB + GBM(0.75Γ) + RF(0.75Γ)
Confidence: 63%β85% | Hours: 0,1,2,3,4,16,17,19,20,21,22,23 UTC
Features: 40 core + 17 experimental | Adaptive: ON
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Then one of two paths:
-
Saved brain found:
π§ Brain loaded (fitted=True, batch=True, models: {...}) β Loaded saved brain β skipping dataset training! -
No brain: the bot reloads the trade journal (
π Reloaded N trades from journal β models retrained!if you have history) and pre-trains from the dataset (Loading dataset from EURUSD_M1.csv β¦,π Training on N samples (70%) β¦, a walk-forward report, andβ Pre-trained on N samples!).
Then the connection and warm-up:
Connecting to PocketOption β¦
Connected! Balance: $123.45
Loading 60 warmup candles β¦
Loaded 60 candles. Starting main loop β¦
π‘ Using subscribe_symbol_time_aligned (timeframe=60s)
From here the bot polls for a trade opportunity every 2 seconds. While gates are blocking, it logs a βΈ diagnostic line at most every 30 seconds (e.g. βΈ Low confidence: 58.2% (need 63.0%) dir=call regime=ranging). When a trade fires you see a βΆ TRADE line, and later a β
WIN / β LOSS result line. Reading these is covered in Live trading.
5. Stopping the bot
Press Ctrl+C. main.py catches the interrupt and runs a clean shutdown:
Interrupted, shutting down...
π§ Brain saved to athena_brain.pkl
Bot stopped. Final stats: ...
stop() saves the brain (and the companion athena_brain_expiry.pkl expiry stats) before exiting, so learned state survives restarts. Trade history is already persisted continuously in trade_journal.db β see Persistence.
Risk note
This bot places real trades with real money once connected. Binary options trading carries a high risk of losing money, and past performance (including walk-forward test results) does not guarantee future results. Start with a demo account and the smallest stakes your account allows, and set PO_MAX_DAILY_LOSS conservatively.
Next steps
- Configuration β all three configuration layers.
- Live trading β day-to-day operation and reading logs.
- Troubleshooting β if something above didnβt match.
π¬ Stuck during setup? The Chipa Discord is the fastest place to get help β and if youβd rather skip the code entirely, build your strategy visually with ChipaEditor.